/** * Regenerates a cache file * * @version 1.0 * @since 1.0.0 * @author xLink * * @param string $file */ public function regenerateCache($file) { //if its present, remove it if (is_readable(sprintf($this->fileTpl, $file))) { unlink(sprintf($this->fileTpl, $file)); } //regenerate a new cache file $fn = ${$file . '_db'}; newCache($file, $fn); }
//or hasnt got access to her original tables msgDie('FAIL', sprintf($errorTPL, 'Fatal Error', 'Cannot load CMS Configuration, make sure installation ran properly and mySQL user has access to tables.')); } //sort through the configuration crap, spit out a useable version :D foreach ($config_db as $array) { $config[$array['array']][$array['var']] = $array['value']; } unset($config_db); //generate an array with names of files that should be added to the master config array() //NULL _SHOULD_ be the last 'file' $cache_gen = array('menus', 'menu_setups', 'menu_blocks', 'groups', 'bans', 'group_subscriptions', 'statistics', 'modules', 'plugins', NULL); //set all the *_db vars above into the $config array $x = 0; while ($var = $cache_gen[$x]) { if (!isset(${$var . '_db'})) { newCache($var, ${$var . '_db'}); } $x++; //do this here it only increments $cache_gen anyway //if var is empty, continue, no point wasting time if (is_empty($var)) { continue; } //setup $gen for the var $gen = isset(${$var . '_db'}) ? ${$var . '_db'} : NULL; if (!is_array($gen) || is_empty($gen)) { $config[$var] = NULL; } else { foreach ($gen as $k => $v) { $config[$var][$k] = $v; }