From fa89ee8568009f6a30d0cabebdc45b2458383b86 Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Fri, 14 Sep 2018 23:37:42 -0500 Subject: [PATCH 1/6] Add option to select debug information storage method --- .../language/en-GB/en-GB.plg_system_debug.ini | 4 +++ plugins/system/debug/debug.php | 25 ++++++++++++++++++- plugins/system/debug/debug.xml | 14 +++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.plg_system_debug.ini b/administrator/language/en-GB/en-GB.plg_system_debug.ini index d287b3e8cb955..1a31d2dbd17c0 100644 --- a/administrator/language/en-GB/en-GB.plg_system_debug.ini +++ b/administrator/language/en-GB/en-GB.plg_system_debug.ini @@ -43,6 +43,9 @@ PLG_DEBUG_FIELD_REFRESH_ASSETS_DESC="If enabled will, on each page reload, add a PLG_DEBUG_FIELD_REFRESH_ASSETS_LABEL="Refresh Assets" PLG_DEBUG_FIELD_REQUEST_LABEL="Request" PLG_DEBUG_FIELD_SESSION_LABEL="Session Data" +PLG_DEBUG_FIELD_STORAGE_FILE="File" +PLG_DEBUG_FIELD_STORAGE_LABEL="Storage" +PLG_DEBUG_FIELD_STORAGE_NONE="None" PLG_DEBUG_FIELD_STRIP_FIRST_LABEL="Strip First Word" PLG_DEBUG_FIELD_STRIP_PREFIX_DESC="Strip words from the beginning of the string. For multiple words, use the format: (word1|word2)." PLG_DEBUG_FIELD_STRIP_PREFIX_LABEL="Strip From Start" @@ -81,6 +84,7 @@ PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES="%2$d × %1$s" PLG_DEBUG_ROWS_RETURNED_BY_QUERY="Rows returned: %s" PLG_DEBUG_SELECT_QUERIES="SELECT Tables:" PLG_DEBUG_SESSION="Session" +PLG_DEBUG_STORAGE_FIELDSET_LABEL="Storage" PLG_DEBUG_TIME="Time" PLG_DEBUG_TITLE="Joomla! Debug Console" PLG_DEBUG_UNKNOWN_FILE="Unknown file" diff --git a/plugins/system/debug/debug.php b/plugins/system/debug/debug.php index 8d0db947235bd..0b074d2be61e8 100644 --- a/plugins/system/debug/debug.php +++ b/plugins/system/debug/debug.php @@ -161,7 +161,8 @@ public function __construct(&$subject, $config) $this->db->setMonitor($this->queryMonitor); $this->debugBar = new DebugBar; - $this->debugBar->setStorage(new FileStorage($this->app->get('tmp_path'))); + + $this->setupStorage(); $this->setupLogging(); } @@ -600,4 +601,26 @@ private function collectLogs(): self return $this; } + + /** + * Setup the storage method where debug information will be store (or not). + * + * @return $this + * + * @since __DEPLOY_VERSION__ + */ + private function setupStorage(): self + { + switch ($this->params->get('storage_type')) + { + case 'none': + // No storage + break; + case 'file': + $this->debugBar->setStorage(new FileStorage($this->app->get('tmp_path'))); + break; + } + + return $this; + } } diff --git a/plugins/system/debug/debug.xml b/plugins/system/debug/debug.xml index d95cffe631115..50c91407f014f 100644 --- a/plugins/system/debug/debug.xml +++ b/plugins/system/debug/debug.xml @@ -286,6 +286,20 @@ +
+ + + + +
From a379be93af35952931f26c25ddc38e1e0f14ecd7 Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Mon, 17 Sep 2018 09:38:49 -0500 Subject: [PATCH 2/6] Unify tabs --- administrator/language/en-GB/en-GB.plg_system_debug.ini | 1 - plugins/system/debug/debug.xml | 5 ----- 2 files changed, 6 deletions(-) diff --git a/administrator/language/en-GB/en-GB.plg_system_debug.ini b/administrator/language/en-GB/en-GB.plg_system_debug.ini index 1a31d2dbd17c0..183d35ff2eb9e 100644 --- a/administrator/language/en-GB/en-GB.plg_system_debug.ini +++ b/administrator/language/en-GB/en-GB.plg_system_debug.ini @@ -84,7 +84,6 @@ PLG_DEBUG_QUERY_TYPE_AND_OCCURRENCES="%2$d × %1$s" PLG_DEBUG_ROWS_RETURNED_BY_QUERY="Rows returned: %s" PLG_DEBUG_SELECT_QUERIES="SELECT Tables:" PLG_DEBUG_SESSION="Session" -PLG_DEBUG_STORAGE_FIELDSET_LABEL="Storage" PLG_DEBUG_TIME="Time" PLG_DEBUG_TITLE="Joomla! Debug Console" PLG_DEBUG_UNKNOWN_FILE="Unknown file" diff --git a/plugins/system/debug/debug.xml b/plugins/system/debug/debug.xml index 50c91407f014f..a82a8722933d7 100644 --- a/plugins/system/debug/debug.xml +++ b/plugins/system/debug/debug.xml @@ -285,11 +285,6 @@ - -
Date: Mon, 17 Sep 2018 10:09:28 -0500 Subject: [PATCH 3/6] Change wording - thanks @Quy --- plugins/system/debug/debug.php | 2 +- templates/system/build_incomplete.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/system/debug/debug.php b/plugins/system/debug/debug.php index 0b074d2be61e8..8a559a1d18a29 100644 --- a/plugins/system/debug/debug.php +++ b/plugins/system/debug/debug.php @@ -603,7 +603,7 @@ private function collectLogs(): self } /** - * Setup the storage method where debug information will be store (or not). + * Setup the way debug information will be stored (or not). * * @return $this * diff --git a/templates/system/build_incomplete.html b/templates/system/build_incomplete.html index 9f819b15d49e0..876eddf340687 100644 --- a/templates/system/build_incomplete.html +++ b/templates/system/build_incomplete.html @@ -6,7 +6,7 @@ Joomla: Environment Setup Incomplete - +
From 5190b3bfd7f48fbb979fd76e6320fbd2e97070bc Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Mon, 17 Sep 2018 10:23:43 -0500 Subject: [PATCH 4/6] Move storage option to general tab. --- plugins/system/debug/debug.xml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/plugins/system/debug/debug.xml b/plugins/system/debug/debug.xml index a82a8722933d7..b7ff839ddb948 100644 --- a/plugins/system/debug/debug.xml +++ b/plugins/system/debug/debug.xml @@ -40,6 +40,16 @@ size="10" /> + + + + + JNO - - - -
From b4257406f11cd9362ba429bde1788f28765f817f Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Mon, 17 Sep 2018 18:56:13 -0500 Subject: [PATCH 5/6] Blame npm or PHPStorm but not @elkuku :P --- templates/system/build_incomplete.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/system/build_incomplete.html b/templates/system/build_incomplete.html index 876eddf340687..9f819b15d49e0 100644 --- a/templates/system/build_incomplete.html +++ b/templates/system/build_incomplete.html @@ -6,7 +6,7 @@ Joomla: Environment Setup Incomplete - +
From b40d20ec59a2c15da05496277e81940f94fe8166 Mon Sep 17 00:00:00 2001 From: Nikolai Plath Date: Tue, 18 Sep 2018 08:24:17 -0500 Subject: [PATCH 6/6] Change the wording --- administrator/language/en-GB/en-GB.plg_system_debug.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/language/en-GB/en-GB.plg_system_debug.ini b/administrator/language/en-GB/en-GB.plg_system_debug.ini index 183d35ff2eb9e..4aa1d5169b08b 100644 --- a/administrator/language/en-GB/en-GB.plg_system_debug.ini +++ b/administrator/language/en-GB/en-GB.plg_system_debug.ini @@ -44,7 +44,7 @@ PLG_DEBUG_FIELD_REFRESH_ASSETS_LABEL="Refresh Assets" PLG_DEBUG_FIELD_REQUEST_LABEL="Request" PLG_DEBUG_FIELD_SESSION_LABEL="Session Data" PLG_DEBUG_FIELD_STORAGE_FILE="File" -PLG_DEBUG_FIELD_STORAGE_LABEL="Storage" +PLG_DEBUG_FIELD_STORAGE_LABEL="Collected Data Storage" PLG_DEBUG_FIELD_STORAGE_NONE="None" PLG_DEBUG_FIELD_STRIP_FIRST_LABEL="Strip First Word" PLG_DEBUG_FIELD_STRIP_PREFIX_DESC="Strip words from the beginning of the string. For multiple words, use the format: (word1|word2)."