mirror of
https://github.com/getgrav/grav.git
synced 2026-03-03 19:11:35 +01:00
More backwards compatibility
This commit is contained in:
@@ -21,15 +21,17 @@ class DebuggerAssetsProcessor extends ProcessorBase
|
||||
|
||||
public function process(ServerRequestInterface $request = null, RequestHandlerInterface $handler = null) : ResponseInterface
|
||||
{
|
||||
// Backwards compatibility
|
||||
if (is_null($request) && is_null($handler)) {
|
||||
$this->container['debugger']->addAssets();
|
||||
return new Response();
|
||||
}
|
||||
|
||||
$this->startTimer();
|
||||
$this->container['debugger']->addAssets();
|
||||
$this->stopTimer();
|
||||
|
||||
// Backwards compatibility
|
||||
if ($request && $handler) {
|
||||
return $handler->handle($request);
|
||||
} else {
|
||||
return new Response();
|
||||
}
|
||||
return $handler->handle($request);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,6 +22,24 @@ class RenderProcessor extends ProcessorBase
|
||||
|
||||
public function process(ServerRequestInterface $request = null, RequestHandlerInterface $handler = null) : ResponseInterface
|
||||
{
|
||||
// Backwards compatibility
|
||||
if (is_null($request) && is_null($handler)) {
|
||||
$container = $this->container;
|
||||
$output = $container['output'];
|
||||
|
||||
$container->output = $output;
|
||||
$container->fireEvent('onOutputGenerated');
|
||||
|
||||
// Set the header type
|
||||
$container->header();
|
||||
echo $container->output;
|
||||
|
||||
// remove any output
|
||||
$container->output = '';
|
||||
$this->container->fireEvent('onOutputRendered');
|
||||
return new Response();
|
||||
}
|
||||
|
||||
$this->startTimer();
|
||||
|
||||
$container = $this->container;
|
||||
|
||||
Reference in New Issue
Block a user