From 060f7a11d75f3e73f338def1fc752535d33bc6f0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 7 Dec 2012 16:11:39 +0100 Subject: [PATCH] Minor ACP/WCFSetup improvements, WCF is now always ID 1 In theory it would have been possible that WCF has a package id different from the value "1", but there is no way to achieve this unless you're manually screwing things up. This is no longer supported and the whole system will fail if you go full retard. --- .../install/files/acp/templates/benchmark.tpl | 20 ++++++++++++++++-- .../files/lib/acp/page/IndexPage.class.php | 3 +-- .../install/files/lib/system/WCFACP.class.php | 21 +------------------ .../SessionAccessLogListener.class.php | 2 +- .../setup/template/stepInstallPackages.tpl | 1 + 5 files changed, 22 insertions(+), 25 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/benchmark.tpl b/wcfsetup/install/files/acp/templates/benchmark.tpl index ce53d47ebf..ff18047ae1 100644 --- a/wcfsetup/install/files/acp/templates/benchmark.tpl +++ b/wcfsetup/install/files/acp/templates/benchmark.tpl @@ -1,9 +1,25 @@

Execution time: {@$__wcf->getBenchmark()->getExecutionTime()}s ({#($__wcf->getBenchmark()->getExecutionTime()-$__wcf->getBenchmark()->getQueryExecutionTime())/$__wcf->getBenchmark()->getExecutionTime()*100}% PHP, {#$__wcf->getBenchmark()->getQueryExecutionTime()/$__wcf->getBenchmark()->getExecutionTime()*100}% SQL) | SQL queries: {#$__wcf->getBenchmark()->getQueryCount()} | Memory-Usage: {$__wcf->getBenchmark()->getMemoryUsage()}

{if ENABLE_DEBUG_MODE} + diff --git a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php index b4eebc42b3..e34ef2a8e3 100755 --- a/wcfsetup/install/files/lib/acp/page/IndexPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/IndexPage.class.php @@ -132,9 +132,8 @@ class IndexPage extends AbstractPage { * @see wcf\page\IPage::show() */ public function show() { - $wcfPackageID = WCFACP::getWcfPackageID(); // check package installation queue - if ($wcfPackageID == 0) { + if ($this->action == 'WCFSetup') { $queueID = PackageInstallationDispatcher::checkPackageInstallationQueue(); if ($queueID) { diff --git a/wcfsetup/install/files/lib/system/WCFACP.class.php b/wcfsetup/install/files/lib/system/WCFACP.class.php index faa243ce67..95b0698c6e 100644 --- a/wcfsetup/install/files/lib/system/WCFACP.class.php +++ b/wcfsetup/install/files/lib/system/WCFACP.class.php @@ -143,29 +143,10 @@ class WCFACP extends WCF { protected function initPackage() { // define active package id if (!defined('PACKAGE_ID')) { - $packageID = self::getWcfPackageID(); - define('PACKAGE_ID', $packageID); + define('PACKAGE_ID', 1); } } - /** - * Returns the package id of the wcf package. - * - * @return integer - */ - public static final function getWcfPackageID() { - // try to find package wcf id - $sql = "SELECT packageID - FROM wcf".WCF_N."_package - WHERE package = 'com.woltlab.wcf'"; - $statement = WCFACP::getDB()->prepareStatement($sql); - $statement->execute(); - $package = $statement->fetchArray(); - - if (!$package) return 0; - else return $package['packageID']; - } - /** * Returns a list of all installed applications packages. * diff --git a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php index d55f04de79..58875d0f9d 100644 --- a/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php +++ b/wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php @@ -36,7 +36,7 @@ class SessionAccessLogListener implements IEventListener { if (!empty($row['sessionLogID'])) { $sessionLogID = $row['sessionLogID']; - $sessionLogEditor = new ACPSessionLogEditor(new ACPSessionLog($sessionLogID)); + $sessionLogEditor = new ACPSessionLogEditor(new ACPSessionLog(null, array('sessionLogID' => $sessionLogID))); $sessionLogEditor->update(array( 'lastActivityTime' => TIME_NOW )); diff --git a/wcfsetup/setup/template/stepInstallPackages.tpl b/wcfsetup/setup/template/stepInstallPackages.tpl index 6b0c5e02a7..c412c2cde5 100644 --- a/wcfsetup/setup/template/stepInstallPackages.tpl +++ b/wcfsetup/setup/template/stepInstallPackages.tpl @@ -9,6 +9,7 @@
{@SID_INPUT_TAG} +
-- 2.20.1