Removed remaining profile calls

Change-Id: I31c81c78715048004fc8fca0f27d09c1fa71c118
This commit is contained in:
Aaron Schulz 2015-01-08 02:32:34 -08:00
parent 69998a7e0d
commit 4ff8136807
41 changed files with 0 additions and 248 deletions

View file

@ -42,7 +42,6 @@ if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3
require __DIR__ . '/includes/WebStart.php';
wfProfileIn( 'api.php' );
$starttime = microtime( true );
// URL safety checks
@ -94,7 +93,6 @@ DeferredUpdates::doUpdates();
// Log what the user did, for book-keeping purposes.
$endtime = microtime( true );
wfProfileOut( 'api.php' );
wfLogProfilingData();

View file

@ -39,7 +39,6 @@
define( 'MW_NO_OUTPUT_COMPRESSION', 1 );
require __DIR__ . '/includes/WebStart.php';
wfProfileIn( 'img_auth.php' );
# Set action base paths so that WebRequest::getPathInfo()
# recognizes the "X" as the 'title' in ../img_auth.php/X urls.
@ -47,7 +46,6 @@ $wgArticlePath = false; # Don't let a "/*" article path clober our action path
$wgActionPaths = array( "$wgUploadPath/" );
wfImageAuthMain();
wfProfileOut( 'img_auth.php' );
wfLogProfilingData();
// Commit and close up!
$factory = wfGetLBFactory();

View file

@ -515,7 +515,6 @@ class EditPage {
return;
}
wfProfileIn( __METHOD__ . "-business-end" );
$this->isConflict = false;
// css / js subpages of user pages get a special treatment
@ -537,7 +536,6 @@ class EditPage {
if ( 'save' == $this->formtype ) {
if ( !$this->attemptSave() ) {
wfProfileOut( __METHOD__ . "-business-end" );
return;
}
}
@ -547,7 +545,6 @@ class EditPage {
if ( 'initial' == $this->formtype || $this->firsttime ) {
if ( $this->initialiseForm() === false ) {
$this->noSuchSectionPage();
wfProfileOut( __METHOD__ . "-business-end" );
return;
}
@ -560,7 +557,6 @@ class EditPage {
}
$this->showEditForm();
wfProfileOut( __METHOD__ . "-business-end" );
}
/**
@ -744,13 +740,10 @@ class EditPage {
// Skip this if wpTextbox2 has input, it indicates that we came
// from a conflict page with raw page text, not a custom form
// modified by subclasses
wfProfileIn( get_class( $this ) . "::importContentFormData" );
$textbox1 = $this->importContentFormData( $request );
if ( $textbox1 !== null ) {
$this->textbox1 = $textbox1;
}
wfProfileOut( get_class( $this ) . "::importContentFormData" );
}
# Truncate for whole multibyte characters
@ -1526,13 +1519,11 @@ class EditPage {
$status = Status::newGood();
wfProfileIn( __METHOD__ . '-checks' );
if ( !Hooks::run( 'EditPage::attemptSave', array( $this ) ) ) {
wfDebug( "Hook 'EditPage::attemptSave' aborted article saving\n" );
$status->fatal( 'hookaborted' );
$status->value = self::AS_HOOK_ERROR;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1549,7 +1540,6 @@ class EditPage {
);
$status->fatal( 'spamprotectionmatch', false );
$status->value = self::AS_SPAM_ERROR;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1564,7 +1554,6 @@ class EditPage {
$ex->getMessage()
);
$status->value = self::AS_PARSE_ERROR;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1576,7 +1565,6 @@ class EditPage {
$code = $wgUser->isAnon() ? self::AS_IMAGE_REDIRECT_ANON : self::AS_IMAGE_REDIRECT_LOGGED;
$status->setResult( false, $code );
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1606,7 +1594,6 @@ class EditPage {
wfDebugLog( 'SpamRegex', "$ip spam regex hit [[$pdbk]]: \"$match\"" );
$status->fatal( 'spamprotectionmatch', $match );
$status->value = self::AS_SPAM_ERROR;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
if ( !Hooks::run(
@ -1616,13 +1603,11 @@ class EditPage {
# Error messages etc. could be handled within the hook...
$status->fatal( 'hookaborted' );
$status->value = self::AS_HOOK_ERROR;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
} elseif ( $this->hookError != '' ) {
# ...or the hook could be expecting us to produce an error
$status->fatal( 'hookaborted' );
$status->value = self::AS_HOOK_ERROR_EXPECTED;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1631,7 +1616,6 @@ class EditPage {
$wgUser->spreadAnyEditBlock();
# Check block state against master, thus 'false'.
$status->setResult( false, self::AS_BLOCKED_PAGE_FOR_USER );
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1640,19 +1624,16 @@ class EditPage {
// Error will be displayed by showEditForm()
$this->tooBig = true;
$status->setResult( false, self::AS_CONTENT_TOO_BIG );
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
if ( !$wgUser->isAllowed( 'edit' ) ) {
if ( $wgUser->isAnon() ) {
$status->setResult( false, self::AS_READ_ONLY_PAGE_ANON );
wfProfileOut( __METHOD__ . '-checks' );
return $status;
} else {
$status->fatal( 'readonlytext' );
$status->value = self::AS_READ_ONLY_PAGE_LOGGED;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
}
@ -1661,20 +1642,17 @@ class EditPage {
&& !$wgUser->isAllowed( 'editcontentmodel' )
) {
$status->setResult( false, self::AS_NO_CHANGE_CONTENT_MODEL );
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
if ( wfReadOnly() ) {
$status->fatal( 'readonlytext' );
$status->value = self::AS_READ_ONLY_PAGE;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
if ( $wgUser->pingLimiter() || $wgUser->pingLimiter( 'linkpurge', 0 ) ) {
$status->fatal( 'actionthrottledtext' );
$status->value = self::AS_RATE_LIMITED;
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
@ -1682,11 +1660,9 @@ class EditPage {
# confirmation
if ( $this->wasDeletedSinceLastEdit() && !$this->recreate ) {
$status->setResult( false, self::AS_ARTICLE_WAS_DELETED );
wfProfileOut( __METHOD__ . '-checks' );
return $status;
}
wfProfileOut( __METHOD__ . '-checks' );
# Load the page data from the master. If anything changes in the meantime,
# we detect it by using page_latest like a token in a 1 try compare-and-swap.
@ -1859,7 +1835,6 @@ class EditPage {
}
# All's well
wfProfileIn( __METHOD__ . '-sectionanchor' );
$sectionanchor = '';
if ( $this->section == 'new' ) {
$this->summary = $this->newSectionSummary( $sectionanchor );
@ -1876,7 +1851,6 @@ class EditPage {
}
}
$result['sectionanchor'] = $sectionanchor;
wfProfileOut( __METHOD__ . '-sectionanchor' );
// Save errors may fall down to the edit form, but we've now
// merged the section into full text. Clear the section field

View file

@ -127,7 +127,6 @@ class FeedUtils {
}
if ( $oldid ) {
wfProfileIn( __METHOD__ . "-dodiff" );
#$diffText = $de->getDiff( wfMessage( 'revisionasof',
# $wgLang->timeanddate( $timestamp ),
@ -168,7 +167,6 @@ class FeedUtils {
$diffText = UtfNormal::cleanUp( $diffText );
$diffText = self::applyDiffStyle( $diffText );
}
wfProfileOut( __METHOD__ . "-dodiff" );
} else {
$rev = Revision::newFromId( $newid );
if ( $wgFeedDiffCutoff <= 0 || is_null( $rev ) ) {

View file

@ -261,7 +261,6 @@ class HtmlFormatter {
public function getText( $element = null ) {
if ( $this->doc ) {
wfProfileIn( __METHOD__ . '-dom' );
if ( $element !== null && !( $element instanceof DOMElement ) ) {
$element = $this->doc->getElementById( $element );
}
@ -277,9 +276,7 @@ class HtmlFormatter {
$body->appendChild( $element );
}
$html = $this->doc->saveHTML();
wfProfileOut( __METHOD__ . '-dom' );
wfProfileIn( __METHOD__ . '-fixes' );
$html = $this->fixLibXml( $html );
if ( wfIsWindows() ) {
// Cleanup for CRLF misprocessing of unknown origin on Windows.
@ -288,7 +285,6 @@ class HtmlFormatter {
// XML code paths if possible and fix there.
$html = str_replace( '&#13;', '', $html );
}
wfProfileOut( __METHOD__ . '-fixes' );
} else {
$html = $this->html;
}
@ -296,12 +292,10 @@ class HtmlFormatter {
$html = preg_replace( '/<!--.*?-->|^.*?<body>|<\/body>.*$/s', '', $html );
$html = $this->onHtmlReady( $html );
wfProfileIn( __METHOD__ . '-flatten' );
if ( $this->elementsToFlatten ) {
$elements = implode( '|', $this->elementsToFlatten );
$html = preg_replace( "#</?($elements)\\b[^>]*>#is", '', $html );
}
wfProfileOut( __METHOD__ . '-flatten' );
return $html;
}

View file

@ -59,7 +59,6 @@ class Http {
*/
public static function request( $method, $url, $options = array() ) {
wfDebug( "HTTP: $method: $url\n" );
wfProfileIn( __METHOD__ . "-$method" );
$options['method'] = strtoupper( $method );
@ -77,7 +76,6 @@ class Http {
if ( $status->isOK() ) {
$content = $req->getContent();
}
wfProfileOut( __METHOD__ . "-$method" );
return $content;
}

View file

@ -218,7 +218,6 @@ class Linker {
$target = self::normaliseSpecialPage( $target );
# If we don't know whether the page exists, let's find out.
wfProfileIn( __METHOD__ . '-checkPageExistence' );
if ( !in_array( 'known', $options ) && !in_array( 'broken', $options ) ) {
if ( $target->isKnown() ) {
$options[] = 'known';
@ -226,7 +225,6 @@ class Linker {
$options[] = 'broken';
}
}
wfProfileOut( __METHOD__ . '-checkPageExistence' );
$oldquery = array();
if ( in_array( "forcearticlepath", $options ) && $query ) {
@ -319,7 +317,6 @@ class Linker {
$defaults = array();
if ( !in_array( 'noclasses', $options ) ) {
wfProfileIn( __METHOD__ . '-getClasses' );
# Now build the classes.
$classes = array();
@ -340,7 +337,6 @@ class Linker {
if ( $classes != array() ) {
$defaults['class'] = implode( ' ', $classes );
}
wfProfileOut( __METHOD__ . '-getClasses' );
}
# Get a default title attribute.

View file

@ -536,7 +536,6 @@ class MediaWiki {
}
if ( $this->config->get( 'UseFileCache' ) && $title->getNamespace() >= 0 ) {
wfProfileIn( 'main-try-filecache' );
if ( HTMLFileCache::useFileCache( $this->context ) ) {
// Try low-level file cache hit
$cache = new HTMLFileCache( $title, $action );
@ -551,11 +550,9 @@ class MediaWiki {
$this->context->getWikiPage()->doViewUpdates( $this->context->getUser() );
// Tell OutputPage that output is taken care of
$this->context->getOutput()->disable();
wfProfileOut( 'main-try-filecache' );
return;
}
}
wfProfileOut( 'main-try-filecache' );
}
// Actually do the work of the request and build up any output

View file

@ -52,9 +52,7 @@ class StreamFile {
if ( $res == self::NOT_MODIFIED ) {
$ok = true; // use client cache
} elseif ( $res == self::READY_STREAM ) {
wfProfileIn( __METHOD__ . '-send' );
$ok = readfile( $fname );
wfProfileOut( __METHOD__ . '-send' );
} else {
$ok = false; // failed
}

View file

@ -150,10 +150,8 @@ class StubObject {
if ( get_class( $GLOBALS[$this->global] ) != $this->class ) {
$fname = __METHOD__ . '-' . $this->global;
wfProfileIn( $fname );
$caller = wfGetCaller( $level );
if ( ++$recursionLevel > 2 ) {
wfProfileOut( $fname );
throw new MWException( "Unstub loop detected on call of "
. "\${$this->global}->$name from $caller\n" );
}
@ -161,7 +159,6 @@ class StubObject {
. "\${$this->global}::$name from $caller\n" );
$GLOBALS[$this->global] = $this->_newObject();
--$recursionLevel;
wfProfileOut( $fname );
return $GLOBALS[$this->global];
}
}

View file

@ -1706,7 +1706,6 @@ class User implements IDBAccessObject {
}
global $wgMemc;
wfProfileIn( __METHOD__ . '-' . $action );
$limits = $wgRateLimits[$action];
$keys = array();
@ -1787,7 +1786,6 @@ class User implements IDBAccessObject {
}
}
wfProfileOut( __METHOD__ . '-' . $action );
return $triggered;
}

View file

@ -74,7 +74,6 @@ if ( file_exists( "$IP/StartProfiler.php" ) ) {
require "$IP/StartProfiler.php";
}
wfProfileIn( 'WebStart.php-conf' );
# Load default settings
require_once "$IP/includes/DefaultSettings.php";
@ -107,9 +106,7 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) {
require_once MW_CONFIG_FILE;
}
wfProfileOut( 'WebStart.php-conf' );
wfProfileIn( 'WebStart.php-ob_start' );
# Initialise output buffering
# Check that there is no previous output or previously set up buffers, because
# that would cause us to potentially mix gzip and non-gzip output, creating a
@ -118,7 +115,6 @@ if ( ob_get_level() == 0 ) {
require_once "$IP/includes/OutputHandler.php";
ob_start( 'wfOutputHandler' );
}
wfProfileOut( 'WebStart.php-ob_start' );
if ( !defined( 'MW_NO_SETUP' ) ) {
require_once "$IP/includes/Setup.php";

View file

@ -94,9 +94,7 @@ class Xml {
$attribs = array_map( array( 'UtfNormal', 'cleanUp' ), $attribs );
}
if ( $contents ) {
wfProfileIn( __METHOD__ . '-norm' );
$contents = $wgContLang->normalize( $contents );
wfProfileOut( __METHOD__ . '-norm' );
}
return self::element( $element, $attribs, $contents );
}

View file

@ -257,9 +257,7 @@ class LocalisationCache {
*/
public function getItem( $code, $key ) {
if ( !isset( $this->loadedItems[$code][$key] ) ) {
wfProfileIn( __METHOD__ . '-load' );
$this->loadItem( $code, $key );
wfProfileOut( __METHOD__ . '-load' );
}
if ( $key === 'fallback' && isset( $this->shallowFallbacks[$code] ) ) {
@ -280,9 +278,7 @@ class LocalisationCache {
if ( !isset( $this->loadedSubitems[$code][$key][$subkey] ) &&
!isset( $this->loadedItems[$code][$key] )
) {
wfProfileIn( __METHOD__ . '-load' );
$this->loadSubitem( $code, $key, $subkey );
wfProfileOut( __METHOD__ . '-load' );
}
if ( isset( $this->data[$code][$key][$subkey] ) ) {
@ -859,7 +855,6 @@ class LocalisationCache {
$codeSequence = array_merge( array( $code ), $coreData['fallbackSequence'] );
$messageDirs = $this->getMessagesDirs();
wfProfileIn( __METHOD__ . '-fallbacks' );
# Load non-JSON localisation data for extensions
$extensionData = array_combine(
@ -957,7 +952,6 @@ class LocalisationCache {
}
}
wfProfileOut( __METHOD__ . '-fallbacks' );
# Add cache dependencies for any referenced globals
$deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
@ -1014,7 +1008,6 @@ class LocalisationCache {
}
# Save to the persistent cache
wfProfileIn( __METHOD__ . '-write' );
$this->store->startWrite( $code );
foreach ( $allData as $key => $value ) {
if ( in_array( $key, self::$splitKeys ) ) {
@ -1026,7 +1019,6 @@ class LocalisationCache {
}
}
$this->store->finishWrite();
wfProfileOut( __METHOD__ . '-write' );
# Clear out the MessageBlobStore
# HACK: If using a null (i.e. disabled) storage backend, we

View file

@ -275,7 +275,6 @@ class MessageCache {
# Hash of the contents is stored in memcache, to detect if local cache goes
# out of date (e.g. due to replace() on some other server)
if ( $wgUseLocalMessageCache ) {
wfProfileIn( __METHOD__ . '-fromlocal' );
$hash = $this->mMemc->get( wfMemcKey( 'messages', $code, 'hash' ) );
if ( $hash ) {
@ -291,7 +290,6 @@ class MessageCache {
$this->mCache[$code] = $cache;
}
}
wfProfileOut( __METHOD__ . '-fromlocal' );
}
if ( !$success ) {
@ -299,7 +297,6 @@ class MessageCache {
# the lock can't be acquired, wait for the other thread to finish
# and then try the global cache a second time.
for ( $failedAttempts = 0; $failedAttempts < 2; $failedAttempts++ ) {
wfProfileIn( __METHOD__ . '-fromcache' );
$cache = $this->mMemc->get( $cacheKey );
if ( !$cache ) {
$where[] = 'global cache is empty';
@ -313,7 +310,6 @@ class MessageCache {
$success = true;
}
wfProfileOut( __METHOD__ . '-fromcache' );
if ( $success ) {
# Done, no need to retry

View file

@ -361,7 +361,6 @@ class RequestContext implements IContextSource {
*/
public function getSkin() {
if ( $this->skin === null ) {
wfProfileIn( __METHOD__ . '-createskin' );
$skin = null;
Hooks::run( 'RequestContextCreateSkin', array( $this, &$skin ) );
@ -399,7 +398,6 @@ class RequestContext implements IContextSource {
// After all that set a context on whatever skin got created
$this->skin->setContext( $this );
wfProfileOut( __METHOD__ . '-createskin' );
}
return $this->skin;

View file

@ -71,7 +71,6 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
$this->mPassword = $password;
$this->mDBname = $dbName;
wfProfileIn( "dbconnect-$server" );
# The kernel's default SYN retransmission period is far too slow for us,
# so we use a short timeout plus a manual retry. Retrying means that a small
@ -81,13 +80,11 @@ abstract class DatabaseMysqlBase extends DatabaseBase {
try {
$this->mConn = $this->mysqlConnect( $realServer );
} catch ( Exception $ex ) {
wfProfileOut( "dbconnect-$server" );
$this->restoreErrorHandler();
throw $ex;
}
$error = $this->restoreErrorHandler();
wfProfileOut( "dbconnect-$server" );
# Always log connection errors
if ( !$this->mConn ) {

View file

@ -123,7 +123,6 @@ class SearchUpdate implements DeferrableUpdate {
$text = $wgContLang->normalizeForSearch( $text );
$lc = SearchEngine::legalSearchChars() . '&#;';
wfProfileIn( __METHOD__ . '-regexps' );
$text = preg_replace( "/<\\/?\\s*[A-Za-z][^>]*?>/",
' ', $wgContLang->lc( " " . $text . " " ) ); # Strip HTML markup
$text = preg_replace( "/(^|\\n)==\\s*([^\\n]+)\\s*==(\\s)/sD",
@ -170,7 +169,6 @@ class SearchUpdate implements DeferrableUpdate {
# Strip wiki '' and '''
$text = preg_replace( "/''[']*/", " ", $text );
wfProfileOut( __METHOD__ . '-regexps' );
return $text;
}

View file

@ -842,10 +842,8 @@ class DifferenceEngine extends ContextSource {
if ( $wgExternalDiffEngine == 'wikidiff2' && function_exists( 'wikidiff2_do_diff' ) ) {
# Better external diff engine, the 2 may some day be dropped
# This one does the escaping and segmenting itself
wfProfileIn( 'wikidiff2_do_diff' );
$text = wikidiff2_do_diff( $otext, $ntext, 2 );
$text .= $this->debug( 'wikidiff2' );
wfProfileOut( 'wikidiff2_do_diff' );
return $text;
}
@ -870,10 +868,8 @@ class DifferenceEngine extends ContextSource {
fclose( $tempFile1 );
fclose( $tempFile2 );
$cmd = wfEscapeShellArg( $wgExternalDiffEngine, $tempName1, $tempName2 );
wfProfileIn( __METHOD__ . "-shellexec" );
$difftext = wfShellExec( $cmd );
$difftext .= $this->debug( "external $wgExternalDiffEngine" );
wfProfileOut( __METHOD__ . "-shellexec" );
unlink( $tempName1 );
unlink( $tempName2 );

View file

@ -644,9 +644,7 @@ abstract class FileBackendStore extends FileBackend {
}
}
}
wfProfileIn( __METHOD__ . '-miss-' . $this->name );
$stat = $this->doGetFileStat( $params );
wfProfileOut( __METHOD__ . '-miss-' . $this->name );
if ( is_array( $stat ) ) { // file exists
// Strongly consistent backends can automatically set "latest"
$stat['latest'] = isset( $stat['latest'] ) ? $stat['latest'] : $latest;
@ -718,12 +716,8 @@ abstract class FileBackendStore extends FileBackend {
return $stat['map'];
}
}
wfProfileIn( __METHOD__ . '-miss' );
wfProfileIn( __METHOD__ . '-miss-' . $this->name );
$fields = $this->doGetFileXAttributes( $params );
$fields = is_array( $fields ) ? self::normalizeXAttributes( $fields ) : false;
wfProfileOut( __METHOD__ . '-miss-' . $this->name );
wfProfileOut( __METHOD__ . '-miss' );
$this->cheapCache->set( $path, 'xattr', array( 'map' => $fields, 'latest' => $latest ) );
return $fields;
@ -752,9 +746,7 @@ abstract class FileBackendStore extends FileBackend {
return $stat['hash'];
}
}
wfProfileIn( __METHOD__ . '-miss-' . $this->name );
$hash = $this->doGetFileSha1Base36( $params );
wfProfileOut( __METHOD__ . '-miss-' . $this->name );
$this->cheapCache->set( $path, 'sha1', array( 'hash' => $hash, 'latest' => $latest ) );
return $hash;
@ -865,9 +857,7 @@ abstract class FileBackendStore extends FileBackend {
if ( $res == StreamFile::NOT_MODIFIED ) {
// do nothing; client cache is up to date
} elseif ( $res == StreamFile::READY_STREAM ) {
wfProfileIn( __METHOD__ . '-send-' . $this->name );
$status = $this->doStreamFile( $params );
wfProfileOut( __METHOD__ . '-send-' . $this->name );
if ( !$status->isOK() ) {
// Per bug 41113, nasty things can happen if bad cache entries get
// stuck in cache. It's also possible that this error can come up

View file

@ -1285,13 +1285,11 @@ class SwiftFileBackend extends FileBackendStore {
return null;
}
wfProfileIn( __METHOD__ . "-{$this->name}-miss" );
list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array(
'method' => 'HEAD',
'url' => $this->storageUrl( $auth, $container ),
'headers' => $this->authTokenHeaders( $auth )
) );
wfProfileOut( __METHOD__ . "-{$this->name}-miss" );
if ( $rcode === 204 ) {
$stat = array(

View file

@ -1100,9 +1100,7 @@ abstract class File {
}
// Actually render the thumbnail...
wfProfileIn( __METHOD__ . '-doTransform' );
$thumb = $handler->doTransform( $this, $tmpThumbPath, $thumbUrl, $transformParams );
wfProfileOut( __METHOD__ . '-doTransform' );
$tmpFile->bind( $thumb ); // keep alive with $thumb
if ( !$thumb ) { // bad params?

View file

@ -1124,7 +1124,6 @@ class LocalFile extends File {
}
if ( !$props ) {
wfProfileIn( __METHOD__ . '-getProps' );
if ( $this->repo->isVirtualUrl( $srcPath )
|| FileBackend::isStoragePath( $srcPath )
) {
@ -1132,7 +1131,6 @@ class LocalFile extends File {
} else {
$props = FSFile::getPropsFromPath( $srcPath );
}
wfProfileOut( __METHOD__ . '-getProps' );
}
$options = array();
@ -1224,9 +1222,7 @@ class LocalFile extends File {
$dbw->begin( __METHOD__ );
if ( !$props ) {
wfProfileIn( __METHOD__ . '-getProps' );
$props = $this->repo->getFileProps( $this->getVirtualUrl() );
wfProfileOut( __METHOD__ . '-getProps' );
}
# Imports or such might force a certain timestamp; otherwise we generate
@ -1382,7 +1378,6 @@ class LocalFile extends File {
// Page exists, do RC entry now (otherwise we wait for later).
$logEntry->publish( $logId );
}
wfProfileIn( __METHOD__ . '-edit' );
if ( $exists ) {
# Create a null revision
@ -1449,22 +1444,17 @@ class LocalFile extends File {
$dbw->commit( __METHOD__ ); // commit before anything bad can happen
}
wfProfileOut( __METHOD__ . '-edit' );
if ( $reupload ) {
# Delete old thumbnails
wfProfileIn( __METHOD__ . '-purge' );
$this->purgeThumbnails();
wfProfileOut( __METHOD__ . '-purge' );
# Remove the old file from the squid cache
SquidUpdate::purge( array( $this->getURL() ) );
}
# Hooks, hooks, the magic of hooks...
wfProfileIn( __METHOD__ . '-hooks' );
Hooks::run( 'FileUpload', array( $this, $reupload, $descTitle->exists() ) );
wfProfileOut( __METHOD__ . '-hooks' );
# Invalidate cache for all pages using this file
$update = new HTMLCacheUpdate( $this->getTitle(), 'imagelinks' );

View file

@ -129,7 +129,6 @@ class JobRunner {
$this->runJobsLog( $job->toString() . " STARTING" );
// Run the job...
wfProfileIn( __METHOD__ . '-' . get_class( $job ) );
$jobStartTime = microtime( true );
try {
++$jobsRun;
@ -143,7 +142,6 @@ class JobRunner {
MWExceptionHandler::logException( $e );
}
$timeMs = intval( ( microtime( true ) - $jobStartTime ) * 1000 );
wfProfileOut( __METHOD__ . '-' . get_class( $job ) );
$timeMsTotal += $timeMs;
// Mark the job as done on success or when the job cannot be retried

View file

@ -169,10 +169,8 @@ class BitmapHandler extends TransformationalImageHandler {
array( $this->escapeMagickOutput( $params['dstPath'] ) ) ) );
wfDebug( __METHOD__ . ": running ImageMagick: $cmd\n" );
wfProfileIn( 'convert' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval, $env );
wfProfileOut( 'convert' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );
@ -280,10 +278,8 @@ class BitmapHandler extends TransformationalImageHandler {
$cmd = str_replace( '%h', wfEscapeShellArg( $params['physicalHeight'] ),
str_replace( '%w', wfEscapeShellArg( $params['physicalWidth'] ), $cmd ) ); # Size
wfDebug( __METHOD__ . ": Running custom convert command $cmd\n" );
wfProfileIn( 'convert' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval );
wfProfileOut( 'convert' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );
@ -457,10 +453,8 @@ class BitmapHandler extends TransformationalImageHandler {
" -rotate " . wfEscapeShellArg( "-$rotation" ) . " " .
wfEscapeShellArg( $this->escapeMagickOutput( $params['dstPath'] ) );
wfDebug( __METHOD__ . ": running ImageMagick: $cmd\n" );
wfProfileIn( 'convert' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval );
wfProfileOut( 'convert' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );

View file

@ -221,11 +221,9 @@ class DjVuHandler extends ImageHandler {
$cmd .= " | {$wgDjvuPostProcessor}";
}
$cmd .= ' > ' . wfEscapeShellArg( $dstPath ) . ') 2>&1';
wfProfileIn( 'ddjvu' );
wfDebug( __METHOD__ . ": $cmd\n" );
$retval = '';
$err = wfShellExec( $cmd, $retval );
wfProfileOut( 'ddjvu' );
$removed = $this->removeBadFile( $dstPath, $retval );
if ( $retval != 0 || $removed ) {

View file

@ -277,28 +277,22 @@ class DjVuImage {
if ( isset( $wgDjvuDump ) ) {
# djvudump is faster as of version 3.5
# http://sourceforge.net/tracker/index.php?func=detail&aid=1704049&group_id=32953&atid=406583
wfProfileIn( 'djvudump' );
$cmd = wfEscapeShellArg( $wgDjvuDump ) . ' ' . wfEscapeShellArg( $this->mFilename );
$dump = wfShellExec( $cmd );
$xml = $this->convertDumpToXML( $dump );
wfProfileOut( 'djvudump' );
} elseif ( isset( $wgDjvuToXML ) ) {
wfProfileIn( 'djvutoxml' );
$cmd = wfEscapeShellArg( $wgDjvuToXML ) . ' --without-anno --without-text ' .
wfEscapeShellArg( $this->mFilename );
$xml = wfShellExec( $cmd );
wfProfileOut( 'djvutoxml' );
} else {
$xml = null;
}
# Text layer
if ( isset( $wgDjvuTxt ) ) {
wfProfileIn( 'djvutxt' );
$cmd = wfEscapeShellArg( $wgDjvuTxt ) . ' --detail=page ' . wfEscapeShellArg( $this->mFilename );
wfDebug( __METHOD__ . ": $cmd\n" );
$retval = '';
$txt = wfShellExec( $cmd, $retval, array(), array( 'memory' => self::DJVUTXT_MEMORY_LIMIT ) );
wfProfileOut( 'djvutxt' );
if ( $retval == 0 ) {
# Strip some control characters
$txt = preg_replace( "/[\013\035\037]/", "", $txt );

View file

@ -143,10 +143,8 @@ class JpegHandler extends ExifBitmapHandler {
" -outfile " . wfEscapeShellArg( $params['dstPath'] ) .
" " . wfEscapeShellArg( $params['srcPath'] );
wfDebug( __METHOD__ . ": running jpgtran: $cmd\n" );
wfProfileIn( 'jpegtran' );
$retval = 0;
$err = wfShellExecWithStderr( $cmd, $retval );
wfProfileOut( 'jpegtran' );
if ( $retval !== 0 ) {
$this->logErrorForExternalProcess( $retval, $err, $cmd );

View file

@ -272,10 +272,8 @@ class SvgHandler extends ImageHandler {
$env['LANG'] = $lang;
}
wfProfileIn( 'rsvg' );
wfDebug( __METHOD__ . ": $cmd\n" );
$err = wfShellExecWithStderr( $cmd, $retval, $env );
wfProfileOut( 'rsvg' );
}
}
$removed = $this->removeBadFile( $dstPath, $retval );

View file

@ -289,7 +289,6 @@ class LinkHolderArray {
$linkCache = LinkCache::singleton();
$output = $this->parent->getOutput();
wfProfileIn( __METHOD__ . '-check' );
$dbr = wfGetDB( DB_SLAVE );
$threshold = $this->parent->getOptions()->getStubThreshold();
@ -375,7 +374,6 @@ class LinkHolderArray {
//pass an array of page_ids to an extension
Hooks::run( 'GetLinkColours', array( $linkcolour_ids, &$colours ) );
}
wfProfileOut( __METHOD__ . '-check' );
# Do a second query for different language variants of links and categories
if ( $wgContLang->hasVariants() ) {
@ -383,7 +381,6 @@ class LinkHolderArray {
}
# Construct search and replace arrays
wfProfileIn( __METHOD__ . '-construct' );
$replacePairs = array();
foreach ( $this->internals as $ns => $entries ) {
foreach ( $entries as $index => $entry ) {
@ -419,17 +416,14 @@ class LinkHolderArray {
}
}
$replacer = new HashtableReplacer( $replacePairs, 1 );
wfProfileOut( __METHOD__ . '-construct' );
# Do the thing
wfProfileIn( __METHOD__ . '-replace' );
$text = preg_replace_callback(
'/(<!--LINK .*?-->)/',
$replacer->cb(),
$text
);
wfProfileOut( __METHOD__ . '-replace' );
}
/**

View file

@ -395,7 +395,6 @@ class Parser {
global $wgShowHostnames;
$fname = __METHOD__ . '-' . wfGetCaller();
wfProfileIn( $fname );
if ( $clearState ) {
$magicScopeVariable = $this->lock();
@ -556,7 +555,6 @@ class Parser {
$this->mRevisionSize = $oldRevisionSize;
$this->mInputSize = false;
$this->currentRevisionCache = null;
wfProfileOut( $fname );
return $this->mOutput;
}
@ -2008,7 +2006,6 @@ class Parser {
public function replaceInternalLinks2( &$s ) {
global $wgExtraInterlanguageLinkPrefixes;
wfProfileIn( __METHOD__ . '-setup' );
static $tc = false, $e1, $e1_img;
# the % is needed to support urlencoded titles as well
if ( !$tc ) {
@ -2040,7 +2037,6 @@ class Parser {
}
if ( is_null( $this->mTitle ) ) {
wfProfileOut( __METHOD__ . '-setup' );
throw new MWException( __METHOD__ . ": \$this->mTitle is null\n" );
}
$nottalk = !$this->mTitle->isTalkPage();
@ -2057,7 +2053,6 @@ class Parser {
}
$useSubpages = $this->areSubpagesAllowed();
wfProfileOut( __METHOD__ . '-setup' );
// @codingStandardsIgnoreStart Squiz.WhiteSpace.SemicolonSpacing.Incorrect
# Loop for each link
@ -2073,7 +2068,6 @@ class Parser {
}
if ( $useLinkPrefixExtension ) {
wfProfileIn( __METHOD__ . '-prefixhandling' );
if ( preg_match( $e2, $s, $m ) ) {
$prefix = $m[2];
$s = $m[1];
@ -2085,12 +2079,10 @@ class Parser {
$prefix = $first_prefix;
$first_prefix = false;
}
wfProfileOut( __METHOD__ . '-prefixhandling' );
}
$might_be_img = false;
wfProfileIn( __METHOD__ . "-e1" );
if ( preg_match( $e1, $line, $m ) ) { # page with normal text or alt
$text = $m[2];
# If we get a ] at the beginning of $m[3] that means we have a link that's something like:
@ -2124,11 +2116,8 @@ class Parser {
$trail = "";
} else { # Invalid form; output directly
$s .= $prefix . '[[' . $line;
wfProfileOut( __METHOD__ . "-e1" );
continue;
}
wfProfileOut( __METHOD__ . "-e1" );
wfProfileIn( __METHOD__ . "-misc" );
$origLink = $m[1];
@ -2137,7 +2126,6 @@ class Parser {
# should be external links.
if ( preg_match( '/^(?i:' . $this->mUrlProtocols . ')/', $origLink ) ) {
$s .= $prefix . '[[' . $line;
wfProfileOut( __METHOD__ . "-misc" );
continue;
}
@ -2154,21 +2142,16 @@ class Parser {
$link = substr( $link, 1 );
}
wfProfileOut( __METHOD__ . "-misc" );
wfProfileIn( __METHOD__ . "-title" );
$nt = Title::newFromText( $this->mStripState->unstripNoWiki( $link ) );
if ( $nt === null ) {
$s .= $prefix . '[[' . $line;
wfProfileOut( __METHOD__ . "-title" );
continue;
}
$ns = $nt->getNamespace();
$iw = $nt->getInterwiki();
wfProfileOut( __METHOD__ . "-title" );
if ( $might_be_img ) { # if this is actually an invalid link
wfProfileIn( __METHOD__ . "-might_be_img" );
if ( $ns == NS_FILE && $noforce ) { # but might be an image
$found = false;
while ( true ) {
@ -2200,16 +2183,13 @@ class Parser {
$holders->merge( $this->replaceInternalLinks2( $text ) );
$s .= "{$prefix}[[$link|$text";
# note: no $trail, because without an end, there *is* no trail
wfProfileOut( __METHOD__ . "-might_be_img" );
continue;
}
} else { # it's not an image, so output it raw
$s .= "{$prefix}[[$link|$text";
# note: no $trail, because without an end, there *is* no trail
wfProfileOut( __METHOD__ . "-might_be_img" );
continue;
}
wfProfileOut( __METHOD__ . "-might_be_img" );
}
$wasblank = ( $text == '' );
@ -2226,7 +2206,6 @@ class Parser {
# Link not escaped by : , create the various objects
if ( $noforce && !$nt->wasLocalInterwiki() ) {
# Interwikis
wfProfileIn( __METHOD__ . "-interwiki" );
if (
$iw && $this->mOptions->getInterwikiMagic() && $nottalk && (
Language::fetchLanguageName( $iw, null, 'mw' ) ||
@ -2241,13 +2220,10 @@ class Parser {
$s = rtrim( $s . $prefix );
$s .= trim( $trail, "\n" ) == '' ? '': $prefix . $trail;
wfProfileOut( __METHOD__ . "-interwiki" );
continue;
}
wfProfileOut( __METHOD__ . "-interwiki" );
if ( $ns == NS_FILE ) {
wfProfileIn( __METHOD__ . "-image" );
if ( !wfIsBadImage( $nt->getDBkey(), $this->mTitle ) ) {
if ( $wasblank ) {
# if no parameters were passed, $text
@ -2268,12 +2244,10 @@ class Parser {
} else {
$s .= $prefix . $trail;
}
wfProfileOut( __METHOD__ . "-image" );
continue;
}
if ( $ns == NS_CATEGORY ) {
wfProfileIn( __METHOD__ . "-category" );
$s = rtrim( $s . "\n" ); # bug 87
if ( $wasblank ) {
@ -2291,7 +2265,6 @@ class Parser {
*/
$s .= trim( $prefix . $trail, "\n" ) == '' ? '' : $prefix . $trail;
wfProfileOut( __METHOD__ . "-category" );
continue;
}
}
@ -2307,7 +2280,6 @@ class Parser {
# NS_MEDIA is a pseudo-namespace for linking directly to a file
# @todo FIXME: Should do batch file existence checks, see comment below
if ( $ns == NS_MEDIA ) {
wfProfileIn( __METHOD__ . "-media" );
# Give extensions a chance to select the file revision for us
$options = array();
$descQuery = false;
@ -2318,11 +2290,9 @@ class Parser {
# Cloak with NOPARSE to avoid replacement in replaceExternalLinks
$s .= $prefix . $this->armorLinks(
Linker::makeMediaLinkFile( $nt, $file, $text ) ) . $trail;
wfProfileOut( __METHOD__ . "-media" );
continue;
}
wfProfileIn( __METHOD__ . "-always_known" );
# Some titles, such as valid special pages or files in foreign repos, should
# be shown as bluelinks even though they're not included in the page table
#
@ -2335,7 +2305,6 @@ class Parser {
# Links will be added to the output link list after checking
$s .= $holders->makeHolder( $nt, $text, array(), $trail, $prefix );
}
wfProfileOut( __METHOD__ . "-always_known" );
}
return $holders;
}
@ -2643,7 +2612,6 @@ class Parser {
# If we have no prefixes, go to paragraph mode.
if ( 0 == $prefixLength ) {
wfProfileIn( __METHOD__ . "-paragraph" );
# No prefix (not in list)--go to paragraph mode
# XXX: use a stack for nestable elements like span, table and div
$openmatch = preg_match(
@ -2712,7 +2680,6 @@ class Parser {
}
}
}
wfProfileOut( __METHOD__ . "-paragraph" );
}
# somewhere above we forget to get out of pre block (bug 785)
if ( $preCloseMatch && $this->mInPre ) {
@ -3430,7 +3397,6 @@ class Parser {
* @return string The text of the template
*/
public function braceSubstitution( $piece, $frame ) {
wfProfileIn( __METHOD__ . '-setup' );
// Flags
@ -3463,12 +3429,10 @@ class Parser {
# @todo FIXME: If piece['parts'] is null then the call to getLength()
# below won't work b/c this $args isn't an object
$args = ( null == $piece['parts'] ) ? array() : $piece['parts'];
wfProfileOut( __METHOD__ . '-setup' );
$profileSection = null; // profile templates
# SUBST
wfProfileIn( __METHOD__ . '-modifiers' );
if ( !$found ) {
$substMatch = $this->mSubstWords->matchStartAndRemove( $part1 );
@ -3525,11 +3489,9 @@ class Parser {
$forceRawInterwiki = true;
}
}
wfProfileOut( __METHOD__ . '-modifiers' );
# Parser functions
if ( !$found ) {
wfProfileIn( __METHOD__ . '-pfunc' );
$colonPos = strpos( $part1, ':' );
if ( $colonPos !== false ) {
@ -3541,7 +3503,6 @@ class Parser {
try {
$result = $this->callParserFunction( $frame, $func, $funcArgs );
} catch ( Exception $ex ) {
wfProfileOut( __METHOD__ . '-pfunc' );
throw $ex;
}
@ -3550,7 +3511,6 @@ class Parser {
# here.
extract( $result );
}
wfProfileOut( __METHOD__ . '-pfunc' );
}
# Finish mangling title and then check for loops.
@ -3586,7 +3546,6 @@ class Parser {
# Load from database
if ( !$found && $title ) {
$profileSection = $this->mProfiler->scopedProfileIn( $title->getPrefixedDBkey() );
wfProfileIn( __METHOD__ . '-loadtpl' );
if ( !$title->isExternal() ) {
if ( $title->isSpecialPage()
&& $this->mOptions->getAllowSpecialInclusion()
@ -3660,7 +3619,6 @@ class Parser {
. '</span>';
wfDebug( __METHOD__ . ": template loop broken at '$titleText'\n" );
}
wfProfileOut( __METHOD__ . '-loadtpl' );
}
# If we haven't found text to substitute by now, we're done
@ -3774,12 +3732,10 @@ class Parser {
}
}
wfProfileIn( __METHOD__ . '-pfunc-' . $function );
list( $callback, $flags ) = $this->mFunctionHooks[$function];
# Workaround for PHP bug 35229 and similar
if ( !is_callable( $callback ) ) {
wfProfileOut( __METHOD__ . '-pfunc-' . $function );
throw new MWException( "Tag hook for $function is not callable\n" );
}
@ -3844,7 +3800,6 @@ class Parser {
$result['text'] = $this->preprocessToDom( $result['text'], $preprocessFlags );
$result['isChildObj'] = true;
}
wfProfileOut( __METHOD__ . '-pfunc-' . $function );
return $result;
}
@ -5399,7 +5354,6 @@ class Parser {
$file = $this->fetchFileNoRegister( $title, $options );
$handler = $file ? $file->getHandler() : false;
wfProfileIn( __METHOD__ . '-getMagicWord' );
$paramMap = array(
'img_alt' => 'gallery-internal-alt',
'img_link' => 'gallery-internal-link',
@ -5412,7 +5366,6 @@ class Parser {
}
$mwArray = new MagicWordArray( array_keys( $paramMap ) );
wfProfileOut( __METHOD__ . '-getMagicWord' );
$label = '';
$alt = '';

View file

@ -86,7 +86,6 @@ class Preprocessor_DOM implements Preprocessor {
$xml .= "</list>";
wfProfileIn( __METHOD__ . '-loadXML' );
$dom = new DOMDocument();
wfSuppressWarnings();
$result = $dom->loadXML( $xml );
@ -98,7 +97,6 @@ class Preprocessor_DOM implements Preprocessor {
// don't barf when the XML is >256 levels deep
$result = $dom->loadXML( $xml, 1 << 19 );
}
wfProfileOut( __METHOD__ . '-loadXML' );
if ( !$result ) {
throw new MWException( 'Parameters passed to ' . __METHOD__ . ' result in invalid XML' );
@ -156,7 +154,6 @@ class Preprocessor_DOM implements Preprocessor {
$cacheable = ( $wgPreprocessorCacheThreshold !== false
&& strlen( $text ) > $wgPreprocessorCacheThreshold );
if ( $cacheable ) {
wfProfileIn( __METHOD__ . '-cacheable' );
$cacheKey = wfMemcKey( 'preprocess-xml', md5( $text ), $flags );
$cacheValue = $wgMemc->get( $cacheKey );
@ -169,11 +166,9 @@ class Preprocessor_DOM implements Preprocessor {
}
}
if ( $xml === false ) {
wfProfileIn( __METHOD__ . '-cache-miss' );
$xml = $this->preprocessToXml( $text, $flags );
$cacheValue = sprintf( "%08d", self::CACHE_VERSION ) . $xml;
$wgMemc->set( $cacheKey, $cacheValue, 86400 );
wfProfileOut( __METHOD__ . '-cache-miss' );
wfDebugLog( "Preprocessor", "Saved preprocessor XML to memcached (key $cacheKey)" );
}
} else {
@ -186,12 +181,10 @@ class Preprocessor_DOM implements Preprocessor {
$max = $this->parser->mOptions->getMaxGeneratedPPNodeCount();
if ( $this->parser->mGeneratedPPNodeCount > $max ) {
if ( $cacheable ) {
wfProfileOut( __METHOD__ . '-cacheable' );
}
throw new MWException( __METHOD__ . ': generated node count limit exceeded' );
}
wfProfileIn( __METHOD__ . '-loadXML' );
$dom = new DOMDocument;
wfSuppressWarnings();
$result = $dom->loadXML( $xml );
@ -206,10 +199,8 @@ class Preprocessor_DOM implements Preprocessor {
if ( $result ) {
$obj = new PPNode_DOM( $dom->documentElement );
}
wfProfileOut( __METHOD__ . '-loadXML' );
if ( $cacheable ) {
wfProfileOut( __METHOD__ . '-cacheable' );
}

View file

@ -120,7 +120,6 @@ class Preprocessor_Hash implements Preprocessor {
&& strlen( $text ) > $wgPreprocessorCacheThreshold;
if ( $cacheable ) {
wfProfileIn( __METHOD__ . '-cacheable' );
$cacheKey = wfMemcKey( 'preprocess-hash', md5( $text ), $flags );
$cacheValue = $wgMemc->get( $cacheKey );
@ -131,11 +130,9 @@ class Preprocessor_Hash implements Preprocessor {
// From the cache
wfDebugLog( "Preprocessor",
"Loaded preprocessor hash from memcached (key $cacheKey)" );
wfProfileOut( __METHOD__ . '-cacheable' );
return $hash;
}
}
wfProfileIn( __METHOD__ . '-cache-miss' );
}
$rules = array(
@ -635,15 +632,11 @@ class Preprocessor_Hash implements Preprocessor {
}
if ( !$node ) {
if ( $cacheable ) {
wfProfileOut( __METHOD__ . '-cache-miss' );
wfProfileOut( __METHOD__ . '-cacheable' );
}
throw new MWException( __METHOD__ . ': eqpos not found' );
}
if ( $node->name !== 'equals' ) {
if ( $cacheable ) {
wfProfileOut( __METHOD__ . '-cache-miss' );
wfProfileOut( __METHOD__ . '-cacheable' );
}
throw new MWException( __METHOD__ . ': eqpos is not equals' );
}
@ -744,8 +737,6 @@ class Preprocessor_Hash implements Preprocessor {
if ( $cacheable ) {
$cacheValue = sprintf( "%08d", self::CACHE_VERSION ) . serialize( $rootNode );
$wgMemc->set( $cacheKey, $cacheValue, 86400 );
wfProfileOut( __METHOD__ . '-cache-miss' );
wfProfileOut( __METHOD__ . '-cacheable' );
wfDebugLog( "Preprocessor", "Saved preprocessor Hash to memcached (key $cacheKey)" );
}

View file

@ -595,7 +595,6 @@ class ResourceLoader {
$this->errors[] = self::formatExceptionNoComment( $e );
}
wfProfileIn( __METHOD__ . '-getModifiedTime' );
// To send Last-Modified and support If-Modified-Since, we need to detect
// the last modified time
@ -614,7 +613,6 @@ class ResourceLoader {
}
}
wfProfileOut( __METHOD__ . '-getModifiedTime' );
// If there's an If-Modified-Since header, respond with a 304 appropriately
if ( $this->tryRespondLastModified( $context, $mtime ) ) {
@ -902,7 +900,6 @@ class ResourceLoader {
* @var $module ResourceLoaderModule
*/
wfProfileIn( __METHOD__ . '-' . $name );
try {
$scripts = '';
if ( $context->shouldIncludeScripts() ) {
@ -1016,7 +1013,6 @@ class ResourceLoader {
unset( $modules[$name] );
}
$isRaw |= $module->isRaw();
wfProfileOut( __METHOD__ . '-' . $name );
}
// Update module states

View file

@ -569,9 +569,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
return $this->modifiedTime[$context->getHash()];
}
wfProfileIn( __METHOD__ . '-filemtime' );
$filesMtime = max( array_map( array( __CLASS__, 'safeFilemtime' ), $files ) );
wfProfileOut( __METHOD__ . '-filemtime' );
$this->modifiedTime[$context->getHash()] = max(
$filesMtime,

View file

@ -67,7 +67,6 @@ class SearchHighlighter {
$spat .= '/';
$textExt = array(); // text extracts
$otherExt = array(); // other extracts
wfProfileIn( "$fname-split" );
$start = 0;
$textLen = strlen( $text );
$count = 0; // sequence number to maintain ordering
@ -132,7 +131,6 @@ class SearchHighlighter {
$all = $textExt + $otherExt; // these have disjunct key sets
wfProfileOut( "$fname-split" );
// prepare regexps
foreach ( $terms as $index => $term ) {
@ -163,7 +161,6 @@ class SearchHighlighter {
$pat1 = "/(" . $phrase . ")/ui";
$pat2 = "/$patPre(" . $anyterm . ")$patPost/ui";
wfProfileIn( "$fname-extract" );
$left = $contextlines;
@ -287,7 +284,6 @@ class SearchHighlighter {
}
}
wfProfileOut( "$fname-extract" );
return $extract;
}
@ -452,7 +448,6 @@ class SearchHighlighter {
*/
function removeWiki( $text ) {
$fname = __METHOD__;
wfProfileIn( $fname );
// $text = preg_replace( "/'{2,5}/", "", $text );
// $text = preg_replace( "/\[[a-z]+:\/\/[^ ]+ ([^]]+)\]/", "\\2", $text );
@ -474,7 +469,6 @@ class SearchHighlighter {
$text = preg_replace( "/('''|<\/?[iIuUbB]>)/", "", $text );
$text = preg_replace( "/''/", "", $text );
wfProfileOut( $fname );
return $text;
}
@ -523,7 +517,6 @@ class SearchHighlighter {
$lineno = 0;
$extract = "";
wfProfileIn( "$fname-extract" );
foreach ( $lines as $line ) {
if ( 0 == $contextlines ) {
break;
@ -551,7 +544,6 @@ class SearchHighlighter {
$extract .= "${line}\n";
}
wfProfileOut( "$fname-extract" );
return $extract;
}

View file

@ -180,11 +180,8 @@ class SkinTemplate extends Skin {
$user = $this->getUser();
$title = $this->getTitle();
wfProfileIn( __METHOD__ . '-init' );
$tpl = $this->setupTemplate( $this->template, 'skins' );
wfProfileOut( __METHOD__ . '-init' );
wfProfileIn( __METHOD__ . '-stuff' );
$this->thispage = $title->getPrefixedDBkey();
$this->titletxt = $title->getPrefixedText();
$this->userpage = $user->getUserPage()->getPrefixedText();
@ -207,7 +204,6 @@ class SkinTemplate extends Skin {
$this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
}
wfProfileOut( __METHOD__ . '-stuff' );
return $tpl;
@ -231,14 +227,10 @@ class SkinTemplate extends Skin {
$out = $this->getOutput();
wfProfileIn( __METHOD__ . '-init' );
$this->initPage( $out );
wfProfileOut( __METHOD__ . '-init' );
$tpl = $this->prepareQuickTemplate( $out );
// execute template
wfProfileIn( __METHOD__ . '-execute' );
$res = $tpl->execute();
wfProfileOut( __METHOD__ . '-execute' );
// result may be an error
$this->printOrError( $res );
@ -267,7 +259,6 @@ class SkinTemplate extends Skin {
$out = $this->getOutput();
$tpl = $this->setupTemplateForOutput();
wfProfileIn( __METHOD__ . '-stuff2' );
$tpl->set( 'title', $out->getPageTitle() );
$tpl->set( 'pagetitle', $out->getHTMLTitle() );
$tpl->set( 'displaytitle', $out->mPageLinkTitle );
@ -362,9 +353,7 @@ class SkinTemplate extends Skin {
$tpl->set( 'userlangattributes', $attrs );
}
wfProfileOut( __METHOD__ . '-stuff2' );
wfProfileIn( __METHOD__ . '-stuff3' );
$tpl->set( 'newtalk', $this->getNewtalks() );
$tpl->set( 'logo', $this->logoText() );
@ -385,9 +374,7 @@ class SkinTemplate extends Skin {
}
$tpl->set( 'copyright', $this->getCopyright() );
}
wfProfileOut( __METHOD__ . '-stuff3' );
wfProfileIn( __METHOD__ . '-stuff4' );
$tpl->set( 'copyrightico', $this->getCopyrightIcon() );
$tpl->set( 'poweredbyico', $this->getPoweredBy() );
$tpl->set( 'disclaimer', $this->disclaimerLink() );
@ -458,9 +445,7 @@ class SkinTemplate extends Skin {
} else {
$tpl->set( 'language_urls', false );
}
wfProfileOut( __METHOD__ . '-stuff4' );
wfProfileIn( __METHOD__ . '-stuff5' );
# Personal toolbar
$tpl->set( 'personal_urls', $this->buildPersonalUrls() );
$content_navigation = $this->buildContentNavigationUrls();
@ -500,7 +485,6 @@ class SkinTemplate extends Skin {
// allow extensions adding stuff after the page content.
// See Skin::afterContentHook() for further documentation.
$tpl->set( 'dataAfterContent', $this->afterContentHook() );
wfProfileOut( __METHOD__ . '-stuff5' );
return $tpl;
}
@ -900,7 +884,6 @@ class SkinTemplate extends Skin {
);
}
wfProfileIn( __METHOD__ . '-edit' );
// Checks if user can edit the current page if it exists or create it otherwise
if ( $title->quickUserCan( 'edit', $user )
@ -958,9 +941,7 @@ class SkinTemplate extends Skin {
'primary' => true, // don't collapse this in vector
);
}
wfProfileOut( __METHOD__ . '-edit' );
wfProfileIn( __METHOD__ . '-live' );
// Checks if the page exists
if ( $title->exists() ) {
// Adds history view link
@ -1021,7 +1002,6 @@ class SkinTemplate extends Skin {
);
}
wfProfileOut( __METHOD__ . '-live' );
// Checks if the user is logged in
if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {

View file

@ -250,7 +250,6 @@ class AllMessagesTablePager extends TablePager {
*/
public static function getCustomisedStatuses( $messageNames, $langcode = 'en', $foreign = false ) {
// FIXME: This function should be moved to Language:: or something.
wfProfileIn( __METHOD__ . '-db' );
$dbr = wfGetDB( DB_SLAVE );
$res = $dbr->select( 'page',
@ -286,7 +285,6 @@ class AllMessagesTablePager extends TablePager {
}
}
wfProfileOut( __METHOD__ . '-db' );
return array( 'pages' => $pageFlags, 'talks' => $talkFlags );
}

View file

@ -313,7 +313,6 @@ class MWCryptRand {
// entropy so this is also preferable to just trying to read urandom because it may work
// on Windows systems as well.
if ( function_exists( 'mcrypt_create_iv' ) ) {
wfProfileIn( __METHOD__ . '-mcrypt' );
$rem = $bytes - strlen( $buffer );
$iv = mcrypt_create_iv( $rem, MCRYPT_DEV_URANDOM );
if ( $iv === false ) {
@ -323,7 +322,6 @@ class MWCryptRand {
wfDebug( __METHOD__ . ": mcrypt_create_iv generated " . strlen( $iv ) .
" bytes of randomness.\n" );
}
wfProfileOut( __METHOD__ . '-mcrypt' );
}
}
@ -336,7 +334,6 @@ class MWCryptRand {
if ( function_exists( 'openssl_random_pseudo_bytes' )
&& ( !wfIsWindows() || version_compare( PHP_VERSION, '5.3.4', '>=' ) )
) {
wfProfileIn( __METHOD__ . '-openssl' );
$rem = $bytes - strlen( $buffer );
$openssl_bytes = openssl_random_pseudo_bytes( $rem, $openssl_strong );
if ( $openssl_bytes === false ) {
@ -352,7 +349,6 @@ class MWCryptRand {
// using it use it's say on whether the randomness is strong
$this->strong = !!$openssl_strong;
}
wfProfileOut( __METHOD__ . '-openssl' );
}
}
@ -360,7 +356,6 @@ class MWCryptRand {
if ( strlen( $buffer ) < $bytes &&
( function_exists( 'stream_set_read_buffer' ) || $forceStrong )
) {
wfProfileIn( __METHOD__ . '-fopen-urandom' );
$rem = $bytes - strlen( $buffer );
if ( !function_exists( 'stream_set_read_buffer' ) && $forceStrong ) {
wfDebug( __METHOD__ . ": Was forced to read from /dev/urandom " .
@ -399,7 +394,6 @@ class MWCryptRand {
} else {
wfDebug( __METHOD__ . ": /dev/urandom could not be opened.\n" );
}
wfProfileOut( __METHOD__ . '-fopen-urandom' );
}
// If we cannot use or generate enough data from a secure source
@ -413,12 +407,10 @@ class MWCryptRand {
": Falling back to using a pseudo random state to generate randomness.\n" );
}
while ( strlen( $buffer ) < $bytes ) {
wfProfileIn( __METHOD__ . '-fallback' );
$buffer .= $this->hmac( $this->randomState(), mt_rand() );
// This code is never really cryptographically strong, if we use it
// at all, then set strong to false.
$this->strong = false;
wfProfileOut( __METHOD__ . '-fallback' );
}
// Once the buffer has been filled up with enough random data to fulfill

View file

@ -498,16 +498,12 @@ class ReplacementArray {
*/
function replace( $subject ) {
if ( function_exists( 'fss_prep_replace' ) ) {
wfProfileIn( __METHOD__ . '-fss' );
if ( $this->fss === false ) {
$this->fss = fss_prep_replace( $this->data );
}
$result = fss_exec_replace( $this->fss, $subject );
wfProfileOut( __METHOD__ . '-fss' );
} else {
wfProfileIn( __METHOD__ . '-strtr' );
$result = strtr( $subject, $this->data );
wfProfileOut( __METHOD__ . '-strtr' );
}
return $result;

View file

@ -31,7 +31,6 @@ if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3
require __DIR__ . '/includes/WebStart.php';
wfProfileIn( 'load.php' );
// URL safety checks
if ( !$wgRequest->checkUrlExtension() ) {
@ -44,7 +43,6 @@ $configFactory = ConfigFactory::getDefaultInstance();
$resourceLoader = new ResourceLoader( $configFactory->makeConfig( 'main' ) );
$resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) );
wfProfileOut( 'load.php' );
wfLogProfilingData();
// Shut down the database.