/home/montophrs/public_html/user/plugins/flex-objects/flex-objects.php
* [onPagesInitialized:-10000] Default router for flex pages.
*
* @param Event $event
*/
public function onPagesInitialized(Event $event): void
{
/** @var PageInterface|null $page */
$page = $this->grav['page'] ?? null;
/** @var Route $route */
$route = $event['route'];
$base = '';
$path = [];
if (!$page->routable() || $page->template() === 'notfound') {
/** @var Pages $pages */
$pages = $this->grav['pages'];
// Find first existing and routable parent page.
$parts = explode('/', $route->getRoute());
array_shift($parts);
$page = null;
while (!$page && $parts) {
$path[] = array_pop($parts);
$base = '/' . implode('/', $parts);
$page = $pages->find($base);
if ($page && !$page->routable()) {
$page = null;
}
}
}
// If page is found, check if it contains flex directory router.
if ($page) {
$options = $page->header()->flex ?? null;
$router = $options['router'] ?? null;
if (\is_string($router)) {
$path = implode('/', array_reverse($path));
$flexEvent = new Event([
'flex' => $this->grav['flex'],
Arguments
"Call to a member function getRoute() on null"
/home/montophrs/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
// @deprecated: the ternary operator is part of a BC layer and should be removed in 5.0
$listener($listener instanceof WrappedListener ? new LegacyEventProxy($event) : $event, $eventName, $this);
}
}
/**
* @deprecated since Symfony 4.3, use callListeners() instead
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $listener) {
if ($event->isPropagationStopped()) {
break;
}
$listener($event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
*/
private function sortListeners(string $eventName)
{
krsort($this->listeners[$eventName]);
$this->sorted[$eventName] = [];
foreach ($this->listeners[$eventName] as &$listeners) {
foreach ($listeners as $k => &$listener) {
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure && 2 >= \count($listener)) {
$listener[0] = $listener[0]();
$listener[1] = $listener[1] ?? '__invoke';
}
$this->sorted[$eventName][] = $listener;
}
}
Arguments
RocketTheme\Toolbox\Event\Event {#266}
"onPagesInitialized"
Symfony\Component\EventDispatcher\EventDispatcher {#109
-listeners: array:48 [
"onPluginsInitialized" => array:7 [
100002 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#98}
1 => "autoload"
]
]
100001 => array:3 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "autoload"
]
1 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#97}
1 => "autoload"
]
2 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#98}
1 => "onPluginsInitialized"
]
]
100000 => array:2 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "setup"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "autoload"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "initializeSession"
]
]
1001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "onPluginsInitialized"
]
]
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "initializeLogin"
]
]
0 => array:4 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#92}
1 => "onPluginsInitialized"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onPluginsInitialized"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onPluginsInitialized"
]
3 => array:2 [
0 => Grav\Plugin\TinyMCEEditorPlugin {#99}
1 => "onPluginsInitialized"
]
]
]
"onRequestHandlerInit" => array:1 [
100000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "onRequestHandlerInit"
]
]
]
"onFormRegisterTypes" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "onFormRegisterTypes"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onFormRegisterTypes"
]
]
]
"onPageInitialized" => array:3 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "onPageInitialized"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "authorizePage"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onPageInitialized"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "authorizeLoginPage"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "authorizePage"
]
]
]
"onShutdown" => array:1 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "onShutdown"
]
]
]
"Grav\Events\PermissionsRegisterEvent" => array:2 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#89}
1 => "onRegisterPermissions"
]
]
100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onRegisterPermissions"
]
]
]
"onFormProcessed" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#92}
1 => "onFormProcessed"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onFormProcessed"
]
]
]
"onTwigTemplatePaths" => array:2 [
0 => array:4 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#92}
1 => "onTwigTemplatePaths"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onTwigTemplatePaths"
]
2 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onTwigTemplatePaths"
]
3 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onTwigTemplatePaths"
]
]
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#93}
1 => "onTwigTemplatePaths"
]
]
]
"onSchedulerInitialized" => array:1 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#92}
1 => "onSchedulerInitialized"
]
1 => array:2 [
0 => Grav\Common\Cache {#148}
1 => "onSchedulerInitialized"
]
2 => array:2 [
0 => Grav\Common\Backup\Backups {#184}
1 => "onSchedulerInitialized"
]
]
]
"onAdminSave" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#92}
1 => "onAdminSave"
]
1 => array:2 [
0 => Grav\Plugin\TinyMCEEditorPlugin {#99}
1 => "onAdminSave"
]
]
]
"onCliInitialize" => array:2 [
100000 => array:2 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#93}
1 => "autoload"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "autoload"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "initializeFlex"
]
]
]
"onPageNotFound" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#93}
1 => "onPageNotFound"
]
]
]
"onGetPageTemplates" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#93}
1 => "onGetPageTemplates"
]
]
]
"onDisplayErrorPage.404" => array:1 [
-1 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#93}
1 => "onDisplayErrorPage404"
]
]
]
"Grav\Events\PluginsLoadedEvent" => array:1 [
10 => array:2 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "initializeFlex"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onPluginsLoaded"
]
]
]
"Grav\Events\FlexRegisterEvent" => array:1 [
100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onRegisterFlex"
]
]
]
"onTwigExtensions" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onTwigExtensions"
]
]
]
"Grav\Events\SessionStartEvent" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onSessionStart"
]
]
]
"onTask.login.login" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onTask.login.twofa" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onTask.login.twofa_cancel" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onTask.login.forgot" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onTask.login.logout" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onTask.login.reset" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onTask.login.regenerate2FASecret" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onPageTask.login.invite" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "loginController"
]
]
]
"onPagesInitialized" => array:2 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "storeReferrerPage"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "pageVisibility"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onPagesInitialized"
]
]
-10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onPagesInitialized"
]
]
]
"onDisplayErrorPage.401" => array:1 [
-1 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onDisplayErrorPage401"
]
]
]
"onDisplayErrorPage.403" => array:1 [
-1 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onDisplayErrorPage403"
]
]
]
"onPageFallBackUrl" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "authorizeFallBackUrl"
]
]
]
"onTwigSiteVariables" => array:2 [
-100000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "onTwigSiteVariables"
]
]
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#97}
1 => "onTwigSiteVariables"
]
1 => array:2 [
0 => Grav\Plugin\TinyMCEEditorPlugin {#99}
1 => "onTwigSiteVariables"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onTwigVariables"
]
]
]
"onUserLoginAuthenticate" => array:5 [
10003 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginAuthenticateRateLimit"
]
]
10002 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginAuthenticateByRegistration"
]
]
10001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginAuthenticateByRememberMe"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginAuthenticateByEmail"
]
]
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginAuthenticate"
]
]
]
"onUserLoginAuthorize" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginAuthorize"
]
]
]
"onUserLoginFailure" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginGuest"
]
]
]
"onUserLoginGuest" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginGuest"
]
]
]
"onUserLogin" => array:2 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLoginResetRateLimit"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLogin"
]
]
]
"onUserLogout" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#96}
1 => "userLogout"
]
]
]
"onMarkdownInitialized" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#97}
1 => "onMarkdownInitialized"
]
]
]
"onAdminGenerateReports" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#98}
1 => "onAdminGenerateReports"
]
]
]
"onAdminCompilePresetSCSS" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#98}
1 => "onAdminCompilePresetSCSS"
]
]
]
"onPageContentProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\TinyMCEEditorPlugin {#99}
1 => "onPageContentProcessed"
]
]
]
"onFatalException" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#98}
1 => "onFatalException"
]
]
]
"onBeforeFlexFormInitialize" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onBeforeFlexFormInitialize"
]
]
]
"onPageTask" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#94}
1 => "onPageTask"
]
]
]
"onPageProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onPageProcessed"
]
]
]
"onTwigInitialized" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onTwigInitialized"
]
]
]
"onTwigPageVariables" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onTwigVariables"
]
]
]
"onFormValidationProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#95}
1 => "onFormValidationProcessed"
]
]
]
]
-sorted: []
-optimized: array:11 [
"Grav\Events\PluginsLoadedEvent" => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin::initializeFlex(): void {#115 …4}
1 => Grav\Plugin\LoginPlugin::onPluginsLoaded(): void {#122 …4}
]
"Grav\Events\SessionStartEvent" => array:1 [
0 => Grav\Plugin\LoginPlugin::onSessionStart(SessionStartEvent $event): void {#130 …4}
]
"onPluginsInitialized" => array:13 [
0 => Grav\Plugin\ProblemsPlugin::autoload(): ClassLoader {#134 …4}
1 => Grav\Plugin\AdminPlugin::autoload(): ClassLoader {#135 …4}
2 => Grav\Plugin\MarkdownNoticesPlugin::autoload() {#136 …3}
3 => Grav\Plugin\ProblemsPlugin::onPluginsInitialized(): void {#137 …4}
4 => Grav\Plugin\AdminPlugin::setup() {#138 …3}
5 => Grav\Plugin\FormPlugin::autoload() {#139 …3}
6 => Grav\Plugin\LoginPlugin::initializeSession(): void {#140 …4}
7 => Grav\Plugin\AdminPlugin::onPluginsInitialized() {#141 …3}
8 => Grav\Plugin\LoginPlugin::initializeLogin(): void {#142 …4}
9 => Grav\Plugin\EmailPlugin::onPluginsInitialized() {#143 …3}
10 => Grav\Plugin\FlexObjectsPlugin::onPluginsInitialized(): void {#144 …4}
11 => Grav\Plugin\FormPlugin::onPluginsInitialized(): void {#145 …4}
12 => Grav\Plugin\TinyMCEEditorPlugin::onPluginsInitialized() {#146 …3}
]
"onRequestHandlerInit" => array:1 [
0 => Grav\Plugin\AdminPlugin::onRequestHandlerInit(RequestHandlerEvent $event) {#174 …3}
]
"onSchedulerInitialized" => array:3 [
0 => Grav\Plugin\EmailPlugin::onSchedulerInitialized(Event $e) {#189 …3}
1 => Grav\Common\Cache::onSchedulerInitialized(Event $event) {#190 …3}
2 => Grav\Common\Backup\Backups::onSchedulerInitialized(Event $event) {#191 …3}
]
"onTwigTemplatePaths" => array:5 [
0 => Grav\Plugin\EmailPlugin::onTwigTemplatePaths() {#225 …3}
1 => Grav\Plugin\FormPlugin::onTwigTemplatePaths(): void {#226 …4}
2 => Grav\Plugin\LoginPlugin::onTwigTemplatePaths(): void {#227 …4}
3 => Grav\Plugin\FlexObjectsPlugin::onTwigTemplatePaths(): void {#228 …4}
4 => Grav\Plugin\ErrorPlugin::onTwigTemplatePaths(): void {#229 …4}
]
"onTwigInitialized" => array:1 [
0 => Grav\Plugin\FormPlugin::onTwigInitialized(): void {#241 …4}
]
"onTwigExtensions" => array:1 [
0 => Grav\Plugin\FormPlugin::onTwigExtensions(): void {#249 …4}
]
"onPagesInitialized" => array:4 [
0 => Grav\Plugin\LoginPlugin::storeReferrerPage(): void {#267 …4}
1 => Grav\Plugin\LoginPlugin::pageVisibility(Event $event): void {#268 …4}
2 => Grav\Plugin\FormPlugin::onPagesInitialized(): void {#269 …4}
3 => Grav\Plugin\FlexObjectsPlugin::onPagesInitialized(Event $event): void {#270 …4}
]
"onPageFallBackUrl" => array:1 [
0 => Grav\Plugin\LoginPlugin::authorizeFallBackUrl(): void {#272 …4}
]
"onFatalException" => array:1 [
0 => Grav\Plugin\ProblemsPlugin::onFatalException(): void {#173 …4}
]
]
}
/home/montophrs/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php
} else {
$this->removeListener($eventName, [$subscriber, \is_string($params) ? $params : $params[0]]);
}
}
}
/**
* Triggers the listeners of an event.
*
* This method can be overridden to add functionality that is executed
* for each listener.
*
* @param callable[] $listeners The event listeners
* @param string $eventName The name of the event to dispatch
* @param object $event The event object to pass to the event handlers/listeners
*/
protected function callListeners(iterable $listeners, string $eventName, $event)
{
if ($event instanceof Event) {
$this->doDispatch($listeners, $eventName, $event);
return;
}
$stoppable = $event instanceof ContractsEvent || $event instanceof StoppableEventInterface;
foreach ($listeners as $listener) {
if ($stoppable && $event->isPropagationStopped()) {
break;
}
// @deprecated: the ternary operator is part of a BC layer and should be removed in 5.0
$listener($listener instanceof WrappedListener ? new LegacyEventProxy($event) : $event, $eventName, $this);
}
}
/**
* @deprecated since Symfony 4.3, use callListeners() instead
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
Arguments
array:4 [
0 => Grav\Plugin\LoginPlugin::storeReferrerPage(): void {#267 …4}
1 => Grav\Plugin\LoginPlugin::pageVisibility(Event $event): void {#268 …4}
2 => Grav\Plugin\FormPlugin::onPagesInitialized(): void {#269 …4}
3 => Grav\Plugin\FlexObjectsPlugin::onPagesInitialized(Event $event): void {#270 …4}
]
"onPagesInitialized"
RocketTheme\Toolbox\Event\Event {#266}
/home/montophrs/public_html/vendor/symfony/event-dispatcher/EventDispatcher.php
if (\is_object($event)) {
$eventName = $eventName ?? \get_class($event);
} elseif (\is_string($event) && (null === $eventName || $eventName instanceof ContractsEvent || $eventName instanceof Event)) {
@trigger_error(sprintf('Calling the "%s::dispatch()" method with the event name as the first argument is deprecated since Symfony 4.3, pass it as the second argument and provide the event object as the first argument instead.', EventDispatcherInterface::class), \E_USER_DEPRECATED);
$swap = $event;
$event = $eventName ?? new Event();
$eventName = $swap;
} else {
throw new \TypeError(sprintf('Argument 1 passed to "%s::dispatch()" must be an object, "%s" given.', EventDispatcherInterface::class, \is_object($event) ? \get_class($event) : \gettype($event)));
}
if (null !== $this->optimized && null !== $eventName) {
$listeners = $this->optimized[$eventName] ?? (empty($this->listeners[$eventName]) ? [] : $this->optimizeListeners($eventName));
} else {
$listeners = $this->getListeners($eventName);
}
if ($listeners) {
$this->callListeners($listeners, $eventName, $event);
}
return $event;
}
/**
* {@inheritdoc}
*/
public function getListeners($eventName = null)
{
if (null !== $eventName) {
if (empty($this->listeners[$eventName])) {
return [];
}
if (!isset($this->sorted[$eventName])) {
$this->sortListeners($eventName);
}
return $this->sorted[$eventName];
Arguments
array:4 [
0 => Grav\Plugin\LoginPlugin::storeReferrerPage(): void {#267 …4}
1 => Grav\Plugin\LoginPlugin::pageVisibility(Event $event): void {#268 …4}
2 => Grav\Plugin\FormPlugin::onPagesInitialized(): void {#269 …4}
3 => Grav\Plugin\FlexObjectsPlugin::onPagesInitialized(Event $event): void {#270 …4}
]
"onPagesInitialized"
RocketTheme\Toolbox\Event\Event {#266}
/home/montophrs/public_html/system/src/Grav/Common/Grav.php
return $event;
}
/**
* Fires an event with optional parameters.
*
* @param string $eventName
* @param Event|null $event
* @return Event
*/
public function fireEvent($eventName, Event $event = null)
{
/** @var EventDispatcherInterface $events */
$events = $this['events'];
if (null === $event) {
$event = new Event();
}
$timestamp = microtime(true);
$events->dispatch($event, $eventName);
/** @var Debugger $debugger */
$debugger = $this['debugger'];
$debugger->addEvent($eventName, $event, $events, $timestamp);
return $event;
}
/**
* Set the final content length for the page and flush the buffer
*
* @return void
*/
public function shutdown(): void
{
// Prevent user abort allowing onShutdown event to run without interruptions.
if (function_exists('ignore_user_abort')) {
@ignore_user_abort(true);
}
Arguments
RocketTheme\Toolbox\Event\Event {#266}
"onPagesInitialized"
/home/montophrs/public_html/system/src/Grav/Common/Processors/PagesProcessor.php
{
/** @var string */
public $id = 'pages';
/** @var string */
public $title = 'Pages';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
// Dump Cache state
$this->container['debugger']->addMessage($this->container['cache']->getCacheStatus());
$this->container['pages']->init();
$this->container->fireEvent('onPagesInitialized', new Event(['pages' => $this->container['pages']]));
$this->container->fireEvent('onPageInitialized', new Event(['page' => $this->container['page']]));
/** @var PageInterface $page */
$page = $this->container['page'];
if (!$page->routable()) {
$exception = new RequestException($request, 'Page Not Found', 404);
$route = $this->container['route'];
// If no page found, fire event
$event = new Event([
'page' => $page,
'code' => $exception->getCode(),
'message' => $exception->getMessage(),
'exception' => $exception,
'route' => $route,
'request' => $request
]);
$event->page = null;
$event = $this->container->fireEvent('onPageNotFound', $event);
Arguments
"onPagesInitialized"
RocketTheme\Toolbox\Event\Event {#266}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#254}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Common/Processors/TwigProcessor.php
*/
class TwigProcessor extends ProcessorBase
{
/** @var string */
public $id = 'twig';
/** @var string */
public $title = 'Twig';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$this->container['twig']->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#222}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Common/Processors/AssetsProcessor.php
class AssetsProcessor extends ProcessorBase
{
/** @var string */
public $id = '_assets';
/** @var string */
public $title = 'Assets';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$this->container['assets']->init();
$this->container->fireEvent('onAssetsInitialized');
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#219}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Common/Processors/SchedulerProcessor.php
class SchedulerProcessor extends ProcessorBase
{
/** @var string */
public $id = '_scheduler';
/** @var string */
public $title = 'Scheduler';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$scheduler = $this->container['scheduler'];
$this->container->fireEvent('onSchedulerInitialized', new Event(['scheduler' => $scheduler]));
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#186}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Common/Processors/BackupsProcessor.php
class BackupsProcessor extends ProcessorBase
{
/** @var string */
public $id = '_backups';
/** @var string */
public $title = 'Backups';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$backups = $this->container['backups'];
$backups->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#183}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Common/Processors/TasksProcessor.php
$response = $handler->handle($request);
}
$this->stopTimer();
return $response;
} catch (NotFoundException $e) {
// Task not found: Let it pass through.
}
}
if ($task) {
$this->container->fireEvent('onTask.' . $task);
} elseif ($action) {
$this->container->fireEvent('onAction.' . $action);
}
}
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#175}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Common/Processors/RequestProcessor.php
$uri = $request->getUri();
$ext = mb_strtolower(pathinfo($uri->getPath(), PATHINFO_EXTENSION));
$request = $request
->withAttribute('grav', $this->container)
->withAttribute('time', $_SERVER['REQUEST_TIME_FLOAT'] ?? GRAV_REQUEST_TIME)
->withAttribute('route', Uri::getCurrentRoute()->withExtension($ext))
->withAttribute('referrer', $this->container['uri']->referrer());
$event = new RequestHandlerEvent(['request' => $request, 'handler' => $handler]);
/** @var RequestHandlerEvent $event */
$event = $this->container->fireEvent('onRequestHandlerInit', $event);
$response = $event->getResponse();
$this->stopTimer();
if ($response) {
return $response;
}
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#171}
Grav\Framework\RequestHandler\RequestHandler {#169}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Common/Processors/ThemesProcessor.php
*/
class ThemesProcessor extends ProcessorBase
{
/** @var string */
public $id = 'themes';
/** @var string */
public $title = 'Themes';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$this->container['themes']->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
Grav\Framework\RequestHandler\RequestHandler {#162}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Common/Processors/PluginsProcessor.php
class PluginsProcessor extends ProcessorBase
{
/** @var string */
public $id = 'plugins';
/** @var string */
public $title = 'Initialize Plugins';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$grav = $this->container;
$grav->fireEvent('onPluginsInitialized');
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
Grav\Framework\RequestHandler\RequestHandler {#132}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Common/Processors/InitializeProcessor.php
// Initialize URI (uses session, see issue #3269).
$this->initializeUri($config);
// Grav may return redirect response right away.
$redirectCode = (int)$config->get('system.pages.redirect_trailing_slash', 1);
if ($redirectCode) {
$response = $this->handleRedirectRequest($request, $redirectCode > 300 ? $redirectCode : null);
if ($response) {
$this->stopTimer('_init');
return $response;
}
}
$this->stopTimer('_init');
// Wrap call to next handler so that debugger can profile it.
/** @var Response $response */
$response = $debugger->profile(static function () use ($handler, $request) {
return $handler->handle($request);
});
// Log both request and response and return the response.
return $debugger->logRequest($request, $response);
}
public function processCli(): void
{
// Load configuration.
$config = $this->initializeConfig();
// Initialize logger.
$this->initializeLogger($config);
// Disable debugger.
$this->container['debugger']->enabled(false);
// Set timezone, locale.
$this->initializeLocale($config);
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Common/Debugger.php
}
$this->addMeasures();
$this->addDeprecations();
$this->timers = [];
return $this->debugbar->getData();
}
/**
* Hierarchical Profiler support.
*
* @param callable $callable
* @param string|null $message
* @return mixed
*/
public function profile(callable $callable, string $message = null)
{
$this->startProfiling();
$response = $callable();
$this->stopProfiling($message);
return $response;
}
public function addTwigProfiler(Environment $twig): void
{
$clockwork = $this->getClockwork();
if ($clockwork) {
$source = new TwigClockworkDataSource($twig);
$source->listenToEvents();
$clockwork->addDataSource($source);
}
}
/**
* Start profiling code.
*
* @return void
*/
/home/montophrs/public_html/system/src/Grav/Common/Processors/InitializeProcessor.php
$this->initializeUri($config);
// Grav may return redirect response right away.
$redirectCode = (int)$config->get('system.pages.redirect_trailing_slash', 1);
if ($redirectCode) {
$response = $this->handleRedirectRequest($request, $redirectCode > 300 ? $redirectCode : null);
if ($response) {
$this->stopTimer('_init');
return $response;
}
}
$this->stopTimer('_init');
// Wrap call to next handler so that debugger can profile it.
/** @var Response $response */
$response = $debugger->profile(static function () use ($handler, $request) {
return $handler->handle($request);
});
// Log both request and response and return the response.
return $debugger->logRequest($request, $response);
}
public function processCli(): void
{
// Load configuration.
$config = $this->initializeConfig();
// Initialize logger.
$this->initializeLogger($config);
// Disable debugger.
$this->container['debugger']->enabled(false);
// Set timezone, locale.
$this->initializeLocale($config);
// Load plugins.
Arguments
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
private $handler;
/** @var ContainerInterface|null */
private $container;
/**
* {@inheritdoc}
* @throws InvalidArgumentException
*/
public function handle(ServerRequestInterface $request): ResponseInterface
{
$middleware = array_shift($this->middleware);
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
Grav\Framework\RequestHandler\RequestHandler {#84}
/home/montophrs/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
// Use default callable if there is no middleware.
if ($middleware === null) {
return call_user_func($this->handler, $request);
}
if ($middleware instanceof MiddlewareInterface) {
return $middleware->process($request, clone $this);
}
if (null === $this->container || !$this->container->has($middleware)) {
throw new InvalidArgumentException(
sprintf('The middleware is not a valid %s and is not passed in the Container', MiddlewareInterface::class),
$middleware
);
}
array_unshift($this->middleware, $this->container->get($middleware));
return $this->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/system/src/Grav/Common/Grav.php
},
'pagesProcessor' => function () {
return new PagesProcessor($this);
},
'debuggerAssetsProcessor' => function () {
return new DebuggerAssetsProcessor($this);
},
'renderProcessor' => function () {
return new RenderProcessor($this);
},
]
);
$default = static function () {
return new Response(404, ['Expires' => 0, 'Cache-Control' => 'no-store, max-age=0'], 'Not Found');
};
$collection = new RequestHandler($this->middleware, $default, $container);
$response = $collection->handle($this['request']);
$body = $response->getBody();
/** @var Messages $messages */
$messages = $this['messages'];
// Prevent caching if session messages were displayed in the page.
$noCache = $messages->isCleared();
if ($noCache) {
$response = $response->withHeader('Cache-Control', 'no-store, max-age=0');
}
// Handle ETag and If-None-Match headers.
if ($response->getHeaderLine('ETag') === '1') {
$etag = md5($body);
$response = $response->withHeader('ETag', '"' . $etag . '"');
$search = trim($this['request']->getHeaderLine('If-None-Match'), '"');
if ($noCache === false && $search === $etag) {
$response = $response->withStatus(304);
$body = '';
Arguments
Nyholm\Psr7\ServerRequest {#65}
/home/montophrs/public_html/index.php
if (!is_file($autoload)) {
die('Please run: <i>bin/grav install</i>');
}
// Register the auto-loader.
$loader = require $autoload;
use Grav\Common\Grav;
use RocketTheme\Toolbox\Event\Event;
// Get the Grav instance
$grav = Grav::instance(
array(
'loader' => $loader
)
);
// Process the page
try {
$grav->process();
} catch (\Error $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;
} catch (\Exception $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;
}