words = unserialize($cache_str); return true; } function createCache($filename) { file_put_contents($filename, serialize($this->words)); } function loadFile($filename) { $this->words = array(); foreach(file($filename) as $line) { $this->words[] = trim($line); } } function isStopword($sWord) { return in_array($sWord, $this->words); } static function &getSingleton() { static $singleton = null; if (is_null($singleton)) { $singleton = new KTStopwords; $oConfig =& KTConfig::getSingleton(); $singleton->loadFile($oConfig->get('urls/stopwordsFile')); } return $singleton; } } ?>