Added support for application-specific classes during installation
authorAlexander Ebert <ebert@woltlab.com>
Sun, 11 Aug 2013 12:40:18 +0000 (14:40 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 11 Aug 2013 12:40:18 +0000 (14:40 +0200)
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php

index 0c712f607b5762f07ade1c6f729b427f7542ac0f..171ce563e14c41db692b7b36f759db2a44be29ba 100644 (file)
@@ -504,6 +504,22 @@ class WCF {
                return $applicationObject;
        }
        
+       /**
+        * Loads an application on runtime, do not use this outside the package installation.
+        * 
+        * @param       integer         $packageID
+        */
+       public static function loadRuntimeApplication($packageID) {
+               $package = new Package($packageID);
+               $application = new Application($packageID);
+               
+               $abbreviation = Package::getAbbreviation($package->package);
+               $packageDir = FileUtil::getRealPath(WCF_DIR.$package->packageDir);
+               self::$autoloadDirectories[$abbreviation] = $packageDir . 'lib/';
+               self::$applications[$abbreviation] = $application;
+               self::getTPL()->addApplication($abbreviation, $packageDir . 'acp/templates/');
+       }
+       
        /**
         * Initializes core object cache.
         */
index 923121359495efec46c367bb738ee204b4b3c832..0ca381a307db8dcf6f9315ec61a0f90faf2a7c57 100644 (file)
@@ -67,6 +67,9 @@ class FilePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                                'config.inc.php',
                                Package::getAbbreviation($this->installation->getPackage()->package)
                        ));
+                       
+                       // load application
+                       WCF::loadRuntimeApplication($this->installation->getPackageID());
                }
                
                // delete temporary sourceArchive