/home/rogermil/public_html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
* Writes a string content to file in an atomic way.
*
* @param string $filename Path to the file where to write the data.
* @param string $content The content to write
*
* @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error.
*/
protected function writeFile(string $filename, string $content): bool
{
$filepath = pathinfo($filename, PATHINFO_DIRNAME);
if (! $this->createPathIfNeeded($filepath)) {
return false;
}
if (! is_writable($filepath)) {
return false;
}
$tmpFile = tempnam($filepath, 'swap');
@chmod($tmpFile, 0666 & (~$this->umask));
if (file_put_contents($tmpFile, $content) !== false) {
@chmod($tmpFile, 0666 & (~$this->umask));
if (@rename($tmpFile, $filename)) {
return true;
}
@unlink($tmpFile);
}
return false;
}
/**
* @return Iterator<string, SplFileInfo>
*/
private function getIterator(): Iterator
{
return new RecursiveIteratorIterator(
Arguments
"tempnam(): file created in the system's temporary directory"
/home/rogermil/public_html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FileCache.php
* Writes a string content to file in an atomic way.
*
* @param string $filename Path to the file where to write the data.
* @param string $content The content to write
*
* @return bool TRUE on success, FALSE if path cannot be created, if path is not writable or an any other error.
*/
protected function writeFile(string $filename, string $content): bool
{
$filepath = pathinfo($filename, PATHINFO_DIRNAME);
if (! $this->createPathIfNeeded($filepath)) {
return false;
}
if (! is_writable($filepath)) {
return false;
}
$tmpFile = tempnam($filepath, 'swap');
@chmod($tmpFile, 0666 & (~$this->umask));
if (file_put_contents($tmpFile, $content) !== false) {
@chmod($tmpFile, 0666 & (~$this->umask));
if (@rename($tmpFile, $filename)) {
return true;
}
@unlink($tmpFile);
}
return false;
}
/**
* @return Iterator<string, SplFileInfo>
*/
private function getIterator(): Iterator
{
return new RecursiveIteratorIterator(
Arguments
"/home/rogermil/public_html/cache/doctrine/6974d72a/32"
"swap"
/home/rogermil/public_html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/FilesystemCache.php
}
fclose($resource);
return $lifetime === 0 || $lifetime > time();
}
/**
* {@inheritdoc}
*/
protected function doSave($id, $data, $lifeTime = 0)
{
if ($lifeTime > 0) {
$lifeTime = time() + $lifeTime;
}
$data = serialize($data);
$filename = $this->getFilename($id);
return $this->writeFile($filename, $lifeTime . PHP_EOL . $data);
}
}
Arguments
"/home/rogermil/public_html/cache/doctrine/6974d72a/32/672d36393734643732615b64313461383032326230383566396566313964343739636264643538313132375d5b315d.doctrinecache.data"
"""
1712261925\n
O:22:"Grav\Common\Page\Types":3:{s:8:"\x00*\x00items";a:23:{s:12:"flex-objects";a:1:{i:0;s:36:"blueprints://pages/flex-objects.yaml";}s:4:"root";a:1:{i:0;s:28:"blueprints://pages/root.yaml";}s:7:"default";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:17:"partials/security";a:1:{i:0;s:41:"blueprints://pages/partials/security.yaml";}s:8:"external";a:1:{i:0;s:32:"blueprints://pages/external.yaml";}s:7:"modular";a:1:{i:0;s:31:"blueprints://pages/modular.yaml";}s:4:"blog";a:1:{i:0;s:28:"theme://blueprints/blog.yaml";}s:5:"error";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:20:"simplesearch_results";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:8:"snipcart";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:4:"item";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:7:"archive";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:8:"formdata";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:11:"modular_alt";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:15:"modular/contact";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:14:"modular/footer";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:12:"modular/text";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:17:"modular/portfolio";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:12:"modular/team";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:16:"modular/showcase";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:12:"modular/form";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:16:"modular/features";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:14:"modular/bottom";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}}s:19:"\x00*\x00systemBlueprints";a:6:{s:12:"flex-objects";s:36:"blueprints://pages/flex-objects.yaml";s:4:"root";s:28:"blueprints://pages/root.yaml";s:7:"default";s:31:"blueprints://pages/default.yaml";s:17:"partials/security";s:41:"blueprints://pages/partials/security.yaml";s:8:"external";s:32:"blueprints://pages/external.yaml";s:7:"modular";s:31:"blueprints://pages/modular.yaml";}s:37:"\x00Grav\Common\Page\Types\x00iteratorUnset";b:0;}
"""
/home/rogermil/public_html/vendor/doctrine/cache/lib/Doctrine/Common/Cache/CacheProvider.php
$namespacedKeysAndValues[$this->getNamespacedId($key)] = $value;
}
return $this->doSaveMultiple($namespacedKeysAndValues, $lifetime);
}
/**
* {@inheritdoc}
*/
public function contains($id)
{
return $this->doContains($this->getNamespacedId($id));
}
/**
* {@inheritdoc}
*/
public function save($id, $data, $lifeTime = 0)
{
return $this->doSave($this->getNamespacedId($id), $data, $lifeTime);
}
/**
* {@inheritdoc}
*/
public function deleteMultiple(array $keys)
{
return $this->doDeleteMultiple(array_map([$this, 'getNamespacedId'], $keys));
}
/**
* {@inheritdoc}
*/
public function delete($id)
{
return $this->doDelete($this->getNamespacedId($id));
}
/**
* {@inheritdoc}
Arguments
"g-6974d72a[d14a8022b085f9ef19d479cbdd581127][1]"
"O:22:"Grav\Common\Page\Types":3:{s:8:"\x00*\x00items";a:23:{s:12:"flex-objects";a:1:{i:0;s:36:"blueprints://pages/flex-objects.yaml";}s:4:"root";a:1:{i:0;s:28:"blueprints://pages/root.yaml";}s:7:"default";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:17:"partials/security";a:1:{i:0;s:41:"blueprints://pages/partials/security.yaml";}s:8:"external";a:1:{i:0;s:32:"blueprints://pages/external.yaml";}s:7:"modular";a:1:{i:0;s:31:"blueprints://pages/modular.yaml";}s:4:"blog";a:1:{i:0;s:28:"theme://blueprints/blog.yaml";}s:5:"error";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:20:"simplesearch_results";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:8:"snipcart";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:4:"item";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:7:"archive";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:8:"formdata";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:11:"modular_alt";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:15:"modular/contact";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:14:"modular/footer";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:12:"modular/text";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:17:"modular/portfolio";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:12:"modular/team";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:16:"modular/showcase";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:12:"modular/form";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:16:"modular/features";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}s:14:"modular/bottom";a:1:{i:0;s:31:"blueprints://pages/default.yaml";}}s:19:"\x00*\x00systemBlueprints";a:6:{s:12:"flex-objects";s:36:"blueprints://pages/flex-objects.yaml";s:4:"root";s:28:"blueprints://pages/root.yaml";s:7:"default";s:31:"blueprints://pages/default.yaml";s:17:"partials/security";s:41:"blueprints://pages/partials/security.yaml";s:8:"external";s:32:"blueprints://pages/external.yaml";s:7:"modular";s:31:"blueprints://pages/modular.yaml";}s:37:"\x00Grav\Common\Page\Types\x00iteratorUnset";b:0;}"
1712261925
/home/rogermil/public_html/system/src/Grav/Common/Cache.php
return $this->driver->fetch($id);
}
return false;
}
/**
* Stores a new cached entry.
*
* @param string $id the id of the cached entry
* @param array|object|int $data the data for the cached entry to store
* @param int|null $lifetime the lifetime to store the entry in seconds
*/
public function save($id, $data, $lifetime = null)
{
if ($this->enabled) {
if ($lifetime === null) {
$lifetime = $this->getLifetime();
}
$this->driver->save($id, $data, $lifetime);
}
}
/**
* Deletes an item in the cache based on the id
*
* @param string $id the id of the cached data entry
* @return bool true if the item was deleted successfully
*/
public function delete($id)
{
if ($this->enabled) {
return $this->driver->delete($id);
}
return false;
}
/**
* Deletes all cache
Arguments
"d14a8022b085f9ef19d479cbdd581127"
Grav\Common\Page\Types {#184}
604800
/home/rogermil/public_html/system/src/Grav/Common/Page/Pages.php
// Scan templates
$event = new Event();
$event->types = $types;
$grav->fireEvent('onGetPageTemplates', $event);
$types->scanTemplates('theme://templates/');
};
if ($grav['config']->get('system.cache.enabled')) {
/** @var Cache $cache */
$cache = $grav['cache'];
// Use cached types if possible.
$types_cache_id = md5('types');
$types = $cache->fetch($types_cache_id);
if (!$types instanceof Types) {
$types = new Types();
$scanBlueprintsAndTemplates($types);
$cache->save($types_cache_id, $types);
}
} else {
$types = new Types();
$scanBlueprintsAndTemplates($types);
}
// Register custom paths to the locator.
$locator = $grav['locator'];
foreach ($types as $type => $paths) {
foreach ($paths as $k => $path) {
if (strpos($path, 'blueprints://') === 0) {
unset($paths[$k]);
}
}
if ($paths) {
$locator->addPath('blueprints', "pages/$type.yaml", $paths);
}
}
self::$types = $types;
Arguments
"d14a8022b085f9ef19d479cbdd581127"
Grav\Common\Page\Types {#184}
/home/rogermil/public_html/system/src/Grav/Common/Page/Pages.php
}
if ($paths) {
$locator->addPath('blueprints', "pages/$type.yaml", $paths);
}
}
self::$types = $types;
}
return self::$types;
}
/**
* Get available page types.
*
* @return array
*/
public static function types()
{
$types = self::getTypes();
return $types->pageSelect();
}
/**
* Get available page types.
*
* @return array
*/
public static function modularTypes()
{
$types = self::getTypes();
return $types->modularSelect();
}
/**
* Get template types based on page type (standard or modular)
*
* @param string|null $type
/home/rogermil/public_html/user/plugins/admin/admin.php
* @return bool
*/
public function isAdminPath()
{
$route = $this->uri->route();
return $route === $this->base || 0 === strpos($route, $this->base . '/');
}
/**
* Helper function to replace Pages::Types() and to provide an event to manipulate the data
*
* Dispatches 'onAdminPageTypes' event with 'types' data member which is a reference to the data
*
* @param bool $keysOnly
* @return array
*/
public static function pagesTypes(bool $keysOnly = false)
{
$types = Pages::types();
// First filter by configuration
$hideTypes = (array)Grav::instance()['config']->get('plugins.admin.hide_page_types');
foreach ($hideTypes as $hide) {
if (isset($types[$hide])) {
unset($types[$hide]);
} else {
foreach ($types as $key => $type) {
$match = preg_match('#' . $hide . '#i', $key);
if ($match) {
unset($types[$key]);
}
}
}
}
// Allow manipulating of the data by event
$e = new Event(['types' => &$types]);
Grav::instance()->fireEvent('onAdminPageTypes', $e);
/home/rogermil/public_html/system/src/Grav/Common/Data/Blueprint.php
{
$params = $call['params'];
if (is_array($params)) {
$function = array_shift($params);
} else {
$function = $params;
$params = [];
}
[$o, $f] = explode('::', $function, 2);
$data = null;
if (!$f) {
if (function_exists($o)) {
$data = call_user_func_array($o, $params);
}
} else {
if (method_exists($o, $f)) {
$data = call_user_func_array([$o, $f], $params);
}
}
// If function returns a value,
if (null !== $data) {
if (is_array($data) && isset($field[$property]) && is_array($field[$property])) {
// Combine field and @data-field together.
$field[$property] += $data;
} else {
// Or create/replace field with @data-field.
$field[$property] = $data;
}
}
}
/**
* @param array $field
* @param string $property
* @param array $call
* @return void
Arguments
/home/rogermil/public_html/system/src/Grav/Common/Data/Blueprint.php
$current = [$field => []];
} elseif (!isset($current[$field])) {
$current[$field] = [];
}
$current = &$current[$field];
}
}
// Set dynamic property.
foreach ($data as $property => $call) {
$action = $call['action'];
$method = 'dynamic' . ucfirst($action);
$call['object'] = $this->object;
if (isset($this->handlers[$action])) {
$callable = $this->handlers[$action];
$callable($current, $property, $call);
} elseif (method_exists($this, $method)) {
$this->{$method}($current, $property, $call);
}
}
}
return $this;
}
/**
* Extend blueprint with another blueprint.
*
* @param BlueprintForm|array $extends
* @param bool $append
* @return $this
*/
public function extend($extends, $append = false)
{
parent::extend($extends, $append);
$this->deepInit($this->items);
Arguments
array:9 [
"type" => "select"
"size" => "large"
"label" => "PLUGIN_ADMIN.HIDE_PAGE_TYPES"
"classes" => "fancy"
"multiple" => true
"array" => true
"selectize" => array:1 [
"create" => true
]
"data-options@" => array:2 [
0 => "\Grav\Plugin\AdminPlugin::pagesTypes"
1 => true
]
"name" => "hide_page_types"
]
"options"
array:3 [
"action" => "data"
"params" => array:2 [
0 => "\Grav\Plugin\AdminPlugin::pagesTypes"
1 => true
]
"object" => null
]
/home/rogermil/public_html/system/src/Grav/Common/Data/Blueprints.php
/**
* Load blueprint file.
*
* @param string $name Name of the blueprint.
* @return Blueprint
*/
protected function loadFile($name)
{
$blueprint = new Blueprint($name);
if (is_array($this->search) || is_object($this->search)) {
// Page types.
$blueprint->setOverrides($this->search);
$blueprint->setContext('blueprints://pages');
} else {
$blueprint->setContext($this->search);
}
try {
$blueprint->load()->init();
} catch (RuntimeException $e) {
$log = Grav::instance()['log'];
$log->error(sprintf('Blueprint %s cannot be loaded: %s', $name, $e->getMessage()));
throw $e;
}
return $blueprint;
}
}
/home/rogermil/public_html/system/src/Grav/Common/Data/Blueprints.php
/**
* @param string|array $search Search path.
*/
public function __construct($search = 'blueprints://')
{
$this->search = $search;
}
/**
* Get blueprint.
*
* @param string $type Blueprint type.
* @return Blueprint
* @throws RuntimeException
*/
public function get($type)
{
if (!isset($this->instances[$type])) {
$blueprint = $this->loadFile($type);
$this->instances[$type] = $blueprint;
}
return $this->instances[$type];
}
/**
* Get all available blueprint types.
*
* @return array List of type=>name
*/
public function types()
{
if ($this->types === null) {
$this->types = [];
$grav = Grav::instance();
/** @var UniformResourceLocator $locator */
$locator = $grav['locator'];
Arguments
/home/rogermil/public_html/system/src/Grav/Common/Plugins.php
}
if ($result) {
$list[$name] = $result;
}
}
return $list;
}
/**
* Get a plugin by name
*
* @param string $name
* @return Data|null
*/
public static function get($name)
{
$blueprints = new Blueprints('plugins://');
$blueprint = $blueprints->get("{$name}/blueprints");
// Load default configuration.
$file = CompiledYamlFile::instance("plugins://{$name}/{$name}" . YAML_EXT);
// ensure this is a valid plugin
if (!$file->exists()) {
return null;
}
$obj = new Data((array)$file->content(), $blueprint);
// Override with user configuration.
$obj->merge(Grav::instance()['config']->get('plugins.' . $name) ?: []);
// Save configuration always to user/config.
$file = CompiledYamlFile::instance("config://plugins/{$name}.yaml");
$obj->file($file);
return $obj;
}
Arguments
/home/rogermil/public_html/system/src/Grav/Common/Plugin.php
if (null === $this->blueprint) {
$this->loadBlueprint();
\assert($this->blueprint instanceof Blueprint);
}
return $this->blueprint;
}
/**
* Load blueprints.
*
* @return void
*/
protected function loadBlueprint()
{
if (null === $this->blueprint) {
$grav = Grav::instance();
/** @var Plugins $plugins */
$plugins = $grav['plugins'];
$data = $plugins->get($this->name);
\assert($data !== null);
$this->blueprint = $data->blueprints();
}
}
}
Arguments
/home/rogermil/public_html/system/src/Grav/Common/Plugin.php
$value = $header->get("$plugin.$var");
if (isset($value)) {
return $value;
}
$page = $page->parent();
}
}
return Grav::instance()['config']->get("plugins.$plugin.$var", $default);
}
/**
* Simpler getter for the plugin blueprint
*
* @return Blueprint
*/
public function getBlueprint()
{
if (null === $this->blueprint) {
$this->loadBlueprint();
\assert($this->blueprint instanceof Blueprint);
}
return $this->blueprint;
}
/**
* Load blueprints.
*
* @return void
*/
protected function loadBlueprint()
{
if (null === $this->blueprint) {
$grav = Grav::instance();
/** @var Plugins $plugins */
$plugins = $grav['plugins'];
$data = $plugins->get($this->name);
\assert($data !== null);
$this->blueprint = $data->blueprints();
/home/rogermil/public_html/user/plugins/admin/admin.php
{
// Only activate admin if we're inside the admin path.
if ($this->active) {
$this->initializeAdmin();
}
// Always initialize popularity.
$this->popularity = new Popularity();
}
/**
* [onRequestHandlerInit:100000]
*
* @param RequestHandlerEvent $event
* @return void
*/
public function onRequestHandlerInit(RequestHandlerEvent $event)
{
// Store this version.
$this->version = $this->getBlueprint()->get('version');
$route = $event->getRoute();
$base = $route->getRoute(0, 1);
if ($base === $this->base) {
/** @var Debugger $debugger */
$debugger = $this->grav['debugger'];
$debugger->addMessage('Admin v' . $this->version);
$event->addMiddleware('admin_router', new Router($this->grav, $this->admin));
}
}
/**
* @param Event $event
* @return void
*/
public function onAdminControllerInit(Event $event): void
{
$eventController = $event['controller'];
/home/rogermil/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
Grav\Common\Processors\Events\RequestHandlerEvent {#179}
"onRequestHandlerInit"
Symfony\Component\EventDispatcher\EventDispatcher {#138
-listeners: array:38 [
"onPluginsInitialized" => array:7 [
100002 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "autoload"
]
]
100001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "onPluginsInitialized"
]
]
100000 => array:3 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "setup"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "autoload"
]
2 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "autoload"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "initializeSession"
]
]
1001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onPluginsInitialized"
]
]
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "initializeLogin"
]
]
0 => array:4 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#91}
1 => "onPluginsInitialized"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onPluginsInitialized"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onPluginsInitialized"
]
3 => array:2 [
0 => Grav\Plugin\GanalyticsPlugin {#99}
1 => "onPluginsInitialized"
]
]
]
"onRequestHandlerInit" => array:1 [
100000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onRequestHandlerInit"
]
]
]
"onFormRegisterTypes" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onFormRegisterTypes"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onFormRegisterTypes"
]
]
]
"onPageInitialized" => array:2 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onPageInitialized"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "authorizePage"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onPageInitialized"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "authorizePage"
]
]
]
"onShutdown" => array:1 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onShutdown"
]
]
]
"Grav\Events\PermissionsRegisterEvent" => array:2 [
1000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onRegisterPermissions"
]
]
100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onRegisterPermissions"
]
]
]
"onFormProcessed" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#91}
1 => "onFormProcessed"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "onFormProcessed"
]
]
]
"onTwigTemplatePaths" => array:2 [
0 => array:4 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#91}
1 => "onTwigTemplatePaths"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onTwigTemplatePaths"
]
2 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "onTwigTemplatePaths"
]
3 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onTwigTemplatePaths"
]
]
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#96}
1 => "onTwigTemplatePaths"
]
]
]
"onSchedulerInitialized" => array:1 [
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\EmailPlugin {#91}
1 => "onSchedulerInitialized"
]
1 => array:2 [
0 => Grav\Common\Cache {#160}
1 => "onSchedulerInitialized"
]
]
]
"onCliInitialize" => array:2 [
100000 => array:2 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#96}
1 => "autoload"
]
1 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "autoload"
]
]
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "initializeFlex"
]
]
]
"onPageNotFound" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#96}
1 => "onPageNotFound"
]
]
]
"onGetPageTemplates" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#96}
1 => "onGetPageTemplates"
]
]
]
"Grav\Events\PluginsLoadedEvent" => array:1 [
10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "initializeFlex"
]
]
]
"Grav\Events\FlexRegisterEvent" => array:1 [
100 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onRegisterFlex"
]
]
]
"onAssetsInitialized" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\GanalyticsPlugin {#99}
1 => "onAssetsInitialized"
]
]
]
"onTask.login.login" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "loginController"
]
]
]
"onTask.login.twofa" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "loginController"
]
]
]
"onTask.login.forgot" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "loginController"
]
]
]
"onTask.login.logout" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "loginController"
]
]
]
"onTask.login.reset" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "loginController"
]
]
]
"onTask.login.regenerate2FASecret" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "loginController"
]
]
]
"onPagesInitialized" => array:2 [
0 => array:3 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "storeReferrerPage"
]
1 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "pageVisibility"
]
2 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onPagesInitialized"
]
]
-10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onPagesInitialized"
]
]
]
"onPageFallBackUrl" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "authorizeFallBackUrl"
]
]
]
"onTwigSiteVariables" => array:2 [
-100000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "onTwigSiteVariables"
]
]
0 => array:2 [
0 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#101}
1 => "onTwigSiteVariables"
]
1 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onTwigVariables"
]
]
]
"onUserLoginAuthenticate" => array:4 [
10002 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLoginAuthenticateByRegistration"
]
]
10001 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLoginAuthenticateByRememberMe"
]
]
10000 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLoginAuthenticateByEmail"
]
]
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLoginAuthenticate"
]
]
]
"onUserLoginAuthorize" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLoginAuthorize"
]
]
]
"onUserLoginFailure" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLoginFailure"
]
]
]
"onUserLogin" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLogin"
]
]
]
"onUserLogout" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "userLogout"
]
]
]
"onMarkdownInitialized" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\MarkdownNoticesPlugin {#101}
1 => "onMarkdownInitialized"
]
]
]
"onFatalException" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "onFatalException"
]
]
]
"onAdminGenerateReports" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "onAdminGenerateReports"
]
]
]
"onBeforeFlexFormInitialize" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onBeforeFlexFormInitialize"
]
]
]
"onPageTask" => array:1 [
-10 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onPageTask"
]
]
]
"onPageProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onPageProcessed"
]
]
]
"onTwigInitialized" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onTwigInitialized"
]
]
]
"onTwigPageVariables" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onTwigVariables"
]
]
]
"onFormValidationProcessed" => array:1 [
0 => array:1 [
0 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onFormValidationProcessed"
]
]
]
]
-sorted: array:4 [
"Grav\Events\PluginsLoadedEvent" => array:1 [
0 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "initializeFlex"
]
]
"onPluginsInitialized" => array:12 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "autoload"
]
1 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "onPluginsInitialized"
]
2 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "setup"
]
3 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "autoload"
]
4 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "autoload"
]
5 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "initializeSession"
]
6 => array:2 [
0 => Grav\Plugin\AdminPlugin {#93}
1 => "onPluginsInitialized"
]
7 => array:2 [
0 => Grav\Plugin\LoginPlugin {#100}
1 => "initializeLogin"
]
8 => array:2 [
0 => Grav\Plugin\EmailPlugin {#91}
1 => "onPluginsInitialized"
]
9 => array:2 [
0 => Grav\Plugin\FlexObjectsPlugin {#97}
1 => "onPluginsInitialized"
]
10 => array:2 [
0 => Grav\Plugin\FormPlugin {#98}
1 => "onPluginsInitialized"
]
11 => array:2 [
0 => Grav\Plugin\GanalyticsPlugin {#99}
1 => "onPluginsInitialized"
]
]
"onGetPageTemplates" => array:1 [
0 => array:2 [
0 => Grav\Plugin\ErrorPlugin {#96}
1 => "onGetPageTemplates"
]
]
"onFatalException" => array:1 [
0 => array:2 [
0 => Grav\Plugin\ProblemsPlugin {#102}
1 => "onFatalException"
]
]
]
-optimized: array:5 [
"Grav\Events\PluginsLoadedEvent" => array:1 [
0 => Grav\Plugin\FlexObjectsPlugin::initializeFlex(): void {#132 …4}
]
"onPluginsInitialized" => array:12 [
0 => Grav\Plugin\ProblemsPlugin::autoload() {#147 …3}
1 => Grav\Plugin\ProblemsPlugin::onPluginsInitialized() {#148 …3}
2 => Grav\Plugin\AdminPlugin::setup() {#149 …3}
3 => Grav\Plugin\FormPlugin::autoload() {#150 …3}
4 => Grav\Plugin\LoginPlugin::autoload(): ClassLoader {#151 …4}
5 => Grav\Plugin\LoginPlugin::initializeSession() {#152 …3}
6 => Grav\Plugin\AdminPlugin::onPluginsInitialized() {#153 …3}
7 => Grav\Plugin\LoginPlugin::initializeLogin() {#154 …3}
8 => Grav\Plugin\EmailPlugin::onPluginsInitialized() {#155 …3}
9 => Grav\Plugin\FlexObjectsPlugin::onPluginsInitialized(): void {#156 …4}
10 => Grav\Plugin\FormPlugin::onPluginsInitialized() {#157 …3}
11 => Grav\Plugin\GanalyticsPlugin::onPluginsInitialized() {#158 …3}
]
"onRequestHandlerInit" => array:1 [
0 => Grav\Plugin\AdminPlugin::onRequestHandlerInit(RequestHandlerEvent $event) {#180 …3}
]
"onGetPageTemplates" => array:1 [
0 => Grav\Plugin\ErrorPlugin::onGetPageTemplates(Event $event) {#185 …3}
]
"onFatalException" => array:1 [
0 => Grav\Plugin\ProblemsPlugin::onFatalException() {#181 …3}
]
]
}
/home/rogermil/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:1 [
0 => Grav\Plugin\AdminPlugin::onRequestHandlerInit(RequestHandlerEvent $event) {#180 …3}
]
"onRequestHandlerInit"
Grav\Common\Processors\Events\RequestHandlerEvent {#179}
/home/rogermil/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:1 [
0 => Grav\Plugin\AdminPlugin::onRequestHandlerInit(RequestHandlerEvent $event) {#180 …3}
]
"onRequestHandlerInit"
Grav\Common\Processors\Events\RequestHandlerEvent {#179}
/home/rogermil/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
Grav\Common\Processors\Events\RequestHandlerEvent {#179}
"onRequestHandlerInit"
/home/rogermil/public_html/system/src/Grav/Common/Processors/RequestProcessor.php
$this->startTimer();
$header = $request->getHeaderLine('Content-Type');
$type = trim(strstr($header, ';', true) ?: $header);
if ($type === 'application/json') {
$request = $request->withParsedBody(json_decode($request->getBody()->getContents(), true));
}
$uri = $request->getUri();
$ext = mb_strtolower(Utils::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
"onRequestHandlerInit"
Grav\Common\Processors\Events\RequestHandlerEvent {#179}
/home/rogermil/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
protected $handler;
/** @var ContainerInterface|null */
protected $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 {#177}
Grav\Framework\RequestHandler\RequestHandler {#175}
/home/rogermil/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 {#62}
/home/rogermil/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 {#62}
/home/rogermil/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
protected $handler;
/** @var ContainerInterface|null */
protected $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 {#62}
Grav\Framework\RequestHandler\RequestHandler {#170}
/home/rogermil/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 {#62}
/home/rogermil/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 {#62}
/home/rogermil/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
protected $handler;
/** @var ContainerInterface|null */
protected $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 {#62}
Grav\Framework\RequestHandler\RequestHandler {#145}
/home/rogermil/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 {#62}
/home/rogermil/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 {#62}
/home/rogermil/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/rogermil/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/rogermil/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
protected $handler;
/** @var ContainerInterface|null */
protected $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 {#62}
Grav\Framework\RequestHandler\RequestHandler {#88}
/home/rogermil/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 {#62}
/home/rogermil/public_html/system/src/Grav/Framework/RequestHandler/Middlewares/MultipartRequestSupport.php
use function in_array;
use function is_array;
use function strlen;
/**
* Multipart request support for PUT and PATCH.
*/
class MultipartRequestSupport implements MiddlewareInterface
{
/**
* @param ServerRequestInterface $request
* @param RequestHandlerInterface $handler
* @return ResponseInterface
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$contentType = $request->getHeaderLine('content-type');
$method = $request->getMethod();
if (!str_starts_with($contentType, 'multipart/form-data') || !in_array($method, ['PUT', 'PATH'], true)) {
return $handler->handle($request);
}
$boundary = explode('; boundary=', $contentType, 2)[1] ?? '';
$parts = explode("--{$boundary}", $request->getBody()->getContents());
$parts = array_slice($parts, 1, count($parts) - 2);
$params = [];
$files = [];
foreach ($parts as $part) {
$this->processPart($params, $files, $part);
}
return $handler->handle($request->withParsedBody($params)->withUploadedFiles($files));
}
/**
* @param array $params
* @param array $files
* @param string $part
* @return void
Arguments
Nyholm\Psr7\ServerRequest {#62}
/home/rogermil/public_html/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php
protected $handler;
/** @var ContainerInterface|null */
protected $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 {#62}
Grav\Framework\RequestHandler\RequestHandler {#86}
/home/rogermil/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 {#62}
/home/rogermil/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 {#62}
/home/rogermil/public_html/index.php
// Register the auto-loader.
$loader = require $autoload;
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());
// Set internal encoding.
@ini_set('default_charset', 'UTF-8');
mb_internal_encoding('UTF-8');
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|\Exception $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;
}