Allow to choose default WCF dir via env in WCFSetup
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 7 Aug 2015 23:36:45 +0000 (01:36 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 7 Aug 2015 23:36:45 +0000 (01:36 +0200)
wcfsetup/install/files/lib/system/WCFSetup.class.php

index 598850a8b711b69e6ba78c6aea3ccd581a3948b7..b3e7ade098cc8812b25613a56017acba7c2b674c 100644 (file)
@@ -161,6 +161,10 @@ class WCFSetup extends WCF {
         * Gets the selected wcf dir from request.
         */
        protected static function getWCFDir() {
+               if (self::$developerMode && isset($_ENV['WCFSETUP_USEDEFAULTWCFDIR'])) {
+                       $_REQUEST['wcfDir'] = FileUtil::unifyDirSeparator(INSTALL_SCRIPT_DIR).'wcf/';
+               }
+               
                if (isset($_REQUEST['wcfDir']) && $_REQUEST['wcfDir'] != '') {
                        self::$wcfDir = FileUtil::addTrailingSlash(FileUtil::unifyDirSeparator($_REQUEST['wcfDir']));
                        if (@file_exists(self::$wcfDir)) {
@@ -274,9 +278,11 @@ class WCFSetup extends WCF {
                                }
                        
                        case 'searchWcfDir':
-                               $this->calcProgress(3);
-                               $this->searchWcfDir();
-                       break;
+                               if (!self::$developerMode || !isset($_ENV['WCFSETUP_USEDEFAULTWCFDIR'])) {
+                                       $this->calcProgress(3);
+                                       $this->searchWcfDir();
+                                       break;
+                               }
                        
                        case 'unzipFiles':
                                $this->calcProgress(4);