From: Alexander Ebert Date: Sun, 11 Aug 2013 12:40:18 +0000 (+0200) Subject: Added support for application-specific classes during installation X-Git-Tag: 2.0.0_Beta_7~31^2~4 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8f8d8a38e7555d548a0b60d7ed08c399d0b02504;p=GitHub%2FWoltLab%2FWCF.git Added support for application-specific classes during installation --- diff --git a/wcfsetup/install/files/lib/system/WCF.class.php b/wcfsetup/install/files/lib/system/WCF.class.php index 0c712f607b..171ce563e1 100644 --- a/wcfsetup/install/files/lib/system/WCF.class.php +++ b/wcfsetup/install/files/lib/system/WCF.class.php @@ -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. */ diff --git a/wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php b/wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php index 9231213594..0ca381a307 100644 --- a/wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php +++ b/wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php @@ -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