Include short descriptions for extensions bundled in the release
[lhc/web/wiklou.git] / includes / cache / LinkCache.php
index de2a728..169816b 100644 (file)
@@ -35,6 +35,7 @@ class LinkCache {
        private $mGoodLinkFields = array();
        private $mBadLinks = array();
        private $mForUpdate = false;
+       private $useDatabase = true;
 
        /**
         * @var LinkCache
@@ -209,6 +210,19 @@ class LinkCache {
                }
        }
 
+       /**
+        * Enable or disable database use.
+        * @since 1.22
+        * @param $value Boolean
+        * @return Boolean
+        */
+       public function useDatabase( $value = null ) {
+               if ( $value !== null ) {
+                       $this->useDatabase = (bool)$value;
+               }
+               return $this->useDatabase;
+       }
+
        /**
         * Add a title to the link cache, return the page_id or zero if non-existent
         *
@@ -239,6 +253,10 @@ class LinkCache {
                        return 0;
                }
 
+               if( !$this->useDatabase ) {
+                       return 0;
+               }
+
                # Some fields heavily used for linking...
                if ( $this->mForUpdate ) {
                        $db = wfGetDB( DB_MASTER );