public static function init() { Debug::enabled_current_script_debug(); Debug::set_plain_text_output_mode(); set_exception_handler(array('Debug', 'fatal')); self::setup_server_env(); self::fit_to_php_configuration(); self::load_static_constants(); self::load_dynamic_constants(); AppContext::set_request(new HTTPRequestCustom()); AppContext::set_session(SessionData::admin_session()); AppContext::set_current_user(new AdminUser()); AppContext::init_extension_provider_service(); AppContext::set_response(new HTTPResponseCustom()); }
/** * @static * @desc Uninstalls a module. * @param int $module_id Module id (in the DB_TABLE_MODULES table) * @param bool $drop_files true if you want the module files to be dropped, otherwise false. * @return int One of the following error codes: * <ul> * <li>MODULE_FILES_COULD_NOT_BE_DROPPED: the module files couldn't be deleted (probably due to an authorization issue) but it has been uninstalled .</li> * <li>MODULE_UNINSTALLED: the module was successfully uninstalled.</li> * <li>NOT_INSTALLED_MODULE: the module to uninstall doesn't exist!</li> * </ul> */ public static function uninstall_module($module_id, $drop_files = false) { if (!empty($module_id) && self::is_module_installed($module_id)) { $error = self::execute_module_uninstallation($module_id); if ($error === null) { ContributionService::delete_contribution_module($module_id); NotationService::delete_notes_module($module_id); CommentsService::delete_comments_module($module_id); PersistenceContext::get_querier()->delete(DB_TABLE_CONFIGS, "WHERE name = :name", array('name' => $module_id)); //Régénération des feeds. Feed::clear_cache($module_id); try { if (ServerEnvironmentConfig::load()->is_url_rewriting_enabled()) { HtaccessFileCache::regenerate(); } } catch (IOException $ex) { } MenuService::delete_mini_module($module_id); MenuService::delete_module_feeds_menus($module_id); ModulesConfig::load()->remove_module_by_id($module_id); ModulesConfig::save(); //Module home page ? $general_config = GeneralConfig::load(); $module_home_page_selected = $general_config->get_module_home_page(); if ($module_home_page_selected == $module_id) { $general_config->set_module_home_page(''); $general_config->set_other_home_page('index.php'); } //Suppression des fichiers du module if ($drop_files) { $folder = new Folder(PATH_TO_ROOT . '/' . $module_id); try { $folder->delete(); self::update_class_list(); AppContext::init_extension_provider_service(); } catch (IOException $ex) { return self::MODULE_FILES_COULD_NOT_BE_DROPPED; } } AppContext::get_cache_service()->clear_cache(); return self::MODULE_UNINSTALLED; } return $error; } else { return self::NOT_INSTALLED_MODULE; } }
private function generate_cache() { AppContext::get_cache_service()->clear_cache(); AppContext::init_extension_provider_service(); }
public static function init_services() { self::init_http_services(); AppContext::init_extension_provider_service(); }