From d43bb3f0dda38c3986c2bd40bddf120d8d86c9ce Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 9 Oct 2013 01:09:33 +0200 Subject: [PATCH] Enabled debug mode if installed with dev=1 --- wcfsetup/install/files/lib/system/WCFSetup.class.php | 1 + .../package/PackageInstallationDispatcher.class.php | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/wcfsetup/install/files/lib/system/WCFSetup.class.php b/wcfsetup/install/files/lib/system/WCFSetup.class.php index 3ec5a6ef77..35ed7fc37e 100644 --- a/wcfsetup/install/files/lib/system/WCFSetup.class.php +++ b/wcfsetup/install/files/lib/system/WCFSetup.class.php @@ -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'); diff --git a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php index 0a592d0749..7f03f5e4f3 100644 --- a/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php +++ b/wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php @@ -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 -- 2.20.1