Index: trunk/extensions/TitleBlacklist/TitleBlacklist.list.php |
— | — | @@ -14,9 +14,9 @@ |
15 | 15 | const VERSION = 1; //Blacklist format |
16 | 16 | |
17 | 17 | public function load() { |
18 | | - global $wgTitleBlacklistSources, $wgMemc, $wgDBname, $wgTitleBlacklistCaching; |
| 18 | + global $wgTitleBlacklistSources, $wgMemc, $wgTitleBlacklistCaching; |
19 | 19 | //Try to find something in the cache |
20 | | - $cachedBlacklist = $wgMemc->get( "{$wgDBname}:title_blacklist_entries" ); |
| 20 | + $cachedBlacklist = $wgMemc->get( wfMemcKey( "title_blacklist_entries" ) ); |
21 | 21 | if( is_array( $cachedBlacklist ) && count( $cachedBlacklist ) > 1 && ( $cachedBlacklist[0]->getFormatVersion() != self::VERSION ) ) { |
22 | 22 | |
23 | 23 | $this->mBlacklist = $cachedBlacklist; |
— | — | @@ -29,7 +29,7 @@ |
30 | 30 | foreach( $sources as $source ) { |
31 | 31 | $this->mBlacklist = array_merge( $this->mBlacklist, $this->parseBlacklist( $this->getBlacklistText( $source ) ) ); |
32 | 32 | } |
33 | | - $wgMemc->set( "{$wgDBname}:title_blacklist_entries", $this->mBlacklist, $wgTitleBlacklistCaching['expiry'] ); |
| 33 | + $wgMemc->set( wfMemcKey( "title_blacklist_entries" ), $this->mBlacklist, $wgTitleBlacklistCaching['expiry'] ); |
34 | 34 | } |
35 | 35 | |
36 | 36 | public function getBlacklistText( $source ) { |
— | — | @@ -107,9 +107,9 @@ |
108 | 108 | } |
109 | 109 | |
110 | 110 | public function getHttp( $url ) { |
111 | | - global $messageMemc, $wgDBname, $wgTitleBlacklistCaching; |
112 | | - $key = "title_blacklist_source:" . md5( $url ); |
113 | | - $warnkey = "{$wgDBname}:titleblacklistwarning:" . md5( $url ); |
| 111 | + global $messageMemc, $wgTitleBlacklistCaching; |
| 112 | + $key = "title_blacklist_source:" . md5( $url ); // Global shared |
| 113 | + $warnkey = wfMemcKey( "titleblacklistwarning", md5( $url ) ); |
114 | 114 | $result = $messageMemc->get( $key ); |
115 | 115 | $warn = $messageMemc->get( $warnkey ); |
116 | 116 | if ( !is_string( $result ) || ( !$warn && !mt_rand( 0, $wgTitleBlacklistCaching['warningchance'] ) ) ) { |
— | — | @@ -121,8 +121,8 @@ |
122 | 122 | } |
123 | 123 | |
124 | 124 | public function invalidate() { |
125 | | - global $wgMemc, $wgDBname; |
126 | | - $wgMemc->delete( "{$wgDBname}:title_blacklist_entries" ); |
| 125 | + global $wgMemc; |
| 126 | + $wgMemc->delete( wfMemcKey( "title_blacklist_entries" ) ); |
127 | 127 | } |
128 | 128 | |
129 | 129 | public function validate( $blacklist ) { |