* @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.
$this->reportQueryError( $this->lastError(), $this->lastErrno(), $sql, $fname, $tempIgnore );
}
- if ( $wgProfiling ) {
+ if ( isset( $wgProfiler ) ) {
wfProfileOut( $queryProf );
wfProfileOut( $totalProf );
}
*/
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 );
}
}
* @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' );
#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 );
# 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";