Fixed WCFSetup and creation of config files
authorAlexander Ebert <ebert@woltlab.com>
Tue, 6 Nov 2012 00:04:40 +0000 (01:04 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 6 Nov 2012 00:04:40 +0000 (01:04 +0100)
wcfsetup/install/files/lib/data/package/Package.class.php
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/template/SetupTemplateEngine.class.php

index 20d926c3f61599754e6bef78667d0b600ee7d818..85021f9330b68d729e7c7b8c2c68ac7993c3be5e 100644 (file)
@@ -616,12 +616,11 @@ class Package extends DatabaseObject {
                // write general information
                $file->write("// general info\n");
                $file->write("if (!defined('RELATIVE_WCF_DIR')) define('RELATIVE_WCF_DIR', RELATIVE_".$currentPrefix."_DIR.'".FileUtil::getRelativePath($packageDir, WCF_DIR)."');\n");
-               $file->write("if (!defined('PACKAGE_ID')) define('PACKAGE_ID', ".$row['packageID'].");\n");
+               $file->write("if (!defined('PACKAGE_ID')) define('PACKAGE_ID', ".$packageID.");\n");
                $file->write("if (!defined('PACKAGE_NAME')) define('PACKAGE_NAME', '".str_replace("'", "\'", $package->getName())."');\n");
                $file->write("if (!defined('PACKAGE_VERSION')) define('PACKAGE_VERSION', '".$package->packageVersion."');\n");
                
                // write end
-               $file->write("?>");
                $file->close();
        }
        
index ee8f057392b1792bcdaeba4de4b6dfdb182111e5..e832b9b56f3eac73a606df1c4e25d4371c84fa99 100644 (file)
@@ -193,7 +193,7 @@ class WCFSetup extends WCF {
                self::$tplObj = SetupTemplateEngine::getInstance();
                self::getTPL()->setLanguageID((self::$selectedLanguageCode == 'en' ? 0 : 1));
                self::getTPL()->setCompileDir(TMP_DIR);
-               self::getTPL()->addTemplatePath(PACKAGE_ID, TMP_DIR);
+               self::getTPL()->addApplication('wcf', PACKAGE_ID, TMP_DIR);
                self::getTPL()->registerPrefilter(array('lang'));
                self::getTPL()->assign(array(
                        '__wcf' => $this,
index 83fb9531d39a12e1c94dbdd3da6928644861920f..868a7cd9fd909da07f1a35da60d7d338fdcde230 100644 (file)
@@ -42,7 +42,7 @@ class SetupTemplateEngine extends TemplateEngine {
        /**
         * @see wcf\system\template\TemplateEngine::getPackageID()
         */
-       public function getPackageID($templateName, $packageID) {
+       public function getPackageID($templateName, $application = 'wcf') {
                $path = $this->templatePaths[PACKAGE_ID].'setup/template/'.$templateName.'.tpl';
                if (file_exists($path)) {
                        return PACKAGE_ID;