* (c) sends Content-Length header based on HTTP_IF_MODIFIED_SINCE check
*
* @param $path string Storage path or file system path
- * @param $info Array File stat info with 'mtime' and 'size' fields
+ * @param $info Array|false File stat info with 'mtime' and 'size' fields
* @param $headers Array Additional headers to send
* @param $sendErrors bool Send error messages if errors occur (like 404)
* @return int|false READY_STREAM, NOT_MODIFIED, or false on failure
*/
public static function prepareForStream(
- $path, array $info, $headers = array(), $sendErrors = true
+ $path, $info, $headers = array(), $sendErrors = true
) {
global $wgLanguageCode;
- if ( !$info ) {
+ if ( !is_array( $info ) ) {
if ( $sendErrors ) {
header( 'HTTP/1.0 404 Not Found' );
header( 'Cache-Control: no-cache' );
/**
* Get the unique backend name.
- *
* We may have multiple different backends of the same type.
* For example, we can have two Swift backends using different proxies.
*
abstract public function concatenate( array $params );
/**
- * Prepare a storage path for usage. This will create containers
- * that don't yet exist or, on FS backends, create parent directories.
+ * Prepare a storage directory for usage.
+ * This will create any required containers and parent directories.
+ * Backends using key/value stores only need to create the container.
*
* $params include:
* dir : storage directory
/**
* Take measures to block web access to a storage directory and
* the container it belongs to. FS backends might add .htaccess
- * files whereas backends like Swift this might restrict container
- * access to backend user that represents end-users in web request.
+ * files whereas key/value store backends might restrict container
+ * access to the auth user that represents end-users in web request.
* This is not guaranteed to actually do anything.
*
* $params include:
abstract protected function doSecure( array $params );
/**
- * Clean up an empty storage directory.
- * On FS backends, the directory will be deleted. Others may do nothing.
+ * Delete a storage directory if it is empty.
+ * Backends using key/value stores may do nothing unless the directory
+ * is that of an empty container, in which case it should be deleted.
*
* $params include:
* dir : storage directory
/**
* Create a file in the backend with the given content.
- * Parameters similar to FileBackend::create(), which include:
+ * Parameters similar to FileBackend::createInternal(), which include:
* content : a string of raw file contents
* dst : destination storage path
* overwriteDest : do nothing and pass if an identical file exists at destination
/**
* Copy a file from one storage path to another in the backend.
- * Parameters similar to FileBackend::copy(), which include:
+ * Parameters similar to FileBackend::copyInternal(), which include:
* src : source storage path
* dst : destination storage path
* overwriteDest : do nothing and pass if an identical file exists at destination
/**
* Move a file from one storage path to another in the backend.
- * Parameters similar to FileBackend::move(), which include:
+ * Parameters similar to FileBackend::moveInternal(), which include:
* src : source storage path
* dst : destination storage path
* overwriteDest : do nothing and pass if an identical file exists at destination
/**
* Delete a file at the storage path.
- * Parameters similar to FileBackend::delete(), which include:
+ * Parameters similar to FileBackend::deleteInternal(), which include:
* src : source storage path
* ignoreMissingSource : don't return an error if the file does not exist
*/