Provide application directory presets via the configuration file
authorAlexander Ebert <ebert@woltlab.com>
Sat, 14 Mar 2020 18:11:18 +0000 (19:11 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 14 Mar 2020 18:11:18 +0000 (19:11 +0100)
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 9371424a765bbf444451cb70811c10064069cb7d..ae1024bb905e1ce7f75e4d326fc7355f212a343f 100644 (file)
@@ -852,9 +852,12 @@ class PackageInstallationDispatcher {
        protected function promptPackageDir($applicationDirectory) {
                // check for pre-defined directories originating from WCFSetup
                $directory = WCF::getSession()->getVar('__wcfSetup_directories');
+               $abbreviation = Package::getAbbreviation($this->getPackage()->package);
                if ($directory !== null) {
-                       $abbreviation = Package::getAbbreviation($this->getPackage()->package);
-                       $directory = isset($directory[$abbreviation]) ? $directory[$abbreviation] : null;
+                       $directory = $directory[$abbreviation] ?? null;
+               }
+               else if (ENABLE_ENTERPRISE_MODE && defined('ENTERPRISE_MODE_APP_DIRECTORIES') && is_array(ENTERPRISE_MODE_APP_DIRECTORIES)) {
+                       $directory = ENTERPRISE_MODE_APP_DIRECTORIES[$abbreviation] ?? null; 
                }
                
                if ($directory === null && !PackageInstallationFormManager::findForm($this->queue, 'packageDir')) {