More backwards compatibility

This commit is contained in:
Andy Miller
2019-04-11 16:29:55 -06:00
parent 02064117bc
commit d99c80eae9
2 changed files with 26 additions and 6 deletions

View File

@@ -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);
}
}

View File

@@ -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;