/** * Create and Enable site cache * * @return bool */ function ossn_create_cache() { $database = new OssnDatabase(); $params['table'] = 'ossn_site_settings'; $params['names'] = array('value'); $params['values'] = array(1); $params['wheres'] = array("setting_id='4'"); if ($database->update($params)) { ossn_trigger_css_cache(); ossn_trigger_js_cache(); return true; } return false; }
/** * Trigger upgrade / Run upgrade * * @return void; * @access private */ function ossn_trigger_upgrades() { if (!ossn_isAdminLoggedin()) { ossn_error_page(); } $upgrades = ossn_get_process_upgrade_files(); if (!is_array($upgrades) || empty($upgrades)) { ossn_trigger_message(ossn_print('upgrade:not:available'), 'error', 'admin'); redirect('administrator'); return false; } foreach ($upgrades as $upgrade) { $file = ossn_route()->upgrade . "upgrades/{$upgrade}"; if (!(include_once $file)) { throw new exception(ossn_print('upgrade:file:load:error')); } } //need to reset cache files if (ossn_site_settings('cache') !== 0) { ossn_trigger_css_cache(); ossn_trigger_js_cache(); } return true; }