*
* @var array
*/
- private $loaded = array();
+ private $loaded = [];
/**
* List of paths that should be loaded
*
* @var array
*/
- protected $queued = array();
+ protected $queued = [];
/**
* Items in the JSON file that aren't being
*
* @var array
*/
- protected $attributes = array();
+ protected $attributes = [];
/**
* @var ExtensionRegistry
}
// A few more things to vary the cache on
- $versions = array(
+ $versions = [
'registration' => self::CACHE_VERSION,
'mediawiki' => $wgVersion
- );
+ ];
// See if this queue is in APC
$key = wfMemcKey(
unset( $data['autoload'] );
$this->cache->set( $key, $data, 60 * 60 * 24 );
}
- $this->queued = array();
+ $this->queued = [];
}
/**
* outside of the installer.
*/
public function clearQueue() {
- $this->queued = array();
+ $this->queued = [];
}
/**
*/
public function readFromQueue( array $queue ) {
global $wgVersion;
- $autoloadClasses = array();
- $autoloaderPaths = array();
+ $autoloadClasses = [];
+ $autoloaderPaths = [];
$processor = new ExtensionProcessor();
- $incompatible = array();
+ $incompatible = [];
$coreVersionParser = new CoreVersionChecker( $wgVersion );
foreach ( $queue as $path => $mtime ) {
$json = file_get_contents( $path );
}
$data = $processor->getExtractedInfo();
// Need to set this so we can += to it later
- $data['globals']['wgAutoloadClasses'] = array();
+ $data['globals']['wgAutoloadClasses'] = [];
$data['autoload'] = $autoloadClasses;
$data['autoloaderPaths'] = $autoloaderPaths;
return $data;
foreach ( $info['globals'] as $key => $val ) {
// If a merge strategy is set, read it and remove it from the value
// so it doesn't accidentally end up getting set.
- // Need to check $val is an array for PHP 5.3 which will return
- // true on isset( 'string'['foo'] ).
- if ( isset( $val[self::MERGE_STRATEGY] ) && is_array( $val ) ) {
+ if ( is_array( $val ) && isset( $val[self::MERGE_STRATEGY] ) ) {
$mergeStrategy = $val[self::MERGE_STRATEGY];
unset( $val[self::MERGE_STRATEGY] );
} else {
if ( isset( $this->attributes[$name] ) ) {
return $this->attributes[$name];
} else {
- return array();
+ return [];
}
}
return "$dir/$file";
}, $info['AutoloadClasses'] );
} else {
- return array();
+ return [];
}
}
}