Replace usage of deprecated getRootUrl() method
[lhc/web/wiklou.git] / includes / filerepo / FileRepo.php
index bc1ad91..faed953 100644 (file)
@@ -1716,6 +1716,33 @@ class FileRepo {
         * @throws MWException
         */
        protected function assertWritableRepo() {}
+
+       /**
+        * Return information about the repository.
+        *
+        * @return array
+        * @since 1.22
+        */
+       public function getInfo() {
+               $ret = array(
+                       'name' => $this->getName(),
+                       'displayname' => $this->getDisplayName(),
+                       'rootUrl' => $this->getZoneUrl( 'public' ),
+                       'local' => $this->isLocal(),
+               );
+
+               $optionalSettings = array(
+                       'url', 'thumbUrl', 'initialCapital', 'descBaseUrl', 'scriptDirUrl', 'articleUrl',
+                       'fetchDescription', 'descriptionCacheExpiry', 'scriptExtension'
+               );
+               foreach ( $optionalSettings as $k ) {
+                       if ( isset( $this->$k ) ) {
+                               $ret[$k] = $this->$k;
+                       }
+               }
+
+               return $ret;
+       }
 }
 
 /**