Before:
- Setup.php
- - Setup.php-defaults
- - Setup.php-validation
- - Setup.php-defaults2
- - Setup.php-misc1
- - Setup.php-memcached
- - Setup.php-globals
- - - Setup.php-session
- - Setup.php-extensions
- - - Setup.php-extensions-{extensionName}
- - - Setup.php-autocreate
After:
- Setup.php
- - Setup.php-defaults
- - Setup.php-defaults2
- - Setup.php-misc
- - Setup.php-globals
- - Setup.php-extensions
The removed sections are mainly things were essentially sections
consisting of one invocation, which profilers already track
natively.
Bug: T189966
Change-Id: I1ed648cdcca9e5a9ea7013394381eacd67f327a3
require_once "$IP/includes/compat/normal/UtfNormalUtil.php";
require_once "$IP/includes/compat/normal/UtfNormalUtil.php";
-$ps_validation = Profiler::instance()->scopedProfileIn( $fname . '-validation' );
-
// T48998: Bail out early if $wgArticlePath is non-absolute
foreach ( [ 'wgArticlePath', 'wgVariantArticlePath' ] as $varName ) {
if ( $$varName && !preg_match( '/^(https?:\/\/|\/)/', $$varName ) ) {
// T48998: Bail out early if $wgArticlePath is non-absolute
foreach ( [ 'wgArticlePath', 'wgVariantArticlePath' ] as $varName ) {
if ( $$varName && !preg_match( '/^(https?:\/\/|\/)/', $$varName ) ) {
-Profiler::instance()->scopedProfileOut( $ps_validation );
-
$ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' );
if ( $wgCanonicalServer === false ) {
$ps_default2 = Profiler::instance()->scopedProfileIn( $fname . '-defaults2' );
if ( $wgCanonicalServer === false ) {
Profiler::instance()->scopedProfileOut( $ps_default2 );
Profiler::instance()->scopedProfileOut( $ps_default2 );
-$ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc1' );
+$ps_misc = Profiler::instance()->scopedProfileIn( $fname . '-misc' );
// Raise the memory limit if it's too low
wfMemoryLimit();
// Raise the memory limit if it's too low
wfMemoryLimit();
-Profiler::instance()->scopedProfileOut( $ps_misc );
-$ps_memcached = Profiler::instance()->scopedProfileIn( $fname . '-memcached' );
-
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
$wgMemc = wfGetMainCache();
$messageMemc = wfGetMessageCacheStorage();
', session: ' . get_class( ObjectCache::getInstance( $wgSessionCacheType ) )
);
', session: ' . get_class( ObjectCache::getInstance( $wgSessionCacheType ) )
);
-Profiler::instance()->scopedProfileOut( $ps_memcached );
+Profiler::instance()->scopedProfileOut( $ps_misc );
// Most of the config is out, some might want to run hooks here.
Hooks::run( 'SetupAfterCache' );
// Most of the config is out, some might want to run hooks here.
Hooks::run( 'SetupAfterCache' );
], '$wgAuth is ' . get_class( $wgAuth ) );
}
], '$wgAuth is ' . get_class( $wgAuth ) );
}
-// Set up the session
-$ps_session = Profiler::instance()->scopedProfileIn( $fname . '-session' );
/**
* @var MediaWiki\Session\SessionId|null $wgInitialSessionId The persistent
* session ID (if any) loaded at startup
/**
* @var MediaWiki\Session\SessionId|null $wgInitialSessionId The persistent
* session ID (if any) loaded at startup
-Profiler::instance()->scopedProfileOut( $ps_session );
// of the extension file. This allows the extension to perform
// any necessary initialisation in the fully initialised environment
foreach ( $wgExtensionFunctions as $func ) {
// of the extension file. This allows the extension to perform
// any necessary initialisation in the fully initialised environment
foreach ( $wgExtensionFunctions as $func ) {
- // Allow closures in PHP 5.3+
- if ( is_object( $func ) && $func instanceof Closure ) {
- $profName = $fname . '-extensions-closure';
- } elseif ( is_array( $func ) ) {
- if ( is_object( $func[0] ) ) {
- $profName = $fname . '-extensions-' . get_class( $func[0] ) . '::' . $func[1];
- } else {
- $profName = $fname . '-extensions-' . implode( '::', $func );
- }
- } else {
- $profName = $fname . '-extensions-' . strval( $func );
- }
-
- $ps_ext_func = Profiler::instance()->scopedProfileIn( $profName );
- Profiler::instance()->scopedProfileOut( $ps_ext_func );
}
// If the session user has a 0 id but a valid name, that means we need to
}
// If the session user has a 0 id but a valid name, that means we need to
if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
$sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
if ( !defined( 'MW_NO_SESSION' ) && !$wgCommandLineMode ) {
$sessionUser = MediaWiki\Session\SessionManager::getGlobalSession()->getUser();
if ( $sessionUser->getId() === 0 && User::isValidUserName( $sessionUser->getName() ) ) {
- $ps_autocreate = Profiler::instance()->scopedProfileIn( $fname . '-autocreate' );
$res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
$sessionUser,
MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
true
);
$res = MediaWiki\Auth\AuthManager::singleton()->autoCreateUser(
$sessionUser,
MediaWiki\Auth\AuthManager::AUTOCREATE_SOURCE_SESSION,
true
);
- Profiler::instance()->scopedProfileOut( $ps_autocreate );
\MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
'event' => 'autocreate',
'status' => $res,
\MediaWiki\Logger\LoggerFactory::getInstance( 'authevents' )->info( 'Autocreation attempt', [
'event' => 'autocreate',
'status' => $res,