* @param array $items An array of titles, or an array of findFile() options with
* the "title" option giving the title. Example:
*
- * $findItem = array( 'title' => $title, 'private' => true );
- * $findBatch = array( $findItem );
+ * $findItem = [ 'title' => $title, 'private' => true ];
+ * $findBatch = [ $findItem ];
* $repo->findFiles( $findBatch );
*
* No title should appear in $items twice, as the result use titles as keys
$status = $this->storeBatch( [ [ $srcPath, $dstZone, $dstRel ] ], $flags );
if ( $status->successCount == 0 ) {
- $status->ok = false;
+ $status->setOK( false );
}
return $status;
$status = $this->publishBatch(
[ [ $src, $dstRel, $archiveRel, $options ] ], $flags );
if ( $status->successCount == 0 ) {
- $status->ok = false;
+ $status->setOK( false );
}
if ( isset( $status->value[0] ) ) {
$status->value = $status->value[0];
* @return array
*/
public function getFileProps( $virtualUrl ) {
- $path = $this->resolveToStoragePath( $virtualUrl );
+ $fsFile = $this->getLocalReference( $virtualUrl );
+ $mwProps = new MWFileProps( MimeMagic::singleton() );
+ if ( $fsFile ) {
+ $props = $mwProps->getPropsFromPath( $fsFile->getPath(), true );
+ } else {
+ $props = $mwProps->newPlaceholderProps();
+ }
- return $this->backend->getFileProps( [ 'src' => $path ] );
+ return $props;
}
/**