Enabled debug mode if installed with dev=1
authorAlexander Ebert <ebert@woltlab.com>
Tue, 8 Oct 2013 23:09:33 +0000 (01:09 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 8 Oct 2013 23:09:33 +0000 (01:09 +0200)
wcfsetup/install/files/lib/system/WCFSetup.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php

index 3ec5a6ef77b27f2f2fb6795d4ce0f9b25a0faba2..35ed7fc37e31c0df16698a4c8af430dcb9fcb6c9 100644 (file)
@@ -1169,6 +1169,7 @@ class WCFSetup extends WCF {
                
                SessionHandler::getInstance()->changeUser($admin);
                SessionHandler::getInstance()->register('masterPassword', 1);
+               SessionHandler::getInstance()->register('__wcfSetup_developerMode', (self::debugModeIsEnabled() ? 1 : 0));
                SessionHandler::getInstance()->update();
                
                $installPhpDeleted = @unlink('./install.php');
index 0a592d07497821d384992469f3de9f8a748664a6..7f03f5e4f3f76736107fa3dd9451e66b47f555ba 100644 (file)
@@ -179,6 +179,17 @@ class PackageInstallationDispatcher {
                                // remove all cache files after WCFSetup
                                if (!PACKAGE_ID) {
                                        CacheHandler::getInstance()->flushAll();
+                                       
+                                       if (WCF::getSession()->getVar('__wcfSetup_developerMode')) {
+                                               $sql = "UPDATE  wcf".WCF_N."_option
+                                                       SET     optionValue = ?
+                                                       WHERE   optionName = ?";
+                                               $statement = WCF::getDB()->prepareStatement($sql);
+                                               $statement->execute(array(
+                                                       1,
+                                                       'enable_debug_mode'
+                                               ));
+                                       }
                                }
                                
                                // rebuild application paths