Exemplo n.º 1
0
 static function getLangHandler($language)
 {
     $cparams = JComponentHelper::getParams('com_flexicontent');
     $filter_word_like_any = $cparams->get('filter_word_like_any', 0);
     if ($language == 'th-TH' && $filter_word_like_any == 0) {
         $segmenter_path = JPATH_SITE . DS . 'components' . DS . 'com_flexicontent' . DS . 'librairies' . DS . 'THSplitLib' . DS . 'segment.php';
         if (JFile::exists($segmenter_path)) {
             require_once $segmenter_path;
             // Apply caching to dictionary parsing regardless of cache setting ...
             $handlercache = JFactory::getCache('com_flexicontent_lang_handlers');
             // Get Joomla Cache of '... lang_handlers' Caching Group
             $handlercache->setCaching(1);
             // Force cache ON
             $handlercache->setLifeTime(24 * 3600);
             // Set expire time (hard-code this to 1 day), since it is costly
             $dictionary = $handlercache->call(array('Segment', 'loadDictionary'));
             Segment::setDictionary($dictionary);
             $handler = new Segment();
             return $handler;
         }
     }
     return false;
 }