Make LocalFile check early if the revision store is available
[lhc/web/wiklou.git] / includes / externalstore / ExternalStoreMedium.php
index e9c34a4..da7752b 100644 (file)
@@ -19,7 +19,6 @@
  *
  * @file
  * @ingroup ExternalStorage
- * @author Aaron Schulz
  */
 
 /**
  */
 abstract class ExternalStoreMedium {
        /** @var array */
-       protected $params = array();
+       protected $params = [];
 
        /**
-        * @param array $params Options
+        * @param array $params Usage context options:
+        *   - wiki: the domain ID of the wiki this is being used for [optional]
         */
-       public function __construct( array $params = array() ) {
+       public function __construct( array $params = [] ) {
                $this->params = $params;
        }
 
@@ -55,7 +55,7 @@ abstract class ExternalStoreMedium {
         * @return array Map from the url to the text stored. Unfound data is not represented
         */
        public function batchFetchFromURLs( array $urls ) {
-               $retval = array();
+               $retval = [];
                foreach ( $urls as $url ) {
                        $data = $this->fetchFromURL( $url );
                        // Dont return when false to allow for simpler implementations.
@@ -77,4 +77,15 @@ abstract class ExternalStoreMedium {
         * @throws MWException
         */
        abstract public function store( $location, $data );
+
+       /**
+        * Check if a given location is read-only
+        *
+        * @param string $location The location name
+        * @return bool Whether this location is read-only
+        * @since 1.31
+        */
+       public function isReadOnly( $location ) {
+               return false;
+       }
 }