Standardize @todo
[lhc/web/wiklou.git] / includes / filebackend / FileBackendStore.php
index ce4dedd..631d949 100644 (file)
@@ -69,7 +69,7 @@ abstract class FileBackendStore extends FileBackend {
                $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
@@ -357,8 +357,8 @@ abstract class FileBackendStore extends FileBackend {
                        $status->merge( $this->doConcatenate( $params ) );
                        $sec = microtime( true ) - $start_time;
                        if ( !$status->isOK() ) {
-                               wfDebugLog( 'FileOperation', get_class( $this ) . " failed to concatenate " .
-                                       count( $params['srcs'] ) . " file(s) [$sec sec]" );
+                               wfDebugLog( 'FileOperation', get_class( $this ) . "-{$this->name}" .
+                                       " failed to concatenate " . count( $params['srcs'] ) . " file(s) [$sec sec]" );
                        }
                }
 
@@ -1122,6 +1122,8 @@ abstract class FileBackendStore extends FileBackend {
                                $subStatus->success[$i] = false;
                                ++$subStatus->failCount;
                        }
+                       wfDebugLog( 'FileOperation', get_class( $this ) . "-{$this->name} " .
+                               " stat failure; aborted operations: " . FormatJson::encode( $ops ) );
                }
 
                // Merge errors into status fields
@@ -1145,6 +1147,7 @@ abstract class FileBackendStore extends FileBackend {
                $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
 
@@ -1693,7 +1696,7 @@ abstract class FileBackendStore extends FileBackend {
                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)