/home/meizunew/larenc/vendor/symfony/yaml/Parser.php
if ('' === trim($line)) {
$previousLineWasNewline = true;
$previousLineWasTerminatedWithBackslash = false;
} elseif ('\\' === substr($line, -1)) {
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = true;
} else {
$previousLineWasNewline = false;
$previousLineWasTerminatedWithBackslash = false;
}
}
try {
return Inline::parse(trim($value));
} catch (ParseException $e) {
// fall-through to the ParseException thrown below
}
}
throw new ParseException('Unable to parse.', $this->getRealCurrentLineNb() + 1, $this->currentLine, $this->filename);
}
} while ($this->moveToNextLine());
if (null !== $tag) {
$data = new TaggedValue($tag, $data);
}
if (Yaml::PARSE_OBJECT_FOR_MAP & $flags && !\is_object($data) && 'mapping' === $context) {
$object = new \stdClass();
foreach ($data as $key => $value) {
$object->$key = $value;
}
$data = $object;
}
return empty($data) ? null : $data;
}
Arguments
"Unable to parse at line 2 (near "45")."
/home/meizunew/larenc/vendor/symfony/yaml/Parser.php
* @throws ParseException If the YAML is not valid
*/
public function parse(string $value, int $flags = 0)
{
if (false === preg_match('//u', $value)) {
throw new ParseException('The YAML value does not appear to be valid UTF-8.', -1, null, $this->filename);
}
$this->refs = [];
$mbEncoding = null;
$data = null;
if (2 /* MB_OVERLOAD_STRING */ & (int) ini_get('mbstring.func_overload')) {
$mbEncoding = mb_internal_encoding();
mb_internal_encoding('UTF-8');
}
try {
$data = $this->doParse($value, $flags);
} finally {
if (null !== $mbEncoding) {
mb_internal_encoding($mbEncoding);
}
$this->lines = [];
$this->currentLine = '';
$this->refs = [];
$this->skippedLineNumbers = [];
$this->locallySkippedLineNumbers = [];
}
return $data;
}
/**
* @internal
*
* @return int
*/
public function getLastLineNumberBeforeDeprecation(): int
Arguments
/home/meizunew/larenc/vendor/symfony/yaml/Yaml.php
* Parses YAML into a PHP value.
*
* Usage:
* <code>
* $array = Yaml::parse(file_get_contents('config.yml'));
* print_r($array);
* </code>
*
* @param string $input A string containing YAML
* @param int $flags A bit field of PARSE_* constants to customize the YAML parser behavior
*
* @return mixed The YAML converted to a PHP value
*
* @throws ParseException If the YAML is not valid
*/
public static function parse(string $input, int $flags = 0)
{
$yaml = new Parser();
return $yaml->parse($input, $flags);
}
/**
* Dumps a PHP value to a YAML string.
*
* The dump method, when supplied with an array, will do its best
* to convert the array into friendly YAML.
*
* @param mixed $input The PHP value
* @param int $inline The level where you switch to inline YAML
* @param int $indent The amount of spaces to use for indentation of nested nodes
* @param int $flags A bit field of DUMP_* constants to customize the dumped YAML string
*
* @return string A YAML string representing the original PHP value
*/
public static function dump($input, int $inline = 2, int $indent = 4, int $flags = 0): string
{
$yaml = new Dumper($indent);
return $yaml->dump($input, $inline, 0, $flags);
Arguments
"""
/error: 1\n
45\n
/: 490\n
/statistiques/statistiques-rencontres-mars-2020: 66\n
/a-propos: 83\n
/home/sites-de-rencontres-en-france: 102\n
/sites-internet/1tense: 142\n
/applications: 73\n
/sites-internet/meetic: 111\n
/sites-internet/disons-demain: 114\n
/statistiques: 81\n
/statistiques/statistiques-rencontres-aout-2020: 69\n
/home/sites-de-rencontres-serieux: 103\n
/sites-internet: 72\n
/liens: 84\n
/statistiques/tendance-sites-de-rencontres-en-2020: 76\n
"""
0
/home/meizunew/larenc/user/plugins/count-views/count-views.php
]);
}
// This loads the existing data into Twig
public function onPagesInitialized(Event $e)
{
// Get count data file
$config = $this->grav['config'];
$locator = $this->grav['locator'];
$path = $locator->findResource('user://data', true);
$path .= DS.static::sanitize($this->grav['config']->get('plugins.count-views.datafile'));
// Get page route
$page = $this->grav['page'];
$route = $page->route();
if (empty($route)) $route = $this->config->get('plugins.error.routes.404', '/error');
// Open data file
$datafh = File::instance($path);
$data = Yaml::parse($datafh->content());
$datafh->free();
// Load count data into a twig variable
$this->grav['twig']->twig_vars['viewcounts'] = $data;
}
// This increments the counter
public function onPageInitialized(Event $e)
{
// Get count data file
$config = $this->grav['config'];
$locator = $this->grav['locator'];
$path = $locator->findResource('user://data', true);
$path .= DS.static::sanitize($this->grav['config']->get('plugins.count-views.datafile'));
// Get page route
$page = $this->grav['page'];
$route = $page->route();
if (empty($route)) $route = $this->config->get('plugins.error.routes.404', '/error');
Arguments
"""
/error: 1\n
45\n
/: 490\n
/statistiques/statistiques-rencontres-mars-2020: 66\n
/a-propos: 83\n
/home/sites-de-rencontres-en-france: 102\n
/sites-internet/1tense: 142\n
/applications: 73\n
/sites-internet/meetic: 111\n
/sites-internet/disons-demain: 114\n
/statistiques: 81\n
/statistiques/statistiques-rencontres-aout-2020: 69\n
/home/sites-de-rencontres-serieux: 103\n
/sites-internet: 72\n
/liens: 84\n
/statistiques/tendance-sites-de-rencontres-en-2020: 76\n
"""
/home/meizunew/larenc/vendor/symfony/event-dispatcher/EventDispatcher.php
}
}
/**
* 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 Event $event The event object to pass to the event handlers/listeners
*/
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.
*
* @param string $eventName The name of the event
*/
private function sortListeners($eventName)
{
krsort($this->listeners[$eventName]);
$this->sorted[$eventName] = [];
foreach ($this->listeners[$eventName] as $priority => $listeners) {
foreach ($listeners as $k => $listener) {
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
$listener[0] = $listener[0]();
$this->listeners[$eventName][$priority][$k] = $listener;
}
$this->sorted[$eventName][] = $listener;
Arguments
Event {#234}
"onPagesInitialized"
EventDispatcher {#135}
/home/meizunew/larenc/vendor/symfony/event-dispatcher/EventDispatcher.php
* @author Jordi Boggiano <j.boggiano@seld.be>
* @author Jordan Alliot <jordan.alliot@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*/
class EventDispatcher implements EventDispatcherInterface
{
private $listeners = [];
private $sorted = [];
/**
* {@inheritdoc}
*/
public function dispatch($eventName, Event $event = null)
{
if (null === $event) {
$event = new Event();
}
if ($listeners = $this->getListeners($eventName)) {
$this->doDispatch($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:5 [
0 => array:2 [
0 => LoginPlugin {#104}
1 => "storeReferrerPage"
]
1 => array:2 [
0 => LoginPlugin {#104}
1 => "pageVisibility"
]
2 => array:2 [
0 => CountViewsPlugin {#96}
1 => "onPagesInitialized"
]
3 => array:2 [
0 => FormPlugin {#103}
1 => "onPagesInitialized"
]
4 => array:2 [
0 => SimplesearchPlugin {#109}
1 => "onPagesInitialized"
]
]
"onPagesInitialized"
Event {#234}
/home/meizunew/larenc/vendor/rockettheme/toolbox/Event/src/EventDispatcher.php
use Symfony\Component\EventDispatcher\Event as BaseEvent;
use Symfony\Component\EventDispatcher\EventDispatcher as BaseEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Implements Symfony EventDispatcher interface.
*
* @package RocketTheme\Toolbox\Event
* @author RocketTheme
* @license MIT
*/
class EventDispatcher extends BaseEventDispatcher implements EventDispatcherInterface
{
public function dispatch($eventName, BaseEvent $event = null)
{
if (null === $event) {
$event = new Event();
}
return parent::dispatch($eventName, $event);
}
}
Arguments
"onPagesInitialized"
Event {#234}
/home/meizunew/larenc/system/src/Grav/Common/Grav.php
foreach ($values as $i => $value) {
header($key . ': ' . $value, $i === 0);
}
}
}
/**
* Fires an event with optional parameters.
*
* @param string $eventName
* @param Event $event
*
* @return Event
*/
public function fireEvent($eventName, Event $event = null)
{
/** @var EventDispatcher $events */
$events = $this['events'];
return $events->dispatch($eventName, $event);
}
/**
* Set the final content length for the page and flush the buffer
*
*/
public function shutdown()
{
// Prevent user abort allowing onShutdown event to run without interruptions.
if (\function_exists('ignore_user_abort')) {
@ignore_user_abort(true);
}
// Close the session allowing new requests to be handled.
if (isset($this['session'])) {
$this['session']->close();
}
if ($this['config']->get('system.debugger.shutdown.close_connection', true)) {
// Flush the response and close the connection to allow time consuming tasks to be performed without leaving
Arguments
"onPagesInitialized"
Event {#234}
/home/meizunew/larenc/system/src/Grav/Common/Processors/PagesProcessor.php
use Grav\Common\Page\Interfaces\PageInterface;
use RocketTheme\Toolbox\Event\Event;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class PagesProcessor extends ProcessorBase
{
public $id = 'pages';
public $title = 'Pages';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
// Dump Cache state
$this->container['debugger']->addMessage($this->container['cache']->getCacheStatus());
$this->container['pages']->init();
$this->container->fireEvent('onPagesInitialized', new Event(['pages' => $this->container['pages']]));
$this->container->fireEvent('onPageInitialized', new Event(['page' => $this->container['page']]));
/** @var PageInterface $page */
$page = $this->container['page'];
if (!$page->routable()) {
// If no page found, fire event
$event = new Event(['page' => $page]);
$event->page = null;
$event = $this->container->fireEvent('onPageNotFound', $event);
if (isset($event->page)) {
unset ($this->container['page']);
$this->container['page'] = $page = $event->page;
} else {
throw new \RuntimeException('Page Not Found', 404);
}
$this->addMessage("Routed to page {$page->rawRoute()} (type: {$page->template()}) [Not Found fallback]");
} else {
Arguments
"onPagesInitialized"
Event {#234}
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#226}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/TwigProcessor.php
*/
namespace Grav\Common\Processors;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class TwigProcessor extends ProcessorBase
{
public $id = 'twig';
public $title = 'Twig';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
$this->container['twig']->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#203}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/AssetsProcessor.php
namespace Grav\Common\Processors;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class AssetsProcessor extends ProcessorBase
{
public $id = '_assets';
public $title = 'Assets';
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
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#200}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/SchedulerProcessor.php
namespace Grav\Common\Processors;
use RocketTheme\Toolbox\Event\Event;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class SchedulerProcessor extends ProcessorBase
{
public $id = '_scheduler';
public $title = 'Scheduler';
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
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#170}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/BackupsProcessor.php
namespace Grav\Common\Processors;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class BackupsProcessor extends ProcessorBase
{
public $id = '_backups';
public $title = 'Backups';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
$backups = $this->container['backups'];
$backups->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#167}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/TasksProcessor.php
}
$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
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#165}
/home/meizunew/larenc/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
/home/meizunew/larenc/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
/home/meizunew/larenc/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
ServerRequest {#162}
RequestHandler {#160}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/ThemesProcessor.php
*/
namespace Grav\Common\Processors;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class ThemesProcessor extends ProcessorBase
{
public $id = 'themes';
public $title = 'Themes';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
$this->container['themes']->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#153}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/PluginsProcessor.php
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class PluginsProcessor extends ProcessorBase
{
public $id = 'plugins';
public $title = 'Plugins';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
// TODO: remove in 2.0.
$this->container['accounts'];
$this->container['plugins']->init();
$this->container->fireEvent('onPluginsInitialized');
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#134}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/InitializeProcessor.php
}
/** @var Uri $uri */
$uri = $this->container['uri'];
$uri->init();
// Redirect pages with trailing slash if configured to do so.
$path = $uri->path() ?: '/';
if ($path !== '/'
&& $config->get('system.pages.redirect_trailing_slash', false)
&& Utils::endsWith($path, '/')) {
$redirect = (string) $uri::getCurrentRoute()->toString();
$this->container->redirect($redirect);
}
$this->container->setLocale();
$this->stopTimer();
return $handler->handle($request);
}
public function processCli(): void
{
// Load configuration.
$this->container['config']->init();
$this->container['plugins']->setup();
// Disable debugger.
$this->container['debugger']->enabled(false);
// Set timezone, locale.
/** @var Config $config */
$config = $this->container['config'];
$timezone = $config->get('system.timezone');
if ($timezone) {
date_default_timezone_set($timezone);
}
$this->container->setLocale();
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#126}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/DebuggerProcessor.php
*/
namespace Grav\Common\Processors;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class DebuggerProcessor extends ProcessorBase
{
public $id = '_debugger';
public $title = 'Init Debugger';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
$this->container['debugger']->init();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#124}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/ErrorsProcessor.php
*/
namespace Grav\Common\Processors;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;
class ErrorsProcessor extends ProcessorBase
{
public $id = '_errors';
public $title = 'Error Handlers Reset';
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler) : ResponseInterface
{
$this->startTimer();
$this->container['errors']->resetHandlers();
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#112}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/LoggerProcessor.php
/** @var Config $config */
$config = $grav['config'];
switch ($config->get('system.log.handler', 'file')) {
case 'syslog':
$log = $grav['log'];
$log->popHandler();
$facility = $config->get('system.log.syslog.facility', 'local6');
$logHandler = new SyslogHandler('grav', $facility);
$formatter = new LineFormatter("%channel%.%level_name%: %message% %extra%");
$logHandler->setFormatter($formatter);
$log->pushHandler($logHandler);
break;
}
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#99}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Processors/ConfigurationProcessor.php
if ($config->get('versions') === null) {
$filename = GRAV_ROOT . '/user/config/versions.yaml';
if (!is_file($filename)) {
$versions = [
'core' => [
'grav' => [
'version' => GRAV_VERSION,
'history' => ['version' => GRAV_VERSION, 'date' => gmdate('Y-m-d H:i:s')]
]
]
];
$config->set('versions', $versions);
$file = new YamlFile($filename, new YamlFormatter(['inline' => 4]));
$file->save($versions);
}
}
$this->stopTimer();
return $handler->handle($request);
}
}
Arguments
/home/meizunew/larenc/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
ServerRequest {#68}
RequestHandler {#93}
/home/meizunew/larenc/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
/home/meizunew/larenc/system/src/Grav/Common/Grav.php
},
'debuggerAssetsProcessor' => function () {
return new DebuggerAssetsProcessor($this);
},
'renderProcessor' => function () {
return new RenderProcessor($this);
},
]
);
$default = function (ServerRequestInterface $request) {
return new Response(404, ['Expires' => 0, 'Cache-Control' => 'no-cache, no-store, must-revalidate'], 'Not Found');
};
/** @var Debugger $debugger */
$debugger = $this['debugger'];
$collection = new RequestHandler($this->middleware, $default, $container);
$response = $collection->handle($this['request']);
$body = $response->getBody();
// Handle ETag and If-None-Match headers.
if ($response->getHeaderLine('ETag') === '1') {
$etag = md5($body);
$response = $response->withHeader('ETag', $etag);
if ($this['request']->getHeaderLine('If-None-Match') === $etag) {
$response = $response->withStatus(304);
$body = '';
}
}
$this->header($response);
echo $body;
$debugger->render();
register_shutdown_function([$this, 'shutdown']);
}
Arguments
/home/meizunew/larenc/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;
}