Page MenuHomePhorge

D5469.1775212130.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D5469.1775212130.diff

diff --git a/plugins/kolab/Kolab/Configuration.php b/plugins/kolab/Kolab/Configuration.php
--- a/plugins/kolab/Kolab/Configuration.php
+++ b/plugins/kolab/Kolab/Configuration.php
@@ -72,6 +72,10 @@
}
break;
+ case 'debug':
+ $this->setDebug($value);
+ break;
+
default:
if ($mode == 'merge') {
$orig_setting = $this->rc->config->get($key);
@@ -86,6 +90,51 @@
}
}
+ /**
+ * Enable debug logging for the current user
+ */
+ private function setDebug($mode = ''): void
+ {
+ if (!$mode) {
+ return;
+ }
+
+ if (defined('KOLAB_SYNC_START') && !str_contains($mode, 'syncroton')) {
+ return;
+ }
+
+ if (defined('RCMAIL_VERSION') && !str_contains($mode, 'roundcube')) {
+ return;
+ }
+
+ if (defined('FILE_API_START') && !str_contains($mode, 'chwala')) {
+ return;
+ }
+
+ $opts = [
+ 'activesync_debug',
+ 'dav_debug',
+ 'imap_debug',
+ 'kolab_debug',
+ 'ldap_debug',
+ 'oauth_debug',
+ 'redis_debug',
+ 'smtp_debug',
+ 'sql_debug',
+ 'performance_stats',
+ ];
+
+ foreach ($opts as $key) {
+ $this->rc->config->set($key, true);
+ }
+
+ // SQL debug need to be set directly on DB object. Setting config variable will not work here
+ // because the object is already initialized/configured
+ if ($db = $this->rc->get_dbh()) {
+ $db->set_debug(true);
+ }
+ }
+
/**
* Startup hook handler
*/

File Metadata

Mime Type
text/plain
Expires
Fri, Apr 3, 10:28 AM (2 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18823655
Default Alt Text
D5469.1775212130.diff (1 KB)

Event Timeline