/var/www/html/user/plugins/news-page/news-page.php
$multiCurl = array();
$result = array();
$mh = curl_multi_init();
$multiCurl['news'] = curl_init('https://www.learningplanetinstitute.org/wp-json/wp/v2/posts/'.strval($id).'?_embed' );
curl_setopt($multiCurl['news'], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh, $multiCurl['news']);
$index=null;
do {
curl_multi_exec($mh,$index);
} while($index > 0);
// get content and remove handles
foreach($multiCurl as $k => $ch) {
$result[$k] = $newslist = json_decode( curl_multi_getcontent($ch), true );
curl_multi_remove_handle($mh, $ch);
$multiCurl2 = array();
$mh2 = curl_multi_init();
// per page 9 because we want 8 but the current news will be included in results
$multiCurl2['morenews'] = curl_init('https://www.learningplanetinstitute.org/wp-json/wp/v2/posts?_embed&per_page=9&categories='.implode(",", $newslist['categories']) );
curl_setopt($multiCurl2['morenews'], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh2, $multiCurl2['morenews']);
$index2=null;
do {
curl_multi_exec($mh2,$index2);
} while($index2 > 0);
foreach($multiCurl2 as $k => $ch2) {
$result[$k] = $morenewslistobj = json_decode( curl_multi_getcontent($ch2), true );
curl_multi_remove_handle($mh2, $ch2);
}
curl_multi_close($mh2);
}
// close
curl_multi_close($mh);
$rvalues = array(
"news" => $result['news'],
"morenews" => $result['morenews']
);
Arguments
"implode(): Invalid arguments passed"
/var/www/html/user/plugins/news-page/news-page.php
$multiCurl = array();
$result = array();
$mh = curl_multi_init();
$multiCurl['news'] = curl_init('https://www.learningplanetinstitute.org/wp-json/wp/v2/posts/'.strval($id).'?_embed' );
curl_setopt($multiCurl['news'], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh, $multiCurl['news']);
$index=null;
do {
curl_multi_exec($mh,$index);
} while($index > 0);
// get content and remove handles
foreach($multiCurl as $k => $ch) {
$result[$k] = $newslist = json_decode( curl_multi_getcontent($ch), true );
curl_multi_remove_handle($mh, $ch);
$multiCurl2 = array();
$mh2 = curl_multi_init();
// per page 9 because we want 8 but the current news will be included in results
$multiCurl2['morenews'] = curl_init('https://www.learningplanetinstitute.org/wp-json/wp/v2/posts?_embed&per_page=9&categories='.implode(",", $newslist['categories']) );
curl_setopt($multiCurl2['morenews'], CURLOPT_RETURNTRANSFER, true);
curl_multi_add_handle($mh2, $multiCurl2['morenews']);
$index2=null;
do {
curl_multi_exec($mh2,$index2);
} while($index2 > 0);
foreach($multiCurl2 as $k => $ch2) {
$result[$k] = $morenewslistobj = json_decode( curl_multi_getcontent($ch2), true );
curl_multi_remove_handle($mh2, $ch2);
}
curl_multi_close($mh2);
}
// close
curl_multi_close($mh);
$rvalues = array(
"news" => $result['news'],
"morenews" => $result['morenews']
);
Arguments
/var/www/html/user/plugins/news-page/news-page.php
// Enable the main event we are interested in
$this->enable([
'onMarkdownInitialized' => ['onMarkdownInitialized', 0]
]);
}
/**
* Do some work for this event, full details of events can be found
* on the learn site: http://learn.getgrav.org/plugins/event-hooks
*
* @param Event $e
*/
public function onMarkdownInitialized(Event $e)
{
$page = $e['page'];
$header = $page->header();
if ( isset($header->isnewspage) ){
if ( isset($_GET["id"]) ){
$news = get_news_file( $_GET["id"] );
$page->news = $news['news'];
$page->morenews = $news['morenews'];
// $page->title( $team['group']->_items[0]->name );
} else {
header('Location: /news');
}
}
}
}
Arguments
"6196142f48751e003be98b2a"
/var/www/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 {#471}
"onMarkdownInitialized"
Symfony\Component\EventDispatcher\EventDispatcher {#124
-listeners: array:59 [
"onPluginsInitialized" => array:8 [
100002 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#111}
1 => "autoload"
]
]
100001 => array:5 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "autoload"
]
1 => array:2 [
0 => Grav\Plugin\GoogleAnalyticsPlugin {#103}
1 => "autoload"
]
2 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#106}
1 => "autoload"
]
3 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#111}
1 => "onPluginsInitialized"
]
4 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "autoload"
]
]
100000 => array:3 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "setup"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "autoload"
]
2 => array:2 [
0 => Grav\Plugin\GitSyncPlugin {#102}
1 => "autoload"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "initializeSession"
]
]
1001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "onPluginsInitialized"
]
]
1000 => array:2 [
0 => array:2 [
0 => Grav\Plugin\GitSyncPlugin {#102}
1 => "onPluginsInitialized"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "initializeLogin"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onPluginsInitialized"
]
]
0 => array:13 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#94}
1 => "onPluginsInitialized"
]
1 => array:2 [
0 => Grav\Plugin\EventsViewPlugin {#96}
1 => "onPluginsInitialized"
]
2 => array:2 [
0 => Grav\Plugin\FileContentPlugin {#97}
1 => "onPluginsInitialized"
]
3 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onPluginsInitialized"
]
4 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onPluginsInitialized"
]
5 => array:2 [
0 => Grav\Plugin\GoogleAnalyticsPlugin {#103}
1 => "onPluginsInitialized"
]
6 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "onPluginsInitialized"
]
7 => array:2 [
0 => Grav\Plugin\NewsPagePlugin {#107}
1 => "onPluginsInitialized"
]
8 => array:2 [
0 => Grav\Plugin\NewsViewPlugin {#108}
1 => "onPluginsInitialized"
]
9 => array:2 [
0 => Grav\Plugin\PeoplePagePlugin {#109}
1 => "onPluginsInitialized"
]
10 => array:2 [
0 => Grav\Plugin\PeopleTeamViewPlugin {#110}
1 => "onPluginsInitialized"
]
11 => array:2 [
0 => Grav\Plugin\ProjectsListPlugin {#112}
1 => "onPluginsInitialized"
]
12 => array:2 [
0 => Grav\Plugin\TwigExtensionsPlugin {#114}
1 => "onPluginsInitialized"
]
]
]
"onRequestHandlerInit" => array:1 [
100000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "onRequestHandlerInit"
]
]
]
"onFormRegisterTypes" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "onFormRegisterTypes"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onFormRegisterTypes"
]
]
]
"onPageInitialized" => array:3 [
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "authorizePage"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "authorizeLoginPage"
]
]
0 => array:4 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "onPageInitialized"
]
1 => array:2 [
0 => Grav\Plugin\GitSyncPlugin {#102}
1 => "onPageInitialized"
]
2 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "authorizePage"
]
3 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onPageInitialized"
]
]
]
"onShutdown" => array:1 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "onShutdown"
]
]
]
"Grav\Events\PermissionsRegisterEvent" => array:2 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#91}
1 => "onRegisterPermissions"
]
]
100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onRegisterPermissions"
]
]
]
"onShortcodeHandlers" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\CriScPlugin {#90}
1 => "onShortcodeHandlers"
]
1 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onShortcodeHandlers"
]
]
]
"onFormProcessed" => array:1 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#94}
1 => "onFormProcessed"
]
1 => array:2 [
0 => Grav\Plugin\GitSyncPlugin {#102}
1 => "onFormProcessed"
]
2 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onFormProcessed"
]
]
]
"onTwigTemplatePaths" => array:2 [
0 => array:5 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#94}
1 => "onTwigTemplatePaths"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onTwigTemplatePaths"
]
2 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onTwigTemplatePaths"
]
3 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onTwigTemplatePaths"
]
4 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "onTwigTemplatePaths"
]
]
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#95}
1 => "onTwigTemplatePaths"
]
]
]
"onSchedulerInitialized" => array:1 [
0 => array:4 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#94}
1 => "onSchedulerInitialized"
]
1 => array:2 [
0 => Grav\Plugin\GitSyncPlugin {#102}
1 => "onSchedulerInitialized"
]
2 => array:2 [
0 => Grav\Common\Cache {#181}
1 => "onSchedulerInitialized"
]
3 => array:2 [
0 => Grav\Common\Backup\Backups {#263}
1 => "onSchedulerInitialized"
]
]
]
"onAdminSave" => array:1 [
0 => array:7 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#94}
1 => "onAdminSave"
]
1 => array:2 [
0 => Grav\Plugin\EventsViewPlugin {#96}
1 => "onAdminSave"
]
2 => array:2 [
0 => Grav\Plugin\PeopleTeamViewPlugin {#110}
1 => "onAdminSave"
]
3 => array:2 [
0 => Grav\Plugin\ProjectsListPlugin {#112}
1 => "onAdminSave"
]
4 => array:2 [
0 => Grav\Plugin\EventsViewPlugin {#96}
1 => "onAdminSave"
]
5 => array:2 [
0 => Grav\Plugin\PeopleTeamViewPlugin {#110}
1 => "onAdminSave"
]
6 => array:2 [
0 => Grav\Plugin\ProjectsListPlugin {#112}
1 => "onAdminSave"
]
]
]
"onCliInitialize" => array:2 [
100000 => array:2 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#95}
1 => "autoload"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "autoload"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "initializeFlex"
]
]
]
"onPageNotFound" => array:2 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#95}
1 => "onPageNotFound"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onPageNotFound"
]
]
]
"onGetPageTemplates" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#95}
1 => "onGetPageTemplates"
]
]
]
"onDisplayErrorPage.404" => array:1 [
-1 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#95}
1 => "onDisplayErrorPage404"
]
]
]
"Grav\Events\PluginsLoadedEvent" => array:1 [
10 => array:2 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "initializeFlex"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onPluginsLoaded"
]
]
]
"Grav\Events\FlexRegisterEvent" => array:1 [
100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onRegisterFlex"
]
]
]
"onTwigExtensions" => array:2 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onTwigExtensions"
]
1 => array:2 [
0 => Grav\Plugin\FileContentPlugin {#97}
1 => "onTwigExtensions"
]
2 => array:2 [
0 => Grav\Plugin\ProjectsListPlugin {#112}
1 => "onTwigExtensions"
]
]
-100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\TwigExtensionsPlugin {#114}
1 => "onTwigExtensions"
]
]
]
"Grav\Events\SessionStartEvent" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onSessionStart"
]
]
]
"onTask.login.login" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onTask.login.twofa" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onTask.login.twofa_cancel" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onTask.login.forgot" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onTask.login.logout" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onTask.login.reset" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onTask.login.regenerate2FASecret" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "loginController"
]
]
]
"onPagesInitialized" => array:1 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "storeReferrerPage"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "pageVisibility"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onPagesInitialized"
]
]
]
"onDisplayErrorPage.401" => array:1 [
-1 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onDisplayErrorPage401"
]
]
]
"onDisplayErrorPage.403" => array:1 [
-1 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onDisplayErrorPage403"
]
]
]
"onPageFallBackUrl" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "authorizeFallBackUrl"
]
]
]
"onTwigSiteVariables" => array:2 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#106}
1 => "onTwigSiteVariables"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onTwigVariables"
]
2 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "onTwigSiteVariables"
]
]
-100000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "onTwigSiteVariables"
]
]
]
"onUserLoginAuthenticate" => array:6 [
10003 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginAuthenticateRateLimit"
]
]
10002 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginAuthenticateByRegistration"
]
]
10001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginAuthenticateByRememberMe"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginAuthenticateByEmail"
]
]
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "userLoginAuthenticate"
]
]
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginAuthenticate"
]
]
]
"onUserLoginAuthorize" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginAuthorize"
]
]
]
"onUserLoginFailure" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginGuest"
]
1 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "userLoginFailure"
]
]
]
"onUserLoginGuest" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginGuest"
]
]
]
"onUserLogin" => array:3 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLoginResetRateLimit"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLogin"
]
]
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "userLogin"
]
]
]
"onUserLogout" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#104}
1 => "userLogout"
]
1 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "userLogout"
]
]
]
"onMarkdownInitialized" => array:1 [
0 => array:8 [
0 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#106}
1 => "onMarkdownInitialized"
]
1 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onMarkdownInitialized"
]
2 => array:2 [
0 => Grav\Plugin\EventsViewPlugin {#96}
1 => "onMarkdownInitialized"
]
3 => array:2 [
0 => Grav\Plugin\NewsPagePlugin {#107}
1 => "onMarkdownInitialized"
]
4 => array:2 [
0 => Grav\Plugin\NewsViewPlugin {#108}
1 => "onMarkdownInitialized"
]
5 => array:2 [
0 => Grav\Plugin\PeoplePagePlugin {#109}
1 => "onMarkdownInitialized"
]
6 => array:2 [
0 => Grav\Plugin\PeopleTeamViewPlugin {#110}
1 => "onMarkdownInitialized"
]
7 => array:2 [
0 => Grav\Plugin\ProjectsListPlugin {#112}
1 => "onMarkdownInitialized"
]
]
]
"onAdminGenerateReports" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#111}
1 => "onAdminGenerateReports"
]
]
]
"onAdminCompilePresetSCSS" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#111}
1 => "onAdminCompilePresetSCSS"
]
]
]
"registerNextGenEditorPlugin" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "registerNextGenEditorPlugin"
]
1 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "registerNextGenEditorPluginShortcodes"
]
]
]
"onFatalException" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#111}
1 => "onFatalException"
]
]
]
"gitsync" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\GitSyncPlugin {#102}
1 => "synchronize"
]
]
]
"onThemeInitialized" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onThemeInitialized"
]
]
]
"onPageContentRaw" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onPageContentRaw"
]
]
]
"onPageContentProcessed" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onPageContentProcessed"
]
]
]
"onPageContent" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onPageContent"
]
]
]
"onTwigInitialized" => array:1 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\ShortcodeCorePlugin {#113}
1 => "onTwigInitialized"
]
1 => array:2 [
0 => Grav\Plugin\EventsViewPlugin {#96}
1 => "onTwigInitialized"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onTwigInitialized"
]
]
]
"onBeforeFlexFormInitialize" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onBeforeFlexFormInitialize"
]
]
]
"onPageTask" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#98}
1 => "onPageTask"
]
]
]
"onPageProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onPageProcessed"
]
]
]
"onTwigPageVariables" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onTwigVariables"
]
]
]
"onFormValidationProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#99}
1 => "onFormValidationProcessed"
]
]
]
"onOutputGenerated" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\GoogleAnalyticsPlugin {#103}
1 => "onOutputGenerated"
]
]
]
"onTask.login.oauth2" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "loginRedirect"
]
]
]
"onTask.callback.oauth2" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "loginCallback"
]
]
]
"onTwigLoader" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "onTwigLoader"
]
]
]
"onLoginPage" => array:1 [
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "onLoginPage"
]
]
]
"onOAuth2Username" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginOauth2Plugin {#105}
1 => "onOAuth2Username"
]
]
]
]
-sorted: []
-optimized: array:21 [
"Grav\Events\PluginsLoadedEvent" => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin::initializeFlex(): void {#130 …4}
1 => Grav\Plugin\LoginPlugin::onPluginsLoaded(): void {#141 …4}
]
"Grav\Events\SessionStartEvent" => array:1 [
0 => Grav\Plugin\LoginPlugin::onSessionStart(SessionStartEvent $event): void {#149 …4}
]
"onPluginsInitialized" => array:27 [
0 => Grav\Plugin\ProblemsPlugin::autoload(): ClassLoader {#153 …4}
1 => Grav\Plugin\AdminPlugin::autoload(): ClassLoader {#154 …4}
2 => Grav\Plugin\GoogleAnalyticsPlugin::autoload(): ClassLoader {#155 …4}
3 => Grav\Plugin\MarkdownNoticesPlugin::autoload() {#156 …3}
4 => Grav\Plugin\ProblemsPlugin::onPluginsInitialized(): void {#157 …4}
5 => Grav\Plugin\ShortcodeCorePlugin::autoload() {#158 …3}
6 => Grav\Plugin\AdminPlugin::setup() {#159 …3}
7 => Grav\Plugin\FormPlugin::autoload() {#160 …3}
8 => Grav\Plugin\GitSyncPlugin::autoload(): ClassLoader {#161 …4}
9 => Grav\Plugin\LoginPlugin::initializeSession(): void {#162 …4}
10 => Grav\Plugin\AdminPlugin::onPluginsInitialized() {#163 …3}
11 => Grav\Plugin\GitSyncPlugin::onPluginsInitialized() {#164 …3}
12 => Grav\Plugin\LoginPlugin::initializeLogin(): void {#165 …4}
13 => Grav\Plugin\ShortcodeCorePlugin::onPluginsInitialized() {#166 …3}
14 => Grav\Plugin\EmailPlugin::onPluginsInitialized() {#167 …3}
15 => Grav\Plugin\EventsViewPlugin::onPluginsInitialized() {#168 …3}
16 => Grav\Plugin\FileContentPlugin::onPluginsInitialized() {#169 …3}
17 => Grav\Plugin\FlexObjectsPlugin::onPluginsInitialized(): void {#170 …4}
18 => Grav\Plugin\FormPlugin::onPluginsInitialized(): void {#171 …4}
19 => Grav\Plugin\GoogleAnalyticsPlugin::onPluginsInitialized(): void {#172 …4}
20 => Grav\Plugin\LoginOauth2Plugin::onPluginsInitialized(): void {#173 …4}
21 => Grav\Plugin\NewsPagePlugin::onPluginsInitialized() {#174 …3}
22 => Grav\Plugin\NewsViewPlugin::onPluginsInitialized() {#175 …3}
23 => Grav\Plugin\PeoplePagePlugin::onPluginsInitialized() {#176 …3}
24 => Grav\Plugin\PeopleTeamViewPlugin::onPluginsInitialized() {#177 …3}
25 => Grav\Plugin\ProjectsListPlugin::onPluginsInitialized() {#178 …3}
26 => Grav\Plugin\TwigExtensionsPlugin::onPluginsInitialized() {#179 …3}
]
"onThemeInitialized" => array:1 [
0 => Grav\Plugin\ShortcodeCorePlugin::onThemeInitialized() {#201 …3}
]
"onShortcodeHandlers" => array:2 [
0 => Grav\Plugin\CriScPlugin::onShortcodeHandlers() {#203 …3}
1 => Grav\Plugin\ShortcodeCorePlugin::onShortcodeHandlers() {#204 …3}
]
"onRequestHandlerInit" => array:1 [
0 => Grav\Plugin\AdminPlugin::onRequestHandlerInit(RequestHandlerEvent $event) {#253 …3}
]
"onSchedulerInitialized" => array:4 [
0 => Grav\Plugin\EmailPlugin::onSchedulerInitialized(Event $e) {#268 …3}
1 => Grav\Plugin\GitSyncPlugin::onSchedulerInitialized(Event $event) {#269 …3}
2 => Grav\Common\Cache::onSchedulerInitialized(Event $event) {#270 …3}
3 => Grav\Common\Backup\Backups::onSchedulerInitialized(Event $event) {#271 …3}
]
"onTwigTemplatePaths" => array:6 [
0 => Grav\Plugin\EmailPlugin::onTwigTemplatePaths() {#304 …3}
1 => Grav\Plugin\FormPlugin::onTwigTemplatePaths(): void {#305 …4}
2 => Grav\Plugin\LoginPlugin::onTwigTemplatePaths(): void {#306 …4}
3 => Grav\Plugin\FlexObjectsPlugin::onTwigTemplatePaths(): void {#307 …4}
4 => Grav\Plugin\LoginOauth2Plugin::onTwigTemplatePaths(): void {#308 …4}
5 => Grav\Plugin\ErrorPlugin::onTwigTemplatePaths(): void {#309 …4}
]
"onTwigLoader" => array:1 [
0 => Grav\Plugin\LoginOauth2Plugin::onTwigLoader(): void {#311 …4}
]
"onTwigInitialized" => array:3 [
0 => Grav\Plugin\ShortcodeCorePlugin::onTwigInitialized() {#322 …3}
1 => Grav\Plugin\EventsViewPlugin::onTwigInitialized(Event $e) {#323 …3}
2 => Grav\Plugin\FormPlugin::onTwigInitialized(): void {#324 …4}
]
"onTwigExtensions" => array:4 [
0 => Grav\Plugin\FormPlugin::onTwigExtensions(): void {#335 …4}
1 => Grav\Plugin\FileContentPlugin::onTwigExtensions() {#336 …3}
2 => Grav\Plugin\ProjectsListPlugin::onTwigExtensions() {#337 …3}
3 => Grav\Plugin\TwigExtensionsPlugin::onTwigExtensions() {#338 …3}
]
"onPagesInitialized" => array:3 [
0 => Grav\Plugin\LoginPlugin::storeReferrerPage(): void {#420 …4}
1 => Grav\Plugin\LoginPlugin::pageVisibility(Event $event): void {#421 …4}
2 => Grav\Plugin\FormPlugin::onPagesInitialized(): void {#422 …4}
]
"onPageInitialized" => array:6 [
0 => Grav\Plugin\FlexObjectsPlugin::authorizePage(Event $event): void {#423 …4}
1 => Grav\Plugin\LoginPlugin::authorizeLoginPage(Event $event): void {#424 …4}
2 => Grav\Plugin\AdminPlugin::onPageInitialized() {#425 …3}
3 => Grav\Plugin\GitSyncPlugin::onPageInitialized() {#426 …3}
4 => Grav\Plugin\LoginPlugin::authorizePage(): void {#427 …4}
5 => Grav\Plugin\FormPlugin::onPageInitialized(): void {#428 …4}
]
"onUserLoginAuthenticate" => array:6 [
0 => Grav\Plugin\LoginPlugin::userLoginAuthenticateRateLimit(UserLoginEvent $event): void {#434 …4}
1 => Grav\Plugin\LoginPlugin::userLoginAuthenticateByRegistration(UserLoginEvent $event): void {#435 …4}
2 => Grav\Plugin\LoginPlugin::userLoginAuthenticateByRememberMe(UserLoginEvent $event): void {#436 …4}
3 => Grav\Plugin\LoginPlugin::userLoginAuthenticateByEmail(UserLoginEvent $event): void {#437 …4}
4 => Grav\Plugin\LoginOauth2Plugin::userLoginAuthenticate(UserLoginEvent $event): void {#438 …4}
5 => Grav\Plugin\LoginPlugin::userLoginAuthenticate(UserLoginEvent $event): void {#439 …4}
]
"onUserLoginGuest" => array:1 [
0 => Grav\Plugin\LoginPlugin::userLoginGuest(UserLoginEvent $event): void {#429 …4}
]
"onFormRegisterTypes" => array:2 [
0 => Grav\Plugin\AdminPlugin::onFormRegisterTypes(Event $event): void {#432 …4}
1 => Grav\Plugin\FlexObjectsPlugin::onFormRegisterTypes(Event $event): void {#446 …4}
]
"onTwigSiteVariables" => array:4 [
0 => Grav\Plugin\MarkdownNoticesPlugin::onTwigSiteVariables() {#452 …3}
1 => Grav\Plugin\FormPlugin::onTwigVariables(Event $event = null): void {#460 …4}
2 => Grav\Plugin\LoginOauth2Plugin::onTwigSiteVariables(): void {#465 …4}
3 => Grav\Plugin\LoginPlugin::onTwigSiteVariables(): void {#464 …4}
]
"onLoginPage" => array:1 [
0 => Grav\Plugin\LoginOauth2Plugin::onLoginPage(): void {#458 …4}
]
"onPageContentRaw" => array:1 [
0 => Grav\Plugin\ShortcodeCorePlugin::onPageContentRaw(Event $e) {#467 …3}
]
"onMarkdownInitialized" => array:8 [
0 => Grav\Plugin\MarkdownNoticesPlugin::onMarkdownInitialized(Event $event) {#470 …3}
1 => Grav\Plugin\ShortcodeCorePlugin::onMarkdownInitialized(Event $event) {#469 …3}
2 => Grav\Plugin\EventsViewPlugin::onMarkdownInitialized(Event $e) {#472 …3}
3 => Grav\Plugin\NewsPagePlugin::onMarkdownInitialized(Event $e) {#473 …3}
4 => Grav\Plugin\NewsViewPlugin::onMarkdownInitialized(Event $e) {#474 …3}
5 => Grav\Plugin\PeoplePagePlugin::onMarkdownInitialized(Event $e) {#475 …3}
6 => Grav\Plugin\PeopleTeamViewPlugin::onMarkdownInitialized(Event $e) {#476 …3}
7 => Grav\Plugin\ProjectsListPlugin::onMarkdownInitialized(Event $e) {#477 …3}
]
"onFatalException" => array:1 [
0 => Grav\Plugin\ProblemsPlugin::onFatalException(): void {#223 …4}
]
]
}
/var/www/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:8 [
0 => Grav\Plugin\MarkdownNoticesPlugin::onMarkdownInitialized(Event $event) {#470 …3}
1 => Grav\Plugin\ShortcodeCorePlugin::onMarkdownInitialized(Event $event) {#469 …3}
2 => Grav\Plugin\EventsViewPlugin::onMarkdownInitialized(Event $e) {#472 …3}
3 => Grav\Plugin\NewsPagePlugin::onMarkdownInitialized(Event $e) {#473 …3}
4 => Grav\Plugin\NewsViewPlugin::onMarkdownInitialized(Event $e) {#474 …3}
5 => Grav\Plugin\PeoplePagePlugin::onMarkdownInitialized(Event $e) {#475 …3}
6 => Grav\Plugin\PeopleTeamViewPlugin::onMarkdownInitialized(Event $e) {#476 …3}
7 => Grav\Plugin\ProjectsListPlugin::onMarkdownInitialized(Event $e) {#477 …3}
]
"onMarkdownInitialized"
RocketTheme\Toolbox\Event\Event {#471}
/var/www/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:8 [
0 => Grav\Plugin\MarkdownNoticesPlugin::onMarkdownInitialized(Event $event) {#470 …3}
1 => Grav\Plugin\ShortcodeCorePlugin::onMarkdownInitialized(Event $event) {#469 …3}
2 => Grav\Plugin\EventsViewPlugin::onMarkdownInitialized(Event $e) {#472 …3}
3 => Grav\Plugin\NewsPagePlugin::onMarkdownInitialized(Event $e) {#473 …3}
4 => Grav\Plugin\NewsViewPlugin::onMarkdownInitialized(Event $e) {#474 …3}
5 => Grav\Plugin\PeoplePagePlugin::onMarkdownInitialized(Event $e) {#475 …3}
6 => Grav\Plugin\PeopleTeamViewPlugin::onMarkdownInitialized(Event $e) {#476 …3}
7 => Grav\Plugin\ProjectsListPlugin::onMarkdownInitialized(Event $e) {#477 …3}
]
"onMarkdownInitialized"
RocketTheme\Toolbox\Event\Event {#471}
/var/www/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 {#471}
"onMarkdownInitialized"
/var/www/html/system/src/Grav/Common/Page/Markdown/Excerpts.php
return $this->page;
}
/**
* @return array
*/
public function getConfig(): array
{
return $this->config;
}
/**
* @param object $markdown
* @return void
*/
public function fireInitializedEvent($markdown): void
{
$grav = Grav::instance();
$grav->fireEvent('onMarkdownInitialized', new Event(['markdown' => $markdown, 'page' => $this->page]));
}
/**
* Process a Link excerpt
*
* @param array $excerpt
* @param string $type
* @return array
*/
public function processLinkExcerpt(array $excerpt, string $type = 'link'): array
{
$grav = Grav::instance();
$url = htmlspecialchars_decode(rawurldecode($excerpt['element']['attributes']['href']));
$url_parts = $this->parseUrl($url);
// If there is a query, then parse it and build action calls.
if (isset($url_parts['query'])) {
$actions = array_reduce(
explode('&', $url_parts['query']),
static function ($carry, $item) {
Arguments
"onMarkdownInitialized"
RocketTheme\Toolbox\Event\Event {#471}
/var/www/html/system/src/Grav/Common/Markdown/ParsedownGravTrait.php
$this->BlockTypes['{'][] = 'TwigTag';
$this->special_chars = ['>' => 'gt', '<' => 'lt', '"' => 'quot'];
$defaults = $this->excerpts->getConfig();
if (isset($defaults['markdown']['auto_line_breaks'])) {
$this->setBreaksEnabled($defaults['markdown']['auto_line_breaks']);
}
if (isset($defaults['markdown']['auto_url_links'])) {
$this->setUrlsLinked($defaults['markdown']['auto_url_links']);
}
if (isset($defaults['markdown']['escape_markup'])) {
$this->setMarkupEscaped($defaults['markdown']['escape_markup']);
}
if (isset($defaults['markdown']['special_chars'])) {
$this->setSpecialChars($defaults['markdown']['special_chars']);
}
$this->excerpts->fireInitializedEvent($this);
}
/**
* @return Excerpts
*/
public function getExcerpts()
{
return $this->excerpts;
}
/**
* Be able to define a new Block type or override an existing one
*
* @param string $type
* @param string $tag
* @param bool $continuable
* @param bool $completable
* @param int|null $index
* @return void
*/
Arguments
Grav\Common\Markdown\Parsedown {#468}
/var/www/html/system/src/Grav/Common/Markdown/Parsedown.php
use ParsedownGravTrait;
/**
* Parsedown constructor.
*
* @param Excerpts|PageInterface|null $excerpts
* @param array|null $defaults
*/
public function __construct($excerpts = null, $defaults = null)
{
if (!$excerpts || $excerpts instanceof PageInterface || null !== $defaults) {
// Deprecated in Grav 1.6.10
if ($defaults) {
$defaults = ['markdown' => $defaults];
}
$excerpts = new Excerpts($excerpts, $defaults);
user_error(__CLASS__ . '::' . __FUNCTION__ . '($page, $defaults) is deprecated since Grav 1.6.10, use new ' . __CLASS__ . '(new ' . Excerpts::class . '($page, [\'markdown\' => $defaults])) instead.', E_USER_DEPRECATED);
}
$this->init($excerpts, $defaults);
}
}
Arguments
Grav\Common\Page\Markdown\Excerpts {#466}
array:2 [
"markdown" => array:6 [
"extra" => false
"auto_line_breaks" => false
"auto_url_links" => false
"escape_markup" => false
"special_chars" => array:2 [
">" => "gt"
"<" => "lt"
]
"valid_link_attributes" => array:5 [
0 => "rel"
1 => "target"
2 => "id"
3 => "class"
4 => "classes"
]
]
"images" => array:8 [
"default_image_quality" => 85
"cache_all" => false
"cache_perms" => "0775"
"debug" => false
"auto_fix_orientation" => false
"seofriendly" => false
"cls" => array:3 [
"auto_sizes" => false
"aspect_ratio" => false
"retina_scale" => 1
]
"defaults" => array:1 [
"loading" => "auto"
]
]
]
/var/www/html/system/src/Grav/Common/Page/Page.php
// pages.markdown_extra is deprecated, but still check it...
if (!isset($markdownDefaults['extra']) && (isset($this->markdown_extra) || $config->get('system.pages.markdown_extra') !== null)) {
user_error('Configuration option \'system.pages.markdown_extra\' is deprecated since Grav 1.5, use \'system.pages.markdown.extra\' instead', E_USER_DEPRECATED);
$markdownDefaults['extra'] = $this->markdown_extra ?: $config->get('system.pages.markdown_extra');
}
$extra = $markdownDefaults['extra'] ?? false;
$defaults = [
'markdown' => $markdownDefaults,
'images' => $config->get('system.images', [])
];
$excerpts = new Excerpts($this, $defaults);
// Initialize the preferred variant of Parsedown
if ($extra) {
$parsedown = new ParsedownExtra($excerpts);
} else {
$parsedown = new Parsedown($excerpts);
}
$content = $this->content;
if ($keepTwig) {
$token = [
'/' . Utils::generateRandomString(3),
Utils::generateRandomString(3) . '/'
];
// Base64 encode any twig.
$content = preg_replace_callback(
['/({#.*?#})/mu', '/({{.*?}})/mu', '/({%.*?%})/mu'],
static function ($matches) use ($token) { return $token[0] . base64_encode($matches[1]) . $token[1]; },
$content
);
}
$content = $parsedown->text($content);
if ($keepTwig) {
// Base64 decode the encoded twig.
Arguments
Grav\Common\Page\Markdown\Excerpts {#466}
/var/www/html/system/src/Grav/Common/Page/Page.php
);
$twig_first = $this->header->twig_first ?? $config->get(
'system.pages.twig_first',
false
);
// never cache twig means it's always run after content
$never_cache_twig = $this->header->never_cache_twig ?? $config->get(
'system.pages.never_cache_twig',
true
);
// if no cached-content run everything
if ($never_cache_twig) {
if ($this->content === false || $cache_enable === false) {
$this->content = $this->raw_content;
Grav::instance()->fireEvent('onPageContentRaw', new Event(['page' => $this]));
if ($process_markdown) {
$this->processMarkdown();
}
// Content Processed but not cached yet
Grav::instance()->fireEvent('onPageContentProcessed', new Event(['page' => $this]));
if ($cache_enable) {
$this->cachePageContent();
}
}
if ($process_twig) {
$this->processTwig();
}
} else {
if ($this->content === false || $cache_enable === false) {
$this->content = $this->raw_content;
Grav::instance()->fireEvent('onPageContentRaw', new Event(['page' => $this]));
if ($twig_first) {
if ($process_twig) {
/var/www/html/system/src/Grav/Common/Twig/Twig.php
{
try {
$grav = $this->grav;
// set the page now its been processed
$grav->fireEvent('onTwigSiteVariables');
/** @var Pages $pages */
$pages = $grav['pages'];
/** @var PageInterface $page */
$page = $grav['page'];
$twig_vars = $this->twig_vars;
$twig_vars['theme'] = $grav['config']->get('theme');
$twig_vars['pages'] = $pages->root();
$twig_vars['page'] = $page;
$twig_vars['header'] = $page->header();
$twig_vars['media'] = $page->media();
$twig_vars['content'] = $page->content();
// determine if params are set, if so disable twig cache
$params = $grav['uri']->params(null, true);
if (!empty($params)) {
$this->twig->setCache(false);
}
// Get Twig template layout
$template = $this->getPageTwigTemplate($page, $format);
$page->templateFormat($format);
$output = $this->twig->render($template, $vars + $twig_vars);
} catch (LoaderError $e) {
throw new RuntimeException($e->getMessage(), 400, $e);
} catch (RuntimeError $e) {
$prev = $e->getPrevious();
if ($prev instanceof TwigException) {
$code = $prev->getCode() ?: 500;
// Fire onPageNotFound event.
$event = new Event([
/var/www/html/system/src/Grav/Common/Service/OutputServiceProvider.php
/**
* Class OutputServiceProvider
* @package Grav\Common\Service
*/
class OutputServiceProvider implements ServiceProviderInterface
{
/**
* @param Container $container
* @return void
*/
public function register(Container $container)
{
$container['output'] = function ($c) {
/** @var Twig $twig */
$twig = $c['twig'];
/** @var PageInterface $page */
$page = $c['page'];
return $twig->processSite($page->templateFormat());
};
}
}
Arguments
/var/www/html/vendor/pimple/pimple/src/Pimple/Container.php
{
if (!isset($this->keys[$id])) {
throw new UnknownIdentifierException($id);
}
if (
isset($this->raw[$id])
|| !\is_object($this->values[$id])
|| isset($this->protected[$this->values[$id]])
|| !\method_exists($this->values[$id], '__invoke')
) {
return $this->values[$id];
}
if (isset($this->factories[$this->values[$id]])) {
return $this->values[$id]($this);
}
$raw = $this->values[$id];
$val = $this->values[$id] = $raw($this);
$this->raw[$id] = $raw;
$this->frozen[$id] = true;
return $val;
}
/**
* Checks if a parameter or an object is set.
*
* @param string $id The unique identifier for the parameter or object
*
* @return bool
*/
public function offsetExists($id)
{
return isset($this->keys[$id]);
}
/**
Arguments
/var/www/html/system/src/Grav/Common/Processors/RenderProcessor.php
* @package Grav\Common\Processors
*/
class RenderProcessor extends ProcessorBase
{
/** @var string */
public $id = 'render';
/** @var string */
public $title = 'Render';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$container = $this->container;
$output = $container['output'];
if ($output instanceof ResponseInterface) {
return $output;
}
/** @var PageInterface $page */
$page = $this->container['page'];
// Use internal Grav output.
$container->output = $output;
ob_start();
$event = new Event(['page' => $page, 'output' => &$container->output]);
$container->fireEvent('onOutputGenerated', $event);
echo $container->output;
$html = ob_get_clean();
Arguments
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#451}
/var/www/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 {#206}
/var/www/html/system/src/Grav/Common/Processors/DebuggerAssetsProcessor.php
*/
class DebuggerAssetsProcessor extends ProcessorBase
{
/** @var string */
public $id = 'debugger_assets';
/** @var string */
public $title = 'Debugger Assets';
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->startTimer();
$this->container['debugger']->addAssets();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#449}
/var/www/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 {#206}
/var/www/html/system/src/Grav/Common/Processors/PagesProcessor.php
/** @var Forms $forms */
$forms = $this->container['forms'] ?? null;
$form = $forms ? $forms->getActiveForm() : null;
$options = ['page' => $page, 'form' => $form, 'request' => $request];
if ($task) {
$event = new Event(['task' => $task] + $options);
$this->container->fireEvent('onPageTask', $event);
$this->container->fireEvent('onPageTask.' . $task, $event);
} elseif ($action) {
$event = new Event(['action' => $action] + $options);
$this->container->fireEvent('onPageAction', $event);
$this->container->fireEvent('onPageAction.' . $action, $event);
}
}
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
Nyholm\Psr7\ServerRequest {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#347}
/var/www/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 {#206}
/var/www/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 {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#302}
/var/www/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 {#206}
/var/www/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 {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#299}
/var/www/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 {#206}
/var/www/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 {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#265}
/var/www/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 {#206}
/var/www/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 {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#262}
/var/www/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 {#206}
/var/www/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 {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#254}
/var/www/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 {#206}
/var/www/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 {#206}
/var/www/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 {#206}
Grav\Framework\RequestHandler\RequestHandler {#202}
/var/www/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 {#64}
/var/www/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 {#64}
/var/www/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 {#64}
Grav\Framework\RequestHandler\RequestHandler {#196}
/var/www/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 {#64}
/var/www/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 {#64}
/var/www/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 {#64}
Grav\Framework\RequestHandler\RequestHandler {#151}
/var/www/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 {#64}
/var/www/html/system/src/Grav/Common/Processors/InitializeProcessor.php
// Initialize session.
$this->initializeSession($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 {#64}
/var/www/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
*/
/var/www/html/system/src/Grav/Common/Processors/InitializeProcessor.php
$this->initializeSession($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
/var/www/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 {#64}
Grav\Framework\RequestHandler\RequestHandler {#85}
/var/www/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 {#64}
/var/www/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 {#64}
/var/www/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;
}