Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
4 changes: 4 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="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 Expand Up @@ -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"
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 storage method where debug information will be store (or not).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to stored

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

*
* @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;
}
}
14 changes: 14 additions & 0 deletions plugins/system/debug/debug.xml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,20 @@
<option value="1">JYES</option>
</field>
</fieldset>
<fieldset
name="storage"
label="PLG_DEBUG_STORAGE_FIELDSET_LABEL"
>
<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>
</fieldset>
</fields>
</config>
</extension>