Merge "Revert "Adding sanity check to Title::isRedirect().""
[lhc/web/wiklou.git] / includes / filerepo / backend / FileBackend.php
index 94e509e..42ddcbf 100644 (file)
@@ -88,6 +88,7 @@ abstract class FileBackend {
         *     'concurrency' : How many file operations can be done in parallel.
         *
         * @param $config Array
+        * @throws MWException
         */
        public function __construct( array $config ) {
                $this->name = $config['name'];
@@ -663,6 +664,7 @@ abstract class FileBackend {
         * $params include:
         *     dir : storage directory
         *
+        * @param $params array
         * @return bool|null Returns null on failure
         * @since 1.20
         */
@@ -682,6 +684,7 @@ abstract class FileBackend {
         *     dir     : storage directory
         *     topOnly : only return direct child dirs of the directory
         *
+        * @param $params array
         * @return Traversable|Array|null Returns null on failure
         * @since 1.20
         */
@@ -696,6 +699,7 @@ abstract class FileBackend {
         * $params include:
         *     dir : storage directory
         *
+        * @param $params array
         * @return Traversable|Array|null Returns null on failure
         * @since 1.20
         */
@@ -717,6 +721,7 @@ abstract class FileBackend {
         *     dir     : storage directory
         *     topOnly : only return direct child files of the directory (@since 1.20)
         *
+        * @param $params array
         * @return Traversable|Array|null Returns null on failure
         */
        abstract public function getFileList( array $params );
@@ -730,6 +735,7 @@ abstract class FileBackend {
         * $params include:
         *     dir : storage directory
         *
+        * @param $params array
         * @return Traversable|Array|null Returns null on failure
         * @since 1.20
         */
@@ -788,6 +794,24 @@ abstract class FileBackend {
                return ScopedLock::factory( $this->lockManager, $paths, $type, $status );
        }
 
+       /**
+        * Get an array of scoped locks needed for a batch of file operations.
+        *
+        * Normally, FileBackend::doOperations() handles locking, unless
+        * the 'nonLocking' param is passed in. This function is useful if you
+        * want the files to be locked for a broader scope than just when the
+        * files are changing. For example, if you need to update DB metadata,
+        * you may want to keep the files locked until finished.
+        *
+        * @see FileBackend::doOperations()
+        *
+        * @param $ops Array List of file operations to FileBackend::doOperations()
+        * @param $status Status Status to update on lock/unlock
+        * @return Array List of ScopedFileLocks or null values
+        * @since 1.20
+        */
+       abstract public function getScopedLocksForOps( array $ops, Status $status );
+
        /**
         * Get the root storage path of this backend.
         * All container paths are "subdirectories" of this path.