Added wfSuppressWarnings and wfRestoreWarnings
authorJacob Clark <jacob.jh.clark@googlemail.com>
Sat, 1 Feb 2014 15:25:29 +0000 (15:25 +0000)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sun, 2 Feb 2014 19:23:24 +0000 (19:23 +0000)
Added wfSuppressWarnings and wfRestoreWarnings before and after the
ini_set call to apc cache by default to suppress errors if ini_set is
disabled.

Change-Id: If91e99c30fce3af14e69acd35112af188e62b6ac

includes/cache/LocalisationCache.php

index cba2ba7..9047a47 100644 (file)
@@ -510,9 +510,15 @@ class LocalisationCache {
        protected function readPHPFile( $_fileName, $_fileType ) {
                wfProfileIn( __METHOD__ );
                // Disable APC caching
+               wfSuppressWarnings();
                $_apcEnabled = ini_set( 'apc.cache_by_default', '0' );
+               wfRestoreWarnings();
+
                include $_fileName;
+
+               wfSuppressWarnings();
                ini_set( 'apc.cache_by_default', $_apcEnabled );
+               wfRestoreWarnings();
 
                if ( $_fileType == 'core' || $_fileType == 'extension' ) {
                        $data = compact( self::$allKeys );