Index: trunk/phase3/includes/filerepo/backend/FileOp.php |
— | — | @@ -382,7 +382,7 @@ |
383 | 383 | |
384 | 384 | /** |
385 | 385 | * Create a file in the backend with the given content. |
386 | | - * Parameters similar to FileBackend::create(), which include: |
| 386 | + * Parameters similar to FileBackend::createInternal(), which include: |
387 | 387 | * content : a string of raw file contents |
388 | 388 | * dst : destination storage path |
389 | 389 | * overwriteDest : do nothing and pass if an identical file exists at destination |
— | — | @@ -426,7 +426,7 @@ |
427 | 427 | |
428 | 428 | /** |
429 | 429 | * Copy a file from one storage path to another in the backend. |
430 | | - * Parameters similar to FileBackend::copy(), which include: |
| 430 | + * Parameters similar to FileBackend::copyInternal(), which include: |
431 | 431 | * src : source storage path |
432 | 432 | * dst : destination storage path |
433 | 433 | * overwriteDest : do nothing and pass if an identical file exists at destination |
— | — | @@ -478,7 +478,7 @@ |
479 | 479 | |
480 | 480 | /** |
481 | 481 | * Move a file from one storage path to another in the backend. |
482 | | - * Parameters similar to FileBackend::move(), which include: |
| 482 | + * Parameters similar to FileBackend::moveInternal(), which include: |
483 | 483 | * src : source storage path |
484 | 484 | * dst : destination storage path |
485 | 485 | * overwriteDest : do nothing and pass if an identical file exists at destination |
— | — | @@ -539,7 +539,7 @@ |
540 | 540 | |
541 | 541 | /** |
542 | 542 | * Delete a file at the storage path. |
543 | | - * Parameters similar to FileBackend::delete(), which include: |
| 543 | + * Parameters similar to FileBackend::deleteInternal(), which include: |
544 | 544 | * src : source storage path |
545 | 545 | * ignoreMissingSource : don't return an error if the file does not exist |
546 | 546 | */ |
Index: trunk/phase3/includes/filerepo/backend/FileBackend.php |
— | — | @@ -75,7 +75,6 @@ |
76 | 76 | |
77 | 77 | /** |
78 | 78 | * Get the unique backend name. |
79 | | - * |
80 | 79 | * We may have multiple different backends of the same type. |
81 | 80 | * For example, we can have two Swift backends using different proxies. |
82 | 81 | * |
— | — | @@ -288,8 +287,9 @@ |
289 | 288 | abstract public function concatenate( array $params ); |
290 | 289 | |
291 | 290 | /** |
292 | | - * Prepare a storage path for usage. This will create containers |
293 | | - * that don't yet exist or, on FS backends, create parent directories. |
| 291 | + * Prepare a storage directory for usage. |
| 292 | + * This will create any required containers and parent directories. |
| 293 | + * Backends using key/value stores only need to create the container. |
294 | 294 | * |
295 | 295 | * $params include: |
296 | 296 | * dir : storage directory |
— | — | @@ -312,8 +312,8 @@ |
313 | 313 | /** |
314 | 314 | * Take measures to block web access to a storage directory and |
315 | 315 | * the container it belongs to. FS backends might add .htaccess |
316 | | - * files whereas backends like Swift this might restrict container |
317 | | - * access to backend user that represents end-users in web request. |
| 316 | + * files whereas key/value store backends might restrict container |
| 317 | + * access to the auth user that represents end-users in web request. |
318 | 318 | * This is not guaranteed to actually do anything. |
319 | 319 | * |
320 | 320 | * $params include: |
— | — | @@ -341,8 +341,9 @@ |
342 | 342 | abstract protected function doSecure( array $params ); |
343 | 343 | |
344 | 344 | /** |
345 | | - * Clean up an empty storage directory. |
346 | | - * On FS backends, the directory will be deleted. Others may do nothing. |
| 345 | + * Delete a storage directory if it is empty. |
| 346 | + * Backends using key/value stores may do nothing unless the directory |
| 347 | + * is that of an empty container, in which case it should be deleted. |
347 | 348 | * |
348 | 349 | * $params include: |
349 | 350 | * dir : storage directory |
Index: trunk/phase3/includes/StreamFile.php |
— | — | @@ -41,17 +41,17 @@ |
42 | 42 | * (c) sends Content-Length header based on HTTP_IF_MODIFIED_SINCE check |
43 | 43 | * |
44 | 44 | * @param $path string Storage path or file system path |
45 | | - * @param $info Array File stat info with 'mtime' and 'size' fields |
| 45 | + * @param $info Array|false File stat info with 'mtime' and 'size' fields |
46 | 46 | * @param $headers Array Additional headers to send |
47 | 47 | * @param $sendErrors bool Send error messages if errors occur (like 404) |
48 | 48 | * @return int|false READY_STREAM, NOT_MODIFIED, or false on failure |
49 | 49 | */ |
50 | 50 | public static function prepareForStream( |
51 | | - $path, array $info, $headers = array(), $sendErrors = true |
| 51 | + $path, $info, $headers = array(), $sendErrors = true |
52 | 52 | ) { |
53 | 53 | global $wgLanguageCode; |
54 | 54 | |
55 | | - if ( !$info ) { |
| 55 | + if ( !is_array( $info ) ) { |
56 | 56 | if ( $sendErrors ) { |
57 | 57 | header( 'HTTP/1.0 404 Not Found' ); |
58 | 58 | header( 'Cache-Control: no-cache' ); |