mirror of
https://github.com/getgrav/grav.git
synced 2026-03-05 12:01:37 +01:00
[Refactoring] removed debugger als callback parameter in measureTime as it is already injected in the container
This commit is contained in:
@@ -118,8 +118,8 @@ class Grav extends Container
|
||||
// process all processors (e.g. config, initialize, assets, ..., render)
|
||||
foreach ($this->processors as $processor) {
|
||||
$processor = $this[$processor];
|
||||
$this->measureTime($processor->id, $processor->title, function($debugger) use ($processor) {
|
||||
$processor->process($debugger);
|
||||
$this->measureTime($processor->id, $processor->title, function() use ($processor) {
|
||||
$processor->process();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ class Grav extends Container
|
||||
// then to get it from the container all time.
|
||||
$container->measureTime = function($timerId, $timerTitle, $callback) use ($debugger) {
|
||||
$debugger->startTimer($timerId, $timerTitle);
|
||||
$callback($debugger);
|
||||
$callback();
|
||||
$debugger->stopTimer($timerId);
|
||||
};
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class AssetsProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'assets';
|
||||
public $title = 'Assets';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['assets']->init();
|
||||
$this->container->fireEvent('onAssetsInitialized');
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class ConfigurationProcessor extends ProcessorBase implements ProcessorInterface
|
||||
public $id = '_config';
|
||||
public $title = 'Configuration';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['config']->init();
|
||||
return $this->container['plugins']->setup();
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ class DebuggerAssetsProcessor extends ProcessorBase implements ProcessorInterfac
|
||||
public $id = 'debugger_assets';
|
||||
public $title = 'Debugger Assets';
|
||||
|
||||
public function process($debugger) {
|
||||
$debugger->addAssets();
|
||||
public function process() {
|
||||
$this->container['debugger']->addAssets();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ class DebuggerInitProcessor extends ProcessorBase implements ProcessorInterface
|
||||
public $id = '_debugger';
|
||||
public $title = 'Init Debugger';
|
||||
|
||||
public function process($debugger) {
|
||||
$debugger->init();
|
||||
public function process() {
|
||||
$this->container['debugger']->init();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class ErrorsProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = '_errors';
|
||||
public $title = 'Error Handlers Reset';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['errors']->resetHandlers();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class InitializeProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'init';
|
||||
public $title = 'Initialize';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['config']->debug();
|
||||
|
||||
// Use output buffering to prevent headers from being sent too early.
|
||||
|
||||
@@ -6,7 +6,7 @@ class PagesProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'pages';
|
||||
public $title = 'Pages';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['pages']->init();
|
||||
$this->container->fireEvent('onPagesInitialized');
|
||||
$this->container->fireEvent('onPageInitialized');
|
||||
|
||||
@@ -6,7 +6,7 @@ class PluginsProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'plugins';
|
||||
public $title = 'Plugins';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['plugins']->init();
|
||||
$this->container->fireEvent('onPluginsInitialized');
|
||||
}
|
||||
|
||||
@@ -6,5 +6,5 @@ class ProcessorBase {
|
||||
public function __construct($container) {
|
||||
$this->container = $container;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
namespace Grav\Common\Processors;
|
||||
|
||||
interface ProcessorInterface {
|
||||
public function process($debugger);
|
||||
public function process();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class RenderProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'render';
|
||||
public $title = 'Render';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container->output = $this->container['output'];
|
||||
$this->container->fireEvent('onOutputGenerated');
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class SiteSetupProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = '_setup';
|
||||
public $title = 'Site Setup';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['setup']->init();
|
||||
$this->container['streams'];
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ class TasksProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'tasks';
|
||||
public $title = 'Tasks';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$task = $this->container['task'];
|
||||
if ($task) {
|
||||
$this->container->fireEvent('onTask.' . $task);
|
||||
|
||||
@@ -6,7 +6,7 @@ class ThemesProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'themes';
|
||||
public $title = 'Themes';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['themes']->init();
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class TwigProcessor extends ProcessorBase implements ProcessorInterface {
|
||||
public $id = 'twig';
|
||||
public $title = 'Twig';
|
||||
|
||||
public function process($debugger) {
|
||||
public function process() {
|
||||
$this->container['twig']->init();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user