Skip to content

Commit

Permalink
Load document into application when debug is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
SharkyKZ committed Nov 27, 2019
1 parent 8cf9fa4 commit a6e6f50
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions plugins/system/cache/cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
defined('_JEXEC') or die;

use Joomla\CMS\Cache\Cache;
use Joomla\CMS\Factory;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Profiler\Profiler;
Expand Down Expand Up @@ -95,14 +96,13 @@ protected function getCacheKey()
}

/**
* After Initialise Event.
* Checks if URL exists in cache, if so dumps it directly and closes.
*
* @return void
*
* @since 1.5
* @since __DEPLOY_VERSION__
*/
public function onAfterInitialise()
public function onAfterRoute()
{
if ($this->app->isClient('administrator') || $this->app->get('offline', '0') || $this->app->getMessageQueue())
{
Expand Down Expand Up @@ -134,6 +134,10 @@ public function onAfterInitialise()
// Mark afterCache in debug and run debug onAfterRespond events, e.g. show Joomla Debug Console if debug is active.
if (JDEBUG)
{
// Create a document instance and load it into the application.
$document = Factory::getContainer()->get('document.factory')->createDocument($this->app->input->get('format', 'html'));
$this->app->loadDocument($document);

Profiler::getInstance('Application')->mark('afterCache');
$this->app->triggerEvent('onAfterRespond');
}
Expand Down

0 comments on commit a6e6f50

Please sign in to comment.