From: Tim Düsterhus Date: Tue, 2 Aug 2016 16:58:32 +0000 (+0200) Subject: Improve WCFSETUP_USEDEFAULTWCFDIR X-Git-Tag: 3.0.0_Beta_1~820 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4058d03294791d9980c7c7b9839894e3558bff89;p=GitHub%2FWoltLab%2FWCF.git Improve WCFSETUP_USEDEFAULTWCFDIR --- diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 9787bdc052..32e17b42bd 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -134,11 +134,6 @@ class WCFSetup extends WCF { * @since 3.0 */ protected static function getInstallationDirectories() { - if (self::$developerMode && isset($_ENV['WCFSETUP_USEDEFAULTWCFDIR'])) { - if (!isset($_REQUEST['directories']) || !is_array($_REQUEST['directories'])) $_REQUEST['directories'] = []; - $_REQUEST['directories']['wcf'] = FileUtil::unifyDirSeparator(INSTALL_SCRIPT_DIR).'wcf/'; - } - if (!empty($_REQUEST['directories']) && is_array($_REQUEST['directories'])) { foreach ($_REQUEST['directories'] as $application => $directory) { self::$directories[$application] = $directory; @@ -251,13 +246,10 @@ class WCFSetup extends WCF { break; } - /** @noinspection PhpMissingBreakStatementInspection */ case 'configureDirectories': - if (!self::$developerMode || !isset($_ENV['WCFSETUP_USEDEFAULTWCFDIR'])) { - $this->calcProgress(3); - $this->configureDirectories(); - break; - } + $this->calcProgress(3); + $this->configureDirectories(); + break; case 'unzipFiles': $this->calcProgress(4); @@ -461,6 +453,14 @@ class WCFSetup extends WCF { if ($application !== 'wcf') $showOrder[] = $application; } + if (self::$developerMode && isset($_ENV['WCFSETUP_USEDEFAULTWCFDIR'])) { + // resolve path relative to document root + $relativePath = FileUtil::getRelativePath($_SERVER['DOCUMENT_ROOT'], INSTALL_SCRIPT_DIR); + foreach ($packages as $application => $packageData) { + self::$directories[$application] = $relativePath . ($application === 'wcf' ? '' : $packageData['directory'] . '/'); + } + } + $documentRoot = FileUtil::unifyDirSeparator($_SERVER['DOCUMENT_ROOT']); $errors = []; if (!empty(self::$directories)) {