From: Aaron Date: Tue, 24 Apr 2012 00:30:38 +0000 (-0700) Subject: [FileRepo] Fixed regression where thumbnails could not be written to foreign repos. X-Git-Tag: 1.31.0-rc.0~23833^2 X-Git-Url: http://git.cyclocoop.org/%24image?a=commitdiff_plain;h=dd47a326b5993e6ce49ff24bbe1df3f41b764749;p=lhc%2Fweb%2Fwiklou.git [FileRepo] Fixed regression where thumbnails could not be written to foreign repos. Change-Id: I196463326a40a5d1ff0d1fdabbce21c8b372ea41 --- diff --git a/includes/filerepo/FileRepo.php b/includes/filerepo/FileRepo.php index d38f5cae8d..35c3508dc6 100644 --- a/includes/filerepo/FileRepo.php +++ b/includes/filerepo/FileRepo.php @@ -782,6 +782,7 @@ class FileRepo { /** * Import a file from the local file system into the repo. * This does no locking nor journaling and overrides existing files. + * This function can be used to write to otherwise read-only foreign repos. * This is intended for copying generated thumbnails into the repo. * * @param $src string File system path @@ -794,7 +795,8 @@ class FileRepo { /** * Purge a file from the repo. This does no locking nor journaling. - * This is intended for purging thumbnail. + * This function can be used to write to otherwise read-only foreign repos. + * This is intended for purging thumbnails. * * @param $path string Virtual URL or storage path * @return FileRepoStatus @@ -806,14 +808,13 @@ class FileRepo { /** * Import a batch of files from the local file system into the repo. * This does no locking nor journaling and overrides existing files. + * This function can be used to write to otherwise read-only foreign repos. * This is intended for copying generated thumbnails into the repo. * * @param $src Array List of tuples (file system path, virtual URL or storage path) * @return FileRepoStatus */ public function quickImportBatch( array $pairs ) { - $this->assertWritableRepo(); // fail out if read-only - $status = $this->newGood(); $operations = array(); foreach ( $pairs as $pair ) { @@ -834,15 +835,14 @@ class FileRepo { } /** - * Purge a batch of files from the repo. This does no locking nor journaling. - * This is intended for purging thumbnails. + * Purge a batch of files from the repo. + * This function can be used to write to otherwise read-only foreign repos. + * This does no locking nor journaling and is intended for purging thumbnails. * * @param $path Array List of virtual URLs or storage paths * @return FileRepoStatus */ public function quickPurgeBatch( array $paths ) { - $this->assertWritableRepo(); // fail out if read-only - $status = $this->newGood(); $operations = array(); foreach ( $paths as $path ) { @@ -1087,14 +1087,13 @@ class FileRepo { } /** - * Deletes a directory if empty + * Deletes a directory if empty. + * This function can be used to write to otherwise read-only foreign repos. * * @param $dir string Virtual URL (or storage path) of directory to clean * @return Status */ public function cleanDir( $dir ) { - $this->assertWritableRepo(); // fail out if read-only - $status = $this->newGood(); $status->merge( $this->backend->clean( array( 'dir' => $this->resolveToStoragePath( $dir ) ) ) );