$this->mimeCallback = isset( $config['mimeCallback'] )
? $config['mimeCallback']
: function ( $storagePath, $content, $fsPath ) {
- // @TODO: handle the case of extension-less files using the contents
+ // @todo handle the case of extension-less files using the contents
return StreamFile::contentTypeFromPath( $storagePath ) ?: 'unknown/unknown';
};
$this->memCache = new EmptyBagOStuff(); // disabled by default
$this->clearCache();
$supportedOps = array( 'create', 'store', 'copy', 'move', 'delete', 'describe', 'null' );
+ // Parallel ops may be disabled in config due to dependencies (e.g. needing popen())
$async = ( $this->parallelize === 'implicit' && count( $ops ) > 1 );
$maxConcurrency = $this->concurrency; // throttle
if ( !$this->memCache->add( $key, $val, $ttl ) && !empty( $val['latest'] ) ) {
$this->memCache->merge(
$key,
- function( BagOStuff $cache, $key, $cValue ) use ( $val ) {
+ function ( BagOStuff $cache, $key, $cValue ) use ( $val ) {
return ( is_array( $cValue ) && empty( $cValue['latest'] ) )
? $val // update the stat cache with the lastest info
: false; // do nothing (cache is salted or some error happened)