[textpattern] r3284 committed - Silence E_STRICT warnings in "live" production mode, mind E_STRICT dif...

2 views
Skip to first unread message

textp...@googlecode.com

unread,
Oct 30, 2009, 7:45:20 AM10/30/09
to txp...@googlegroups.com
Revision: 3284
Author: r.wetzlmayr
Date: Fri Oct 30 04:44:08 2009
Log: Silence E_STRICT warnings in "live" production mode, mind E_STRICT
differences between PHP 5 and 6. Kind of fixes issue 48.
http://code.google.com/p/textpattern/source/detail?r=3284

Modified:
/development/4.x/textpattern/lib/txplib_misc.php

=======================================
--- /development/4.x/textpattern/lib/txplib_misc.php Mon Aug 24 04:33:44
2009
+++ /development/4.x/textpattern/lib/txplib_misc.php Fri Oct 30 04:44:08
2009
@@ -1416,12 +1416,13 @@
{

if ($level == 'debug') {
- error_reporting(E_ALL);
+ error_reporting(E_ALL /* TODO: Enable E_STRICT in debug mode/PHP5.x? |
(defined('E_STRICT') ? E_STRICT : 0) */);
}
elseif ($level == 'live') {
// don't show errors on screen
$suppress = E_WARNING | E_NOTICE;
- if (defined('E_STRICT')) $suppress |= E_STRICT;
+ // E_STRICT is defined since PHP 5.x and is a member of E_ALL in PHP
6.x. Now handle that!
+ if (defined('E_STRICT') && (E_ALL & E_STRICT)) $suppress |= E_STRICT;
if (defined('E_DEPRECATED')) $suppress |= E_DEPRECATED;
error_reporting(E_ALL ^ $suppress);
@ini_set("display_errors","1");

Reply all
Reply to author
Forward
0 new messages