function initI18N() { global $redis; $ttl = 86400; $hash = "xtoolsI18N_" . XTOOLS_REDIS_FLUSH_TOKEN . '35'; $lc = $redis->get($hash); if ($lc === false) { $initOpts = array('suppressfatal' => true, 'stayalive' => true); $I18N = new Intuition($initOpts); $I18N->loadTextdomainFromFile(XTOOLS_I18_TEXTFILE, 'xtools'); $I18N->setDomain('xtools'); $redis->setex($hash, $ttl, serialize($I18N)); } else { $I18N = unserialize($lc); unset($lc); } //temp messages $this->i18Langs = $I18N->getAvailableLangs('xtools'); return $I18N; }