/** * Triggers the installation of a package * @permissions edit * @return string */ protected function actionInstallPackage() { $this->setArrModuleEntry("template", "/folderview.tpl"); $strReturn = ""; $strLog = ""; $strFile = $this->getParam("package"); $objManager = new class_module_packagemanager_manager(); if ($objManager->validatePackage($strFile)) { if (uniSubstr($strFile, -4) == ".zip") { $objHandler = $objManager->extractPackage($strFile); $objFilesystem = new class_filesystem(); $objFilesystem->fileDelete($strFile); $objHandler->move2Filesystem(); class_classloader::getInstance()->flushCache(); class_reflection::flushCache(); class_resourceloader::getInstance()->flushCache(); //reload the module-ids bootstrapIncludeModuleIds(); //reload the current request in order to flush the class-loader $this->adminReload(class_link::getLinkAdminHref("packagemanager", "installPackage", "&package=" . $objHandler->getStrTargetPath())); return; } else { $objHandler = $objManager->getPackageManagerForPath($strFile); } if ($objHandler->getObjMetadata()->getBitProvidesInstaller()) { $strLog .= $objHandler->installOrUpdate(); } $strLog .= "Updating default template pack...\n"; $objHandler->updateDefaultTemplate(); $strOnSubmit = 'window.parent.parent.location.reload();'; if ($strLog !== "") { $strReturn .= $this->objToolkit->formHeadline($this->getLang("package_install_success")); $strReturn .= $this->objToolkit->getPreformatted(array($strLog)); $strReturn .= $this->objToolkit->formHeader(class_link::getLinkAdminHref($this->getArrModule("modul"), "list"), "", "", "javascript:" . $strOnSubmit); $strReturn .= $this->objToolkit->formInputSubmit($this->getLang("commons_ok")); $strReturn .= $this->objToolkit->formClose(); } else { // break out of dialog and remove iframes by reloading main window $strReturn .= '<script>' . $strOnSubmit . '</script>'; } } return $strReturn; }
rawIncludeError("global exception handler"); } //register global exception handler for exceptions thrown but not catched (bad style ;) ) @set_exception_handler(array("class_exception", "globalExceptionHandler")); //Include the logging-engine if (!@(include_once _corepath_ . "/module_system/system/class_logger.php")) { rawIncludeError("logging engine"); } //---The Path on web------------------------------------------------------------------------------------- require_once _corepath_ . "/module_system/system/class_config.php"; $strHeaderName = class_config::readPlainConfigsFromFilesystem("https_header"); $strHeaderValue = strtolower(class_config::readPlainConfigsFromFilesystem("https_header_value")); if (strpos($_SERVER['SCRIPT_FILENAME'], "/debug/")) { //Determine the current path on the web $strWeb = dirname((isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']); define("_webpath_", saveUrlEncode(substr_replace($strWeb, "", strrpos($strWeb, "/")))); } else { //Determine the current path on the web $strWeb = dirname((isset($_SERVER[$strHeaderName]) && strtolower($_SERVER[$strHeaderName]) == $strHeaderValue ? "https://" : "http://") . (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : "localhost") . $_SERVER['SCRIPT_NAME']); define("_webpath_", saveUrlEncode($strWeb)); } //---Include Section 2----------------------------------------------------------------------------------- //load module-ids bootstrapIncludeModuleIds(); //---Auto-Loader for classes----------------------------------------------------------------------------- require_once _corepath_ . "/module_system/system/class_classloader.php"; spl_autoload_register(array(class_classloader::getInstance(), "loadClass")); //The Carrier-Class if (!@(include_once _corepath_ . "/module_system/system/class_carrier.php")) { rawIncludeError("carrier-class"); }