/** @var bool Whether all zones should be private (e.g. private wiki repo) */
protected $isPrivate;
- /**
- * Factory functions for creating new files
- * Override these in the base class
- */
+ /** @var array callable Override these in the base class */
protected $fileFactory = array( 'UnregisteredLocalFile', 'newFromTitle' );
+ /** @var array callable|bool Override these in the base class */
protected $oldFileFactory = false;
+ /** @var array callable|bool Override these in the base class */
protected $fileFactoryKey = false;
+ /** @var array callable|bool Override these in the base class */
protected $oldFileFactoryKey = false;
/**
return array();
}
- /**
- * Get the public root URL of the repository
- *
- * @deprecated since 1.20
- * @return string
- */
- public function getRootUrl() {
- return $this->getZoneUrl( 'public' );
- }
-
/**
* Get the URL of thumb.php
*
$headers = array( 'Content-Disposition' => $triple[2] );
} elseif ( is_array( $triple[2] ) && isset( $triple[2]['headers'] ) ) {
$headers = $triple[2]['headers'];
+ } else {
+ $headers = array();
}
- // @fixme: $headers might not be defined
+
$operations[] = array(
'op' => FileBackend::isStoragePath( $src ) ? 'copy' : 'store',
'src' => $src,
*
* @param string $virtualUrl
* @param array $headers Additional HTTP headers to send on success
- * @return bool Success
+ * @return Status
+ * @since 1.27
*/
- public function streamFile( $virtualUrl, $headers = array() ) {
+ public function streamFileWithStatus( $virtualUrl, $headers = array() ) {
$path = $this->resolveToStoragePath( $virtualUrl );
$params = array( 'src' => $path, 'headers' => $headers );
- return $this->backend->streamFile( $params )->isOK();
+ return $this->backend->streamFile( $params );
+ }
+
+ /**
+ * Attempt to stream a file with the given virtual URL/storage path
+ *
+ * @deprecated since 1.26, use streamFileWithStatus
+ * @param string $virtualUrl
+ * @param array $headers Additional HTTP headers to send on success
+ * @return bool Success
+ */
+ public function streamFile( $virtualUrl, $headers = array() ) {
+ return $this->streamFileWithStatus( $virtualUrl, $headers )->isOK();
}
/**