Reverting r16861; incompatible change to message texts, breaks a lot of toggle displa...
[lhc/web/wiklou.git] / includes / LinkCache.php
index f262110..8e56225 100644 (file)
@@ -21,7 +21,7 @@ class LinkCache {
        /**
         * Get an instance of this class
         */
-       function &singleton() {
+       static function &singleton() {
                static $instance;
                if ( !isset( $instance ) ) {
                        $instance = new LinkCache;
@@ -37,8 +37,7 @@ class LinkCache {
        }
 
        /* private */ function getKey( $title ) {
-               global $wgDBname;
-               return $wgDBname.':lc:title:'.$title;
+               return wfMemcKey( 'lc', 'title', $title );
        }
 
        /**
@@ -88,10 +87,10 @@ class LinkCache {
        function getPageLinks() { return $this->mPageLinks; }
        function getGoodLinks() { return $this->mGoodLinks; }
        function getBadLinks() { return array_keys( $this->mBadLinks ); }
-       
+
        /**
         * Add a title to the link cache, return the page_id or zero if non-existent
-        * @param string $title Title to add
+        * @param $title String: title to add
         * @return integer
         */
        function addLink( $title ) {
@@ -102,10 +101,10 @@ class LinkCache {
                        return 0;
                }
        }
-       
+
        /**
         * Add a title to the link cache, return the page_id or zero if non-existent
-        * @param Title $nt Title to add
+        * @param $nt Title to add.
         * @return integer
         */
        function addLinkObj( &$nt ) {