* @param $code
* @param $key
* @param $subkey
- * @return
*/
protected function loadSubitem( $code, $key, $subkey ) {
if ( !in_array( $key, self::$splitKeys ) ) {
/**
* Returns true if the cache identified by $code is missing or expired.
+ *
+ * @param string $code
+ *
* @return bool
*/
public function isExpired( $code ) {
* @return array
*/
protected function readPHPFile( $_fileName, $_fileType ) {
+ wfProfileIn( __METHOD__ );
// Disable APC caching
$_apcEnabled = ini_set( 'apc.cache_by_default', '0' );
include( $_fileName );
} elseif ( $_fileType == 'aliases' ) {
$data = compact( 'aliases' );
} else {
+ wfProfileOut( __METHOD__ );
throw new MWException( __METHOD__ . ": Invalid file type: $_fileType" );
}
+ wfProfileOut( __METHOD__ );
return $data;
}
protected function readSourceFilesAndRegisterDeps( $code, &$deps ) {
global $IP;
+ wfProfileIn( __METHOD__ );
$fileName = Language::getMessagesFileName( $code );
if ( !file_exists( $fileName ) ) {
return false;
$deps['plurals'] = new FileDependency( "$IP/languages/data/plurals.xml" );
$deps['plurals-mw'] = new FileDependency( "$IP/languages/data/plurals-mediawiki.xml" );
+ wfProfileOut( __METHOD__ );
return $data;
}
# This is done after the core because we know the fallback sequence now.
# But it has a higher precedence for merging so that we can support things
# like site-specific message overrides.
+ wfProfileIn( __METHOD__ . '-extensions' );
$allData = $initialData;
foreach ( $wgExtensionMessagesFiles as $fileName ) {
$data = $this->readPHPFile( $fileName, 'extension' );
foreach ( $coreData as $key => $item ) {
$this->mergeItem( $key, $allData[$key], $item );
}
+ wfProfileOut( __METHOD__ . '-extensions' );
# Add cache dependencies for any referenced globals
$deps['wgExtensionMessagesFiles'] = new GlobalDependency( 'wgExtensionMessagesFiles' );
}
# Save to the persistent cache
+ wfProfileIn( __METHOD__ . '-write' );
$this->store->startWrite( $code );
foreach ( $allData as $key => $value ) {
if ( in_array( $key, self::$splitKeys ) ) {
}
}
$this->store->finishWrite();
+ wfProfileOut( __METHOD__ . '-write' );
# Clear out the MessageBlobStore
# HACK: If using a null (i.e. disabled) storage backend, we
/**
* Start a write transaction.
- * @param $code Language code
+ * @param string $code Language code
*/
function startWrite( $code );
/**
* Set a key to a given value. startWrite() must be called before this
* is called, and finishWrite() must be called afterwards.
- * @param $key
- * @param $value
+ * @param string $key
+ * @param mixed $value
*/
function set( $key, $value );
}