APP_N is now an alias of WCF_N
authorAlexander Ebert <ebert@woltlab.com>
Fri, 7 Dec 2012 14:11:26 +0000 (15:11 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 7 Dec 2012 14:11:26 +0000 (15:11 +0100)
See #963

wcfsetup/install/files/acp/templates/package.tpl
wcfsetup/install/files/acp/templates/packageAutoUpdateList.tpl
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php
wcfsetup/install/files/lib/acp/page/PackageListDetailedPage.class.php
wcfsetup/install/files/lib/data/package/Package.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php
wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php
wcfsetup/setup/db/install.sql

index 8a9d2b24e8553441e82d63a24a8d7f61cecf1d37..59b6e63637120d1893c43057d6d6217501ae76fa 100644 (file)
                                <dt>{lang}wcf.acp.package.version{/lang}</dt>
                                <dd>{$package->packageVersion}</dd>
                        </dl>
-                       {if $package->instanceNo > 1}
-                               <dl>
-                                       <dt>{lang}wcf.acp.package.instanceNo{/lang}</dt>
-                                       <dd>{#$package->instanceNo}</dd>
-                               </dl>
-                       {elseif $package->package == 'com.woltlab.wcf' && WCF_N != 1}
-                               <dl>
-                                       <dt>{lang}wcf.acp.package.instanceNo{/lang}</dt>
-                                       <dd>{#WCF_N}</dd>
-                               </dl>
-                       {/if}
                        <dl>
                                <dt>{lang}wcf.acp.package.packageDate{/lang}</dt>
                                <dd>{@$package->packageDate|date}</dd>
index 71942a608e7c348a0e517798d48f1cb6080a8f31..3fe39a76be537e03af9e7f73b3aea2b5c5ef5f02 100644 (file)
@@ -41,7 +41,7 @@
                                                <h1>
                                                        <label>
                                                                <input type="checkbox" name="updates[{@$availableUpdate.packageID}]" onclick="enableFormElements(document.getElementById('version-{@$availableUpdate.packageID}Div'), this.checked)" value="{$availableUpdate.version.packageVersion}" />
-                                                               {$availableUpdate.packageName}{if $availableUpdate.instanceNo > 1} (#{#$availableUpdate.instanceNo}){/if}
+                                                               {$availableUpdate.packageName}
                                                        </label>
                                                </h1>
                                        </hgroup>
index f711dc50283e0c47d9773705f31725a17b48aa3d..22bdc6077a7fe0a9065e3f1f6de78c9a179acca1 100755 (executable)
@@ -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');
index dc1bbf36f9534ff399c9b552004e485a347ce744..12ecf92fa8bd26a5845ab98a5c8f01b10cf50253 100644 (file)
@@ -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
index 181ffb842cf97337142935729c5cb76338c88f23..5f8aaf559cbdec27ca70df504bf7704cfa800bfb 100644 (file)
@@ -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
index a368369ae115e984956e18358512b751fc98a46b..29edb67feb1e222e4df16584fdc46dc9aab9f995 100644 (file)
@@ -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'),
index 5e1d7b0bf132ce1b765f6c9c7e493311fb7e7252..d577f2205fd9857ad5030332a561ecacafd4b2ae 100644 (file)
@@ -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);
index f2aff4c685448451d554321a6cf82437203c1db2..4ab7639cc448825c29ba4a093bdc55475b4c7b3f 100644 (file)
@@ -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);
index 0180f99198aa413e543d99db60ab7f116f4f8926..510c82f26cefdbae9933d9464400788dd7454b60 100644 (file)
@@ -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,