/** * @see \wcf\form\IForm::save() */ public function save() { parent::save(); // save options $saveOptions = $this->optionHandler->save('wcf.acp.option', 'wcf.acp.option.option'); $this->objectAction = new OptionAction(array(), 'updateAll', array('data' => $saveOptions)); $this->objectAction->executeAction(); $this->saved(); // reset styles to make sure the updated option values are used StyleHandler::resetStylesheets(); // show succes message WCF::getTPL()->assign('success', true); }
/** * @see \wcf\action\IAction::execute() */ public function execute() { parent::execute(); // reset stylesheets StyleHandler::resetStylesheets(); // delete language cache and compiled templates as well LanguageFactory::getInstance()->deleteLanguageCache(); // get package dirs CacheHandler::getInstance()->flushAll(); $this->executed(); if (!isset($_POST['noRedirect'])) { HeaderUtil::redirect(LinkHandler::getInstance()->getLink('CacheList')); } exit; }
/** * Uninstalls node components and returns next node. * * @param string $node * @return string */ public function uninstall($node) { $nodes = $this->nodeBuilder->getNodeData($node); // invoke node-specific actions foreach ($nodes as $data) { $nodeData = unserialize($data['nodeData']); switch ($data['nodeType']) { case 'package': $this->uninstallPackage($nodeData); break; case 'pip': $this->executePIP($nodeData); break; } } // mark node as completed $this->nodeBuilder->completeNode($node); $node = $this->nodeBuilder->getNextNode($node); // perform post-uninstall actions if ($node == '') { // update options.inc.php if uninstallation is completed OptionEditor::resetCache(); // clear cache CacheHandler::getInstance()->flushAll(); // reset language cache LanguageFactory::getInstance()->clearCache(); LanguageFactory::getInstance()->deleteLanguageCache(); // reset stylesheets StyleHandler::resetStylesheets(); // rebuild application paths ApplicationHandler::rebuild(); } if ($this->requireRestructureVersionTables) { $this->restructureVersionTables(); } // return next node return $node; }
/** * Installs node components and returns next node. * * @param string $node * @return wcf\system\package\PackageInstallationStep */ public function install($node) { $nodes = $this->nodeBuilder->getNodeData($node); // invoke node-specific actions foreach ($nodes as $data) { $nodeData = unserialize($data['nodeData']); switch ($data['nodeType']) { case 'package': $step = $this->installPackage($nodeData); break; case 'pip': $step = $this->executePIP($nodeData); break; case 'optionalPackages': $step = $this->selectOptionalPackages($node, $nodeData); break; default: die("Unknown node type: '".$data['nodeType']."'"); break; } if ($step->splitNode()) { $this->nodeBuilder->cloneNode($node, $data['sequenceNo']); break; } } // mark node as completed $this->nodeBuilder->completeNode($node); // assign next node $node = $this->nodeBuilder->getNextNode($node); $step->setNode($node); // perform post-install/update actions if ($node == '') { // update options.inc.php OptionEditor::resetCache(); if ($this->action == 'install') { // save localized package infos $this->saveLocalizedPackageInfos(); // remove all cache files after WCFSetup if (!PACKAGE_ID) { CacheHandler::getInstance()->flushAll(); } // rebuild application paths ApplicationHandler::rebuild(); ApplicationEditor::setup(); } // remove template listener cache TemplateListenerCacheBuilder::getInstance()->reset(); TemplateListenerCodeCacheBuilder::getInstance()->reset(); // reset language cache LanguageFactory::getInstance()->clearCache(); LanguageFactory::getInstance()->deleteLanguageCache(); // reset stylesheets StyleHandler::resetStylesheets(); } if ($this->requireRestructureVersionTables) { $this->restructureVersionTables(); } return $step; }
/** * Installs node components and returns next node. * * @param string $node * @return \wcf\system\package\PackageInstallationStep */ public function install($node) { $nodes = $this->nodeBuilder->getNodeData($node); // invoke node-specific actions foreach ($nodes as $data) { $nodeData = unserialize($data['nodeData']); switch ($data['nodeType']) { case 'package': $step = $this->installPackage($nodeData); break; case 'pip': $step = $this->executePIP($nodeData); break; case 'optionalPackages': $step = $this->selectOptionalPackages($node, $nodeData); break; default: die("Unknown node type: '" . $data['nodeType'] . "'"); break; } if ($step->splitNode()) { $this->nodeBuilder->cloneNode($node, $data['sequenceNo']); break; } } // mark node as completed $this->nodeBuilder->completeNode($node); // assign next node $tmp = $node; $node = $this->nodeBuilder->getNextNode($node); $step->setNode($node); // perform post-install/update actions if ($node == '') { // update "last update time" option $sql = "UPDATE\twcf" . WCF_N . "_option\n\t\t\t\tSET\toptionValue = ?\n\t\t\t\tWHERE\toptionName = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array(TIME_NOW, 'last_update_time')); // update options.inc.php OptionEditor::resetCache(); if ($this->action == 'install') { // save localized package infos $this->saveLocalizedPackageInfos(); // remove all cache files after WCFSetup if (!PACKAGE_ID) { CacheHandler::getInstance()->flushAll(); $sql = "UPDATE\twcf" . WCF_N . "_option\n\t\t\t\t\t\tSET\toptionValue = ?\n\t\t\t\t\t\tWHERE\toptionName = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array(StringUtil::getUUID(), 'wcf_uuid')); if (WCF::getSession()->getVar('__wcfSetup_developerMode')) { $statement->execute(array(1, 'enable_debug_mode')); } // update options.inc.php OptionEditor::resetCache(); } // rebuild application paths ApplicationHandler::rebuild(); ApplicationEditor::setup(); } // remove template listener cache TemplateListenerCodeCacheBuilder::getInstance()->reset(); // reset language cache LanguageFactory::getInstance()->clearCache(); LanguageFactory::getInstance()->deleteLanguageCache(); // reset stylesheets StyleHandler::resetStylesheets(); // clear user storage UserStorageHandler::getInstance()->clear(); // rebuild config files for affected applications $sql = "SELECT\t\tpackage.packageID\n\t\t\t\tFROM\t\twcf" . WCF_N . "_package_installation_queue queue,\n\t\t\t\t\t\twcf" . WCF_N . "_package package\n\t\t\t\tWHERE\t\tqueue.processNo = ?\n\t\t\t\t\t\tAND package.packageID = queue.packageID\n\t\t\t\t\t\tAND package.packageID <> ?\n\t\t\t\t\t\tAND package.isApplication = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->queue->processNo, 1, 1)); while ($row = $statement->fetchArray()) { Package::writeConfigFile($row['packageID']); } EventHandler::getInstance()->fireAction($this, 'postInstall'); // remove archives $sql = "SELECT\tarchive\n\t\t\t\tFROM\twcf" . WCF_N . "_package_installation_queue\n\t\t\t\tWHERE\tprocessNo = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->queue->processNo)); while ($row = $statement->fetchArray()) { @unlink($row['archive']); } // delete queues $sql = "DELETE FROM\twcf" . WCF_N . "_package_installation_queue\n\t\t\t\tWHERE\t\tprocessNo = ?"; $statement = WCF::getDB()->prepareStatement($sql); $statement->execute(array($this->queue->processNo)); } if ($this->requireRestructureVersionTables) { $this->restructureVersionTables(); } return $step; }