- if($langcode!=$wgContLanguageCode)
- $title.="/$langcode";
-
- # Try the cache
- if ( $this->mUseCache && $this->mCache && array_key_exists( $title, $this->mCache ) ) {
- $message = $this->mCache[$title];
- }
-
- if ( !$message && $this->mUseCache ) {
- $message = $this->mMemc->get($this->mMemcKey.':'.$title);
- if ($message) {
- $this->mCache[$title]=$message;
- }
- }
-
- # If it wasn't in the cache, load each message from the DB individually
- if ( !$message ) {
- $dbr =& wfGetDB( DB_SLAVE );
- $result = $dbr->selectRow( 'cur', array('cur_text'),
- array( 'cur_namespace' => NS_MEDIAWIKI, 'cur_title' => $title ),
- 'MessageCache::get' );
- if ( $result ) {
- $message = $result->cur_text;
- if ($this->mUseCache) {
- $this->mCache[$title]=$message;
- /* individual messages may be often
- recached until proper purge code exists
- */
- $this->mMemc->set($this->mMemcKey.':'.$title,$message,300);
- }
- }