/** * 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); // update options.inc.php if uninstallation is completed if ($node == '') { OptionEditor::resetCache(); } // return next node return $node; }
/** * 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; }
<?php use wcf\data\option\OptionEditor; /** * @author Alexander Ebert * @copyright 2001-2015 WoltLab GmbH * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php> * @package com.woltlab.wcf * @category Community Framework */ $options = array('cache_source_type' => CACHE_SOURCE_TYPE == 'no' ? 'disk' : CACHE_SOURCE_TYPE, 'last_update_time' => TIME_NOW, 'url_legacy_mode' => 1, 'url_to_lowercase' => 0, 'user_cleanup_notification_lifetime' => USER_CLEANUP_NOTIFICATION_LIFETIME == 60 ? 14 : USER_CLEANUP_NOTIFICATION_LIFETIME, 'wcf_uuid' => sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(16384, 20479), mt_rand(32768, 49151), mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535))); // clear recaptcha keys if public key and private key match WoltLab's OEM key if (RECAPTCHA_PUBLICKEY === '6LfOlMYSAAAAADvo3s4puBAYDqI-6YK2ybe7BJE5' && RECAPTCHA_PRIVATEKEY === '6LfOlMYSAAAAAKR3m_EFxmDv1xS8PCfeaSZ2LdG9') { $options['recaptcha_publickey'] = ''; $options['recaptcha_privatekey'] = ''; } OptionEditor::import($options); OptionEditor::resetCache();
/** * Installs node components and returns next node. * * @param string $node * @return 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); // update options.inc.php and save localized package infos if ($node == '') { OptionEditor::resetCache(); if ($this->action == 'install') { $this->saveLocalizedPackageInfos(); } } 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; }