Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions administrator/language/en-GB/en-GB.plg_system_debug.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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="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)."
PLG_DEBUG_FIELD_STRIP_PREFIX_LABEL="Strip From Start"
Expand Down
25 changes: 24 additions & 1 deletion plugins/system/debug/debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -600,4 +601,26 @@ private function collectLogs(): self

return $this;
}

/**
* Setup the way debug information will be stored (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;
}
}
10 changes: 10 additions & 0 deletions plugins/system/debug/debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
size="10"
/>

<field
name="storage_type"
type="list"
label="PLG_DEBUG_FIELD_STORAGE_LABEL"
default="none"
>
<option value="none">PLG_DEBUG_FIELD_STORAGE_NONE</option>
<option value="file">PLG_DEBUG_FIELD_STORAGE_FILE</option>
</field>

<field
name="memory"
type="radio"
Expand Down