Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / includes / filerepo / backend / FileBackendStore.php
index 95e8627..f02724f 100644 (file)
@@ -894,6 +894,18 @@ abstract class FileBackendStore extends FileBackend {
                return $paths;
        }
 
+       /**
+        * @see FileBackend::getScopedLocksForOps()
+        * @return Array
+        */
+       public function getScopedLocksForOps( array $ops, Status $status ) {
+               $paths = $this->getPathsToLockForOpsInternal( $this->getOperationsInternal( $ops ) );
+               return array(
+                       $this->getScopedFileLocks( $paths['sh'], LockManager::LOCK_UW, $status ),
+                       $this->getScopedFileLocks( $paths['ex'], LockManager::LOCK_EX, $status )
+               );
+       }
+
        /**
         * @see FileBackend::doOperationsInternal()
         * @return Status
@@ -1030,7 +1042,6 @@ abstract class FileBackendStore extends FileBackend {
        /**
         * @see FileBackendStore::executeOpHandlesInternal()
         * @return Array List of corresponding Status objects
-        * @throws MWException
         */
        protected function doExecuteOpHandlesInternal( array $fileOpHandles ) {
                foreach ( $fileOpHandles as $fileOpHandle ) { // OK if empty
@@ -1206,7 +1217,7 @@ abstract class FileBackendStore extends FileBackend {
         * Any empty suffix means the container is not sharded.
         *
         * @param $container string Container name
-        * @param $relStoragePath string Storage path relative to the container
+        * @param $relPath string Storage path relative to the container
         * @return string|null Returns null if shard could not be determined
         */
        final protected function getContainerShard( $container, $relPath ) {
@@ -1345,7 +1356,6 @@ abstract class FileBackendStore extends FileBackend {
         *
         * @param $container string Resolved container name
         * @param $val mixed Information to cache
-        * @return void
         */
        final protected function setContainerCache( $container, $val ) {
                $this->memCache->set( $this->containerCacheKey( $container ), $val, 14*86400 );
@@ -1354,8 +1364,7 @@ abstract class FileBackendStore extends FileBackend {
        /**
         * Delete the cached info for a container
         *
-        * @param $containers string Resolved container name
-        * @return void
+        * @param $container string Resolved container name
         */
        final protected function deleteContainerCache( $container ) {
                if ( !$this->memCache->delete( $this->containerCacheKey( $container ) ) ) {
@@ -1434,7 +1443,6 @@ abstract class FileBackendStore extends FileBackend {
         *
         * @param $path string Storage path
         * @param $val mixed Information to cache
-        * @return void
         */
        final protected function setFileCache( $path, $val ) {
                $this->memCache->set( $this->fileCacheKey( $path ), $val, 7*86400 );
@@ -1444,7 +1452,6 @@ abstract class FileBackendStore extends FileBackend {
         * Delete the cached stat info for a file path
         *
         * @param $path string Storage path
-        * @return void
         */
        final protected function deleteFileCache( $path ) {
                if ( !$this->memCache->delete( $this->fileCacheKey( $path ) ) ) {
@@ -1686,6 +1693,12 @@ abstract class FileBackendStoreShardListIterator implements Iterator {
  * Iterator for listing directories
  */
 class FileBackendStoreShardDirIterator extends FileBackendStoreShardListIterator {
+       /**
+        * @param string $container
+        * @param string $dir
+        * @param array $params
+        * @return Array|null|Traversable
+        */
        protected function listFromShard( $container, $dir, array $params ) {
                return $this->backend->getDirectoryListInternal( $container, $dir, $params );
        }
@@ -1695,6 +1708,12 @@ class FileBackendStoreShardDirIterator extends FileBackendStoreShardListIterator
  * Iterator for listing regular files
  */
 class FileBackendStoreShardFileIterator extends FileBackendStoreShardListIterator {
+       /**
+        * @param string $container
+        * @param string $dir
+        * @param array $params
+        * @return Array|null|Traversable
+        */
        protected function listFromShard( $container, $dir, array $params ) {
                return $this->backend->getFileListInternal( $container, $dir, $params );
        }