r86113 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86112‎ | r86113 | r86114 >
Date:11:19, 15 April 2011
Author:freakolowsky
Status:resolved (Comments)
Tags:
Comment:
* added E_DEPRECATED into wfSupressWarnings

merge into 1.17 if required PHP version will be 5.3+
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1777,7 +1777,7 @@
17781778 }
17791779 } else {
17801780 if ( !$suppressCount ) {
1781 - $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE ) );
 1781+ $originalLevel = error_reporting( E_ALL & ~( E_WARNING | E_NOTICE | E_USER_WARNING | E_USER_NOTICE | E_DEPRECATED ) );
17821782 }
17831783 ++$suppressCount;
17841784 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r86368Follow-up r86113: define E_DEPRECATED for PHP 5.2happy-melon23:36, 18 April 2011

Comments

#Comment by MaxSem (talk | contribs)   11:50, 15 April 2011

Why? E_DEPRECATED helps a lot.

#Comment by Freakolowsky (talk | contribs)   11:53, 15 April 2011

Sure it is, so set it on a global level as you test your code, but when warnings are suppressed i don't see why deprecated should be an exception.

#Comment by MaxSem (talk | contribs)   11:57, 15 April 2011

Consider the following:

wfSuppressWarnings();
$db = &wfGetDB( DB_SLAVE );
wfRestoreWarnings();

Why don't you want to be able to be informed about such problems?

#Comment by Happy-melon (talk | contribs)   11:58, 15 April 2011

PHP 5.3 is not required for 1.17 or (currently) 1.18, so this needs B/C for PHP 5.2 if E_DEPRECATED is not defined.

#Comment by Freakolowsky (talk | contribs)   12:02, 15 April 2011

Specifically because of wfDl function which drops deprecated warning messages into the page and generated LocalSettings.php file in the installer.

The other options would be to either make something like wfRealySupressWarnings which would include E_DEPRECATED or remove call of dl() function completely.

#Comment by 😂 (talk | contribs)   23:35, 20 April 2011

r86574 should shut up your wfDl() errors.

#Comment by Saper (talk | contribs)   23:10, 18 April 2011

Pretty much user visible when running php maintenance/update.php on PHP 5.2.14:

PHP Notice:  Use of undefined constant E_DEPRECATED - assumed 'E_DEPRECATED' in /var/www/komar.wikimedia.pl/htdocs/w/includes/GlobalFunctions.php on line 1780
MediaWiki 1.18alpha Updater

Going to run database updates for komarwiki-komar_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown with --quick) ... 4       0
...have ipb_id field in ipblocks table.
...

Status & tagging log