} elseif ( $blocksList['auto'] ) {
$chosenBlock = $blocksList['auto'];
} else {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Proxy block found, but couldn't be classified." );
}
$this->section = $request->getVal( 'wpSection', $request->getVal( 'section' ) );
if ( $this->section !== null && $this->section !== '' && !$this->isSectionEditSupported() ) {
+ wfProfileOut( __METHOD__ );
throw new ErrorPageError( 'sectioneditnotsupported-title', 'sectioneditnotsupported-text' );
}
}
// Inform caller about problem
+ wfProfileOut( __METHOD__ );
throw $e;
}
# For page dumps...
*/
if ( is_array( $hook ) ) {
if ( count( $hook ) < 1 ) {
+ wfProfileOut( 'hook: ' . $event );
throw new MWException( 'Empty array in hooks for ' . $event . "\n" );
} elseif ( is_object( $hook[0] ) ) {
$object = $hook[0];
$have_data = true;
}
} else {
+ wfProfileOut( 'hook: ' . $event );
throw new MWException( 'Unknown datatype in hooks for ' . $event . "\n" );
}
} elseif ( is_string( $hook ) ) { # functions look like strings, too
$method = "on" . $event;
}
} else {
+ wfProfileOut( 'hook: ' . $event );
throw new MWException( 'Unknown datatype in hooks for ' . $event . "\n" );
}
$prettyFunc = strval( $callback );
}
if ( $badhookmsg ) {
+ wfProfileOut( 'hook: ' . $event );
throw new MWException(
'Detected bug in an extension! ' .
"Hook $prettyFunc has invalid call signature; " . $badhookmsg
);
} else {
+ wfProfileOut( 'hook: ' . $event );
throw new MWException(
'Detected bug in an extension! ' .
"Hook $prettyFunc failed to return a value; " .
$wgContLang->getMagic( $this );
if ( !$this->mSynonyms ) {
$this->mSynonyms = array( 'dkjsagfjsgashfajsh' );
+ wfProfileOut( __METHOD__ );
throw new MWException( "Error: invalid magic word '$id'" );
#wfDebugLog( 'exception', "Error: invalid magic word '$id'\n" );
}
// Store and get the URL
$data = ExternalStore::insertToDefault( $data );
if( !$data ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Unable to store text to external storage" );
}
if( $flags ) {
$title = $this->getTitle();
if ( $title === null ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Insufficient information to determine the title of the revision's page!" );
}
wfProfileIn( __METHOD__ );
if ( FileBackend::isStoragePath( $fname ) ) { // sanity
+ wfProfileOut( __METHOD__ );
throw new MWException( __FUNCTION__ . " given storage path '$fname'." );
}
wfProfileIn( $fname );
$caller = wfGetCaller( $level );
if ( ++$recursionLevel > 2 ) {
+ wfProfileOut( $fname );
throw new MWException( "Unstub loop detected on call of \${$this->mGlobal}->$name from $caller\n" );
}
wfDebug( "Unstubbing \${$this->mGlobal} on call of \${$this->mGlobal}::$name from $caller\n" );
wfRunHooks( 'UpdateUserMailerFormattedPageStatus', array( &$formattedPageStatus ) );
if ( !in_array( $this->pageStatus, $formattedPageStatus ) ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( 'Not a valid page status!' );
}
$newContent = $sectionContent;
} else {
if ( !$this->supportsSections() ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "sections not supported for content model " . $this->getContentHandler()->getModelID() );
}
if ( $changed ) {
if ( !$content->isValid() ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "New content failed validity check!" );
}
wfProfileIn( __METHOD__ );
if ( !$code ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Invalid language code requested" );
}
$this->recachedLangs[$code] = true;
wfRunHooks( 'LocalisationCacheRecache', array( $this, $code, &$allData ) );
if ( is_null( $allData['namespaceNames'] ) ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . ': Localisation data failed sanity check! ' .
'Check that your languages/messages/MessagesEn.php file is intact.' );
}
// effects like gadgets and sidebar getting cached with their
// default content
if ( $exception instanceof Exception ) {
+ wfProfileOut( __METHOD__ );
throw $exception;
} else {
+ wfProfileOut( __METHOD__ );
throw new MWException( "MessageCache failed to load messages" );
}
} else {
$urlArr = array_unique( $urlArr ); // Remove duplicates
foreach ( $urlArr as $url ) {
if( !is_string( $url ) ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( 'Bad purge URL' );
}
$url = SquidUpdate::expand( $url );
continue;
}
if ( !isset( $conf['host'] ) || !isset( $conf['port'] ) ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Invalid HTCP rule for URL $url\n" );
}
$sectionModelId = $with->getModel();
if ( $sectionModelId != $myModelId ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Incompatible content model for section: " .
"document uses $myModelId but " .
"section uses $sectionModelId." );
}
if ( istainted( $sql ) & TC_MYSQL ) {
+ if ( !Profiler::instance()->isStub() ) {
+ wfProfileOut( $queryProf );
+ wfProfileOut( $totalProf );
+ }
throw new MWException( 'Tainted query found' );
}
# Fail now
# Otherwise we get a suppressed fatal error, which is very hard to track down
if ( !function_exists( 'mysql_connect' ) ) {
+ wfProfileOut( __METHOD__ );
throw new DBConnectionError( $this, "MySQL functions missing, have you compiled PHP with the --with-mysql option?\n" );
}
}
if ( !$nonErrorLoads ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Empty server array given to LoadBalancer" );
}
wfProfileIn( __METHOD__ );
if ( $i == DB_LAST ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( 'Attempt to call ' . __METHOD__ . ' with deprecated server index DB_LAST' );
} elseif ( $i === null || $i === false ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( 'Attempt to call ' . __METHOD__ . ' with invalid server index' );
}
wfProfileIn( __METHOD__ . '-' . $this->name );
foreach ( $fileOpHandles as $fileOpHandle ) {
if ( !( $fileOpHandle instanceof FileBackendStoreOpHandle ) ) {
+ wfProfileOut( __METHOD__ . '-' . $this->name );
+ wfProfileOut( __METHOD__ );
throw new MWException( "Given a non-FileBackendStoreOpHandle object." );
} elseif ( $fileOpHandle->backend->getName() !== $this->getName() ) {
+ wfProfileOut( __METHOD__ . '-' . $this->name );
+ wfProfileOut( __METHOD__ );
throw new MWException( "Given a FileBackendStoreOpHandle for the wrong backend." );
}
}
$this->$name = $value;
}
} else {
+ wfProfileOut( $fname );
throw new MWException( "Could not find data for image '{$this->getName()}'." );
}
$this->$name = $value;
}
} else {
+ wfProfileOut( __METHOD__ );
throw new MWException( "Could not find data for image '{$this->archive_name}'." );
}
$bits = preg_split( $this->mExtLinkBracketedRegex, $text, -1, PREG_SPLIT_DELIM_CAPTURE );
if ( $bits === false ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "PCRE needs to be compiled with --enable-unicode-properties in order for MediaWiki to function" );
}
$s = array_shift( $bits );
}
break;
default:
+ wfProfileOut( __METHOD__ );
throw new MWException( "State machine error in " . __METHOD__ );
}
}
$result = $this->callParserFunction( $frame, $func, $funcArgs );
} catch ( Exception $ex ) {
wfProfileOut( __METHOD__ . '-pfunc' );
+ wfProfileOut( __METHOD__ );
throw $ex;
}
$this->parser->mGeneratedPPNodeCount += substr_count( $xml, '<' );
$max = $this->parser->mOptions->getMaxGeneratedPPNodeCount();
if ( $this->parser->mGeneratedPPNodeCount > $max ) {
+ if ( $cacheable ) {
+ wfProfileOut( __METHOD__ . '-cacheable' );
+ }
+ wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . ': generated node count limit exceeded' );
}
// 1 << 19 == XML_PARSE_HUGE, needed so newer versions of libxml2 don't barf when the XML is >256 levels deep
$result = $dom->loadXML( $xml, 1 << 19 );
if ( !$result ) {
+ wfProfileOut( __METHOD__ . '-loadXML' );
+ if ( $cacheable ) {
+ wfProfileOut( __METHOD__ . '-cacheable' );
+ }
+ wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . ' generated invalid XML' );
}
}
$lastNode = $node;
}
if ( !$node ) {
+ if ( $cacheable ) {
+ wfProfileOut( __METHOD__ . '-cache-miss' );
+ wfProfileOut( __METHOD__ . '-cacheable' );
+ }
+ wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . ': eqpos not found' );
}
if ( $node->name !== 'equals' ) {
+ if ( $cacheable ) {
+ wfProfileOut( __METHOD__ . '-cache-miss' );
+ wfProfileOut( __METHOD__ . '-cacheable' );
+ }
+ wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . ': eqpos is not equals' );
}
$equalsNode = $node;
foreach ( $registrations as $name => $info ) {
// Disallow duplicate registrations
if ( isset( $this->moduleInfos[$name] ) ) {
+ wfProfileOut( __METHOD__ );
// A module has already been registered by this name
throw new MWException(
'ResourceLoader duplicate registration error. ' .
// Check $name for validity
if ( !self::isValidModuleName( $name ) ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( "ResourceLoader module name '$name' is invalid, see ResourceLoader::isValidModuleName()" );
}
// Old calling convention
// Validate the input
if ( !( $info instanceof ResourceLoaderModule ) ) {
+ wfProfileOut( __METHOD__ );
throw new MWException( 'ResourceLoader invalid module error. ' .
'Instances of ResourceLoaderModule expected.' );
}