/** * Creates cache settings * @return void */ public static function createCacheSettings() { self::$cacheArr = array(); $cacheDoc = new Uni_Data_XDOMDocument(); $cacheDoc->preserveWhiteSpace = FALSE; $cacheDoc->formatOutput = TRUE; $ds = DIRECTORY_SEPARATOR; $cacheSettingsPath = CACHE_DIR . $ds . 'cache.settings'; $cacheModel = Fox::getModel('core/cache'); $collection = $cacheModel->getCollection(); $root = $cacheDoc->createElement('cache'); foreach ($collection as $row) { self::$cacheArr[$row['cache_code']] = $row['status']; $cData = $cacheDoc->createCDATASection(''); $cData->appendData($row['status']); $entry = $cacheDoc->createElement('entry'); $entry->setAttribute('key', $row['cache_code']); $root->appendChild($entry); $entry->appendChild($cData); } $cacheDoc->appendChild($root); $cacheDoc->save($cacheSettingsPath); }