* @ingroup FileBackend
* @author Aaron Schulz
*/
+use Wikimedia\Timestamp\ConvertibleTimestamp;
/**
* @brief Base class for all backends using particular storage medium.
$status->merge( $this->doConcatenate( $params ) );
$sec = microtime( true ) - $start_time;
if ( !$status->isOK() ) {
- $this->logger->error( get_class( $this ) . "-{$this->name}" .
+ $this->logger->error( static::class . "-{$this->name}" .
" failed to concatenate " . count( $params['srcs'] ) . " file(s) [$sec sec]" );
}
}
/**
* @see FileBackendStore::getFileXAttributes()
* @param array $params
- * @return bool|string
+ * @return array[][]
*/
protected function doGetFileXAttributes( array $params ) {
return [ 'headers' => [], 'metadata' => [] ]; // not supported
// Build the list of paths involved
$paths = [];
- foreach ( $performOps as $op ) {
- $paths = array_merge( $paths, $op->storagePathsRead() );
- $paths = array_merge( $paths, $op->storagePathsChanged() );
+ foreach ( $performOps as $performOp ) {
+ $paths = array_merge( $paths, $performOp->storagePathsRead() );
+ $paths = array_merge( $paths, $performOp->storagePathsChanged() );
}
// Enlarge the cache to fit the stat entries of these files
$subStatus->success[$i] = false;
++$subStatus->failCount;
}
- $this->logger->error( get_class( $this ) . "-{$this->name} " .
+ $this->logger->error( static::class . "-{$this->name} " .
" stat failure; aborted operations: " . FormatJson::encode( $ops ) );
}
* to the order in which the handles where given.
*
* @param FileBackendStoreOpHandle[] $fileOpHandles
- *
- * @throws FileBackendError
* @return StatusValue[] Map of StatusValue objects
+ * @throws FileBackendError
*/
final public function executeOpHandlesInternal( array $fileOpHandles ) {
$ps = $this->scopedProfileSection( __METHOD__ . "-{$this->name}" );
foreach ( $fileOpHandles as $fileOpHandle ) {
if ( !( $fileOpHandle instanceof FileBackendStoreOpHandle ) ) {
- throw new InvalidArgumentException( "Got a non-FileBackendStoreOpHandle object." );
+ throw new InvalidArgumentException( "Expected FileBackendStoreOpHandle object." );
} elseif ( $fileOpHandle->backend->getName() !== $this->getName() ) {
- throw new InvalidArgumentException(
- "Got a FileBackendStoreOpHandle for the wrong backend." );
+ throw new InvalidArgumentException( "Expected handle for this file backend." );
}
}
+
$res = $this->doExecuteOpHandlesInternal( $fileOpHandles );
foreach ( $fileOpHandles as $fileOpHandle ) {
$fileOpHandle->closeResources();