Removed usage of deprecated settings
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 6 Apr 2008 16:14:04 +0000 (16:14 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Sun, 6 Apr 2008 16:14:04 +0000 (16:14 +0000)
includes/Database.php
includes/GlobalFunctions.php
includes/LinkCache.php
maintenance/eval.php
maintenance/refreshLinks.inc

index 486877f..df68f7a 100644 (file)
@@ -447,10 +447,10 @@ class Database {
         * @throws DBQueryError Thrown when the database returns an error of any kind
         */
        public function query( $sql, $fname = '', $tempIgnore = false ) {
-               global $wgProfiling;
+               global $wgProfiler;
 
                $isMaster = !is_null( $this->getLBInfo( 'master' ) );
-               if ( $wgProfiling ) {
+               if ( isset( $wgProfiler ) ) {
                        # generalizeSQL will probably cut down the query to reasonable
                        # logging size most of the time. The substr is really just a sanity check.
 
@@ -533,7 +533,7 @@ class Database {
                        $this->reportQueryError( $this->lastError(), $this->lastErrno(), $sql, $fname, $tempIgnore );
                }
 
-               if ( $wgProfiling ) {
+               if ( isset( $wgProfiler ) ) {
                        wfProfileOut( $queryProf );
                        wfProfileOut( $totalProf );
                }
index c65c2fe..f28d7cf 100644 (file)
@@ -255,29 +255,30 @@ function wfErrorLog( $text, $file ) {
  */
 function wfLogProfilingData() {
        global $wgRequestTime, $wgDebugLogFile, $wgDebugRawPage, $wgRequest;
-       global $wgProfiling, $wgUser;
-       if ( $wgProfiling ) {
-               $now = wfTime();
-               $elapsed = $now - $wgRequestTime;
-               $prof = wfGetProfilingOutput( $wgRequestTime, $elapsed );
-               $forward = '';
-               if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
-                       $forward = ' forwarded for ' . $_SERVER['HTTP_X_FORWARDED_FOR'];
-               if( !empty( $_SERVER['HTTP_CLIENT_IP'] ) )
-                       $forward .= ' client IP ' . $_SERVER['HTTP_CLIENT_IP'];
-               if( !empty( $_SERVER['HTTP_FROM'] ) )
-                       $forward .= ' from ' . $_SERVER['HTTP_FROM'];
-               if( $forward )
-                       $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})";
-               // Don't unstub $wgUser at this late stage just for statistics purposes
-               if( StubObject::isRealObject($wgUser) && $wgUser->isAnon() )
-                       $forward .= ' anon';
-               $log = sprintf( "%s\t%04.3f\t%s\n",
-                 gmdate( 'YmdHis' ), $elapsed,
-                 urldecode( $wgRequest->getRequestURL() . $forward ) );
-               if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) {
-                       wfErrorLog( $log . $prof, $wgDebugLogFile );
-               }
+       global $wgProfiler, $wgUser;
+       if ( !isset( $wgProfiler ) )
+               return;
+
+       $now = wfTime();
+       $elapsed = $now - $wgRequestTime;
+       $prof = wfGetProfilingOutput( $wgRequestTime, $elapsed );
+       $forward = '';
+       if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
+               $forward = ' forwarded for ' . $_SERVER['HTTP_X_FORWARDED_FOR'];
+       if( !empty( $_SERVER['HTTP_CLIENT_IP'] ) )
+               $forward .= ' client IP ' . $_SERVER['HTTP_CLIENT_IP'];
+       if( !empty( $_SERVER['HTTP_FROM'] ) )
+               $forward .= ' from ' . $_SERVER['HTTP_FROM'];
+       if( $forward )
+               $forward = "\t(proxied via {$_SERVER['REMOTE_ADDR']}{$forward})";
+       // Don't unstub $wgUser at this late stage just for statistics purposes
+       if( StubObject::isRealObject($wgUser) && $wgUser->isAnon() )
+               $forward .= ' anon';
+       $log = sprintf( "%s\t%04.3f\t%s\n",
+         gmdate( 'YmdHis' ), $elapsed,
+         urldecode( $wgRequest->getRequestURL() . $forward ) );
+       if ( '' != $wgDebugLogFile && ( $wgRequest->getVal('action') != 'raw' || $wgDebugRawPage ) ) {
+               wfErrorLog( $log . $prof, $wgDebugLogFile );
        }
 }
 
index 7c49d88..1c094f6 100644 (file)
@@ -110,8 +110,8 @@ class LinkCache {
                if ( 0 != $id ) { return $id; }
 
                $fname = 'LinkCache::addLinkObj';
-               global $wgProfiling, $wgProfiler;
-               if ( $wgProfiling && isset( $wgProfiler ) ) {
+               global $wgProfiler;
+               if ( isset( $wgProfiler ) ) {
                        $fname .= ' (' . $wgProfiler->getCurrentSection() . ')';
                }
 
index 605576e..1545c30 100644 (file)
  * @addtogroup Maintenance
  */
 
-$wgForceLoadBalancing = (getenv('MW_BALANCE') ? true : false);
-$wgUseNormalUser = (getenv('MW_WIKIUSER') ? true : false);
-if (getenv('MW_PROFILING')) {
-       define('MW_CMDLINE_CALLBACK', 'wfSetProfiling');
-}
-function wfSetProfiling() { $GLOBALS['wgProfiling'] = true; }
+$wgUseNormalUser = (bool)getenv('MW_WIKIUSER');
 
 $optionsWithArgs = array( 'd' );
 
index 70e2a5d..48d9971 100644 (file)
@@ -9,7 +9,7 @@ define( "REPORTING_INTERVAL", 100 );
 #define( "REPORTING_INTERVAL", 1 );
 
 function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $redirectsOnly = false, $oldRedirectsOnly = false ) {
-       global $wgUser, $wgParser, $wgUseImageResize, $wgUseTidy;
+       global $wgUser, $wgParser, $wgUseTidy;
 
        $fname = 'refreshLinks';
        $dbr = wfGetDB( DB_SLAVE );
@@ -21,8 +21,7 @@ function refreshLinks( $start, $newOnly = false, $maxLag = false, $end = 0, $red
        # Don't generate extension images (e.g. Timeline)
        $wgParser->clearTagHooks();
 
-       # Don't generate thumbnail images
-       $wgUseImageResize = false;
+       # Don't use HTML tidy
        $wgUseTidy = false;
 
        $what = $redirectsOnly ? "redirects" : "links";