From 3f2f7b1681e2a91771ca2f5383c13052766ae143 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 7 Dec 2012 15:11:26 +0100 Subject: [PATCH] APP_N is now an alias of WCF_N See #963 --- wcfsetup/install/files/acp/templates/package.tpl | 11 ----------- .../files/acp/templates/packageAutoUpdateList.tpl | 2 +- .../files/lib/acp/page/CacheListPage.class.php | 4 ++-- .../lib/acp/page/PackageListDetailedPage.class.php | 2 +- .../files/lib/data/package/Package.class.php | 4 +++- .../PackageInstallationNodeBuilder.class.php | 13 ------------- .../package/PackageUpdateDispatcher.class.php | 2 +- .../plugin/SQLPackageInstallationPlugin.class.php | 2 +- wcfsetup/setup/db/install.sql | 1 - 9 files changed, 9 insertions(+), 32 deletions(-) diff --git a/wcfsetup/install/files/acp/templates/package.tpl b/wcfsetup/install/files/acp/templates/package.tpl index 8a9d2b24e8..59b6e63637 100644 --- a/wcfsetup/install/files/acp/templates/package.tpl +++ b/wcfsetup/install/files/acp/templates/package.tpl @@ -39,17 +39,6 @@
{lang}wcf.acp.package.version{/lang}
{$package->packageVersion}
- {if $package->instanceNo > 1} -
-
{lang}wcf.acp.package.instanceNo{/lang}
-
{#$package->instanceNo}
-
- {elseif $package->package == 'com.woltlab.wcf' && WCF_N != 1} -
-
{lang}wcf.acp.package.instanceNo{/lang}
-
{#WCF_N}
-
- {/if}
{lang}wcf.acp.package.packageDate{/lang}
{@$package->packageDate|date}
diff --git a/wcfsetup/install/files/acp/templates/packageAutoUpdateList.tpl b/wcfsetup/install/files/acp/templates/packageAutoUpdateList.tpl index 71942a608e..3fe39a76be 100644 --- a/wcfsetup/install/files/acp/templates/packageAutoUpdateList.tpl +++ b/wcfsetup/install/files/acp/templates/packageAutoUpdateList.tpl @@ -41,7 +41,7 @@

diff --git a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php index f711dc5028..22bdc6077a 100755 --- a/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/CacheListPage.class.php @@ -105,7 +105,7 @@ class CacheListPage extends AbstractPage { $this->cacheData['version'] = phpversion('apc'); // get package dirs - $sql = "SELECT packageDir, packageName, instanceNo + $sql = "SELECT packageDir, packageName FROM wcf".WCF_N."_package WHERE isApplication = ?"; $statement = WCF::getDB()->prepareStatement($sql); @@ -114,7 +114,7 @@ class CacheListPage extends AbstractPage { $packageNames = array(); while ($row = $statement->fetchArray()) { $packagePath = FileUtil::getRealPath(WCF_DIR.$row['packageDir']).'cache/'; - $packageNames[$packagePath] = $row['packageName'].' #'.$row['instanceNo']; + $packageNames[$packagePath] = $row['packageName']; } $apcinfo = apc_cache_info('user'); diff --git a/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php b/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php index dc1bbf36f9..12ecf92fa8 100644 --- a/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php +++ b/wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php @@ -37,7 +37,7 @@ class PackageListDetailedPage extends SortablePage { /** * @see wcf\page\SortablePage::$validSortFields */ - public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'instanceNo', 'packageDescription', 'packageDate', 'packageURL', 'isUnique', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate'); + public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'packageDescription', 'packageDate', 'packageURL', 'isUnique', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate'); /** * @see wcf\page\MultipleLinkPage::$objectListClassName diff --git a/wcfsetup/install/files/lib/data/package/Package.class.php b/wcfsetup/install/files/lib/data/package/Package.class.php index 181ffb842c..5f8aaf559c 100644 --- a/wcfsetup/install/files/lib/data/package/Package.class.php +++ b/wcfsetup/install/files/lib/data/package/Package.class.php @@ -423,7 +423,9 @@ class Package extends DatabaseObject { $file->write("// ".$package->package." (packageID ".$package->packageID.")\n"); $file->write("if (!defined('".$prefix."_DIR')) define('".$prefix."_DIR', dirname(__FILE__).'/');\n"); $file->write("if (!defined('RELATIVE_".$prefix."_DIR')) define('RELATIVE_".$prefix."_DIR', '');\n"); - $file->write("if (!defined('".$prefix."_N')) define('".$prefix."_N', '".WCF_N."_".$package->instanceNo."');\n"); + $file->write("\n"); + $file->write("\n// using ".$prefix."_N is deprecated, please use WCF_N instead!"); + $file->write("if (!defined('".$prefix."_N')) define('".$prefix."_N', '".WCF_N."');\n"); $file->write("\n"); // write general information diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php index a368369ae1..29edb67feb 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php @@ -363,18 +363,6 @@ class PackageInstallationNodeBuilder { $this->node = $this->getToken(); // calculate the number of instances of this package - $instanceNo = 1; - $sql = "SELECT COUNT(*) AS count, MAX(instanceNo) AS instanceNo - FROM wcf".WCF_N."_package - WHERE package = ?"; - $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute(array( - $this->installation->getArchive()->getPackageInfo('name') - )); - $row = $statement->fetchArray(); - - if ($row['count'] > 0) $instanceNo = $row['instanceNo'] + 1; - $sql = "INSERT INTO wcf".WCF_N."_package_installation_node (queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData) VALUES (?, ?, ?, ?, ?, ?, ?)"; @@ -389,7 +377,6 @@ class PackageInstallationNodeBuilder { serialize(array( 'package' => $this->installation->getArchive()->getPackageInfo('name'), 'packageName' => $this->installation->getArchive()->getLocalizedPackageInfo('packageName'), - 'instanceNo' => $instanceNo, 'packageDescription' => $this->installation->getArchive()->getLocalizedPackageInfo('packageDescription'), 'packageVersion' => $this->installation->getArchive()->getPackageInfo('version'), 'packageDate' => $this->installation->getArchive()->getPackageInfo('date'), diff --git a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php index 5e1d7b0bf1..d577f2205f 100644 --- a/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php @@ -469,7 +469,7 @@ abstract class PackageUpdateDispatcher { // get existing packages and their versions $existingPackages = array(); - $sql = "SELECT packageID, package, instanceNo, packageDescription, + $sql = "SELECT packageID, package, packageDescription, packageVersion, packageDate, author, authorURL, isApplication FROM wcf".WCF_N."_package"; $statement = WCF::getDB()->prepareStatement($sql); diff --git a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php index f2aff4c685..4ab7639cc4 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php @@ -38,7 +38,7 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin { if ($package->isApplication == 1) { // package is application $packageAbbr = Package::getAbbreviation($package->package); - $tablePrefix = WCF_N.'_'.$package->instanceNo.'_'; + $tablePrefix = WCF_N; // Replace the variable xyz1_1 with $tablePrefix in the table names. $queries = StringUtil::replace($packageAbbr.'1_1_', $packageAbbr.$tablePrefix, $queries); diff --git a/wcfsetup/setup/db/install.sql b/wcfsetup/setup/db/install.sql index 0180f99198..510c82f26c 100644 --- a/wcfsetup/setup/db/install.sql +++ b/wcfsetup/setup/db/install.sql @@ -307,7 +307,6 @@ CREATE TABLE wcf1_package ( package VARCHAR(255) NOT NULL DEFAULT '', packageDir VARCHAR(255) NOT NULL DEFAULT '', packageName VARCHAR(255) NOT NULL DEFAULT '', - instanceNo INT(10) NOT NULL DEFAULT 1, packageDescription VARCHAR(255) NOT NULL DEFAULT '', packageVersion VARCHAR(255) NOT NULL DEFAULT '', packageDate INT(10) NOT NULL DEFAULT 0, -- 2.20.1