Author:   Lars Michelsen <[email protected]>
Date:     Thu Oct 27 15:42:20 2011 +0200
Committer:   Lars Michelsen <[email protected]>
Commit-Date: Thu Oct 27 15:42:20 2011 +0200

Added workaround for the annoying PHP warning which occurs on some
systems: It is not safe to rely on the system's timezone settings

---

 ChangeLog                                          |    2 ++
 share/server/core/functions/oldPhpVersionFixes.php |   12 ++++++++++++
 2 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 51844a6..22787f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,8 @@
 1.6
 Core
   * Bugfix: Fixed inclusion problem of default settings in some rare cases
+  * Added workaround for the annoying PHP warning which occurs on some systems:
+    It is not safe to rely on the system's timezone settings
 
 1.6rc3
 Core
diff --git a/share/server/core/functions/oldPhpVersionFixes.php 
b/share/server/core/functions/oldPhpVersionFixes.php
index 3227c8c..4780b53 100644
--- a/share/server/core/functions/oldPhpVersionFixes.php
+++ b/share/server/core/functions/oldPhpVersionFixes.php
@@ -41,6 +41,18 @@ if(!function_exists('date_default_timezone_set')) {
        }
 }
 
+// To prevent the annoying and in most cases useless message:
+//
+// Error: (0) date() [function.date]: It is not safe to rely on the system's
+// timezone settings. You are *required* to use the date.timezone setting or
+// the date_default_timezone_set() function. In case you used any of those
+// methods and you are still getting this warning, you most likely misspelled
+// the timezone identifier. We selected 'Europe/Berlin' for 'CEST/2.0/DST' 
instead
+//
+// Workaround the problem by setting the systems timezone as PHP default
+// timezone. Don't let PHP know about that hack - it would cry again ;-).
+if(function_exists("date_default_timezone_get"))
+    date_default_timezone_set(@date_default_timezone_get());
 
 /**
  * Implements handling of PHP to JSON conversion for NagVis


------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
Nagvis-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/nagvis-checkins

Reply via email to