From 8f8d8a38e7555d548a0b60d7ed08c399d0b02504 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 11 Aug 2013 14:40:18 +0200 Subject: [PATCH] Added support for application-specific classes during installation --- wcfsetup/install/files/lib/system/WCF.class.php | 16 ++++++++++++++++ .../FilePackageInstallationPlugin.class.php | 3 +++ 2 files changed, 19 insertions(+) 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 -- 2.20.1