/** * Get the last modification timestamp of the message blob for this * module in a given language. * @param $lang String: Language code * @return Integer: UNIX timestamp, or 0 if no blob found */ public function getMsgBlobMtime($lang) { if (!isset($this->msgBlobMtime[$lang])) { if (!count($this->getMessages())) { return 0; } // Use file cache instead of db ( for mwEmbed minimal config and minimal framework code ) $msgBlobMtime = mweGetFromFileCache(implode(array('msg_resource', 'mr_timestamp', 'mr_resource_' . $this->getName(), 'mr_lang_' . $lang))); /*$dbr = wfGetDB( DB_SLAVE ); $msgBlobMtime = $dbr->selectField( 'msg_resource', 'mr_timestamp', array( 'mr_resource' => $this->getName(), 'mr_lang' => $lang ), __METHOD__ ); */ $this->msgBlobMtime[$lang] = $msgBlobMtime ? wfTimestamp(TS_UNIX, $msgBlobMtime) : 0; } return $this->msgBlobMtime[$lang]; }
public static function get($key) { return mweGetFromFileCache($key); }