From 4261bdafff6361fdd391cfdac1de2caa57f44b4a Mon Sep 17 00:00:00 2001 From: the-djmaze <> Date: Fri, 30 Dec 2022 12:18:07 +0100 Subject: [PATCH] Moved application.ini labs.use_app_debug_* to debug.* --- .../0.0.0/app/libraries/RainLoop/Actions.php | 2 +- .../libraries/RainLoop/Config/Application.php | 23 +++++++++++++------ .../0.0.0/app/libraries/RainLoop/Service.php | 4 ++-- .../app/libraries/RainLoop/ServiceActions.php | 4 ++-- 4 files changed, 21 insertions(+), 12 deletions(-) diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php index a7c6ed6bb..4e8ff4d76 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -879,7 +879,7 @@ class Actions ? './?/Plugins/0/' . ($bAdmin ? 'Admin' : 'User') . '/' . $sStaticCache . '/' : ''; - $bAppJsDebug = $this->oConfig->Get('labs', 'use_app_debug_js', false) + $bAppJsDebug = $this->oConfig->Get('debug', 'javascript', false) || $this->oConfig->Get('debug', 'enable', false); $aResult['StaticLibsJs'] = Utils::WebStaticPath('js/' . ($bAppJsDebug ? '' : 'min/') . diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php index e10b355cf..dff3e2760 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Config/Application.php @@ -91,10 +91,17 @@ class Application extends \RainLoop\Config\AbstractConfig public function Set(string $sSectionKey, string $sParamKey, $mParamValue) : void { - if ('labs' === $sSectionKey && \str_contains($sParamKey, 'imap_')) { - // This is a workaround for the changed application structure - $sSectionKey = 'imap'; - $sParamKey = \str_replace('imap_', '', $sParamKey); + // Workarounds for the changed application structure + if ('labs' === $sSectionKey) { + if (\str_contains($sParamKey, 'imap_')) { + $sSectionKey = 'imap'; + $sParamKey = \str_replace('imap_', '', $sParamKey); + } + if (\str_contains($sParamKey, 'use_app_debug_')) { + $sSectionKey = 'debug'; + $sParamKey = \str_replace('use_app_debug_js', 'javascript', $sParamKey); + $sParamKey = \str_replace('use_app_debug_css', 'css', $sParamKey); + } } parent::Set($sSectionKey, $sParamKey, $mParamValue); } @@ -336,7 +343,11 @@ Examples: ), 'debug' => array( - 'enable' => array(false, 'Special option required for development purposes') + 'enable' => array(false, 'Special option required for development purposes'), + // use_app_debug_js + 'javascript' => array(false), + // use_app_debug_css + 'css' => array(false) ), 'cache' => array( @@ -376,8 +387,6 @@ Enables caching in the system'), 'allow_html_editor_biti_buttons' => array(false), 'allow_ctrl_enter_on_compose' => array(true), 'try_to_detect_hidden_images' => array(false), - 'use_app_debug_js' => array(false), - 'use_app_debug_css' => array(false), 'smtp_show_server_errors' => array(false), 'sieve_auth_plain_initial' => array(true), 'sieve_allow_fileinto_inbox' => array(false), diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php b/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php index ef0b971a2..8587df8ae 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/Service.php @@ -140,8 +140,8 @@ abstract class Service $sLanguage = $oActions->GetLanguage($bAdmin); $bAppDebug = $oConfig->Get('debug', 'enable', false); - $sAppJsMin = $bAppDebug || $oConfig->Get('labs', 'use_app_debug_js', false) ? '' : '.min'; - $sAppCssMin = $bAppDebug || $oConfig->Get('labs', 'use_app_debug_css', false) ? '' : '.min'; + $sAppJsMin = $bAppDebug || $oConfig->Get('debug', 'javascript', false) ? '' : '.min'; + $sAppCssMin = $bAppDebug || $oConfig->Get('debug', 'css', false) ? '' : '.min'; $sFaviconUrl = (string) $oConfig->Get('webmail', 'favicon_url', ''); diff --git a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php index 5d4fadef0..791eef688 100644 --- a/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php +++ b/snappymail/v/0.0.0/app/libraries/RainLoop/ServiceActions.php @@ -455,7 +455,7 @@ class ServiceActions \header('Content-Type: application/javascript; charset=utf-8'); $bAppDebug = $this->Config()->Get('debug', 'enable', false); - $sMinify = ($bAppDebug || $this->Config()->Get('labs', 'use_app_debug_js', false)) ? '' : 'min'; + $sMinify = ($bAppDebug || $this->Config()->Get('debug', 'javascript', false)) ? '' : 'min'; $bCacheEnabled = !$bAppDebug && $this->Config()->Get('labs', 'cache_system_data', true); if ($bCacheEnabled) { @@ -499,7 +499,7 @@ class ServiceActions $sTheme = $this->oActions->ValidateTheme($this->aPaths[4]); $bAppDebug = $this->Config()->Get('debug', 'enable', false); - $sMinify = ($bAppDebug || $this->Config()->Get('labs', 'use_app_debug_css', false)) ? '' : 'min'; + $sMinify = ($bAppDebug || $this->Config()->Get('debug', 'css', false)) ? '' : 'min'; $bCacheEnabled = !$bAppDebug && $this->Config()->Get('labs', 'cache_system_data', true); if ($bCacheEnabled) {