Whoops \ Exception \ ErrorException (E_NOTICE)
Trying to access array offset on value of type bool Whoops\Exception\ErrorException thrown with message "Trying to access array offset on value of type bool" Stacktrace: #50 Whoops\Exception\ErrorException in /var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php:294 #49 Grav\Common\Debugger:deprecatedErrorHandler in /var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php:294 #48 Grav\Plugin\ExternalLinks:getImageSize in /var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php:122 #47 Grav\Plugin\ExternalLinks:Grav\Plugin\{closure} in [internal]:0 #46 preg_replace_callback in /var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php:45 #45 Grav\Plugin\ExternalLinks:render in /var/www/html/learn2/user/plugins/external_links/external_links.php:177 #44 Grav\Plugin\ExternalLinksPlugin:externalLinksFilter in /var/www/html/learn2/user/plugins/external_links/external_links.php:136 #43 Grav\Plugin\ExternalLinksPlugin:onPageContentProcessed in /var/www/html/learn2/vendor/symfony/event-dispatcher/EventDispatcher.php:264 #42 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /var/www/html/learn2/vendor/symfony/event-dispatcher/EventDispatcher.php:239 #41 Symfony\Component\EventDispatcher\EventDispatcher:callListeners in /var/www/html/learn2/vendor/symfony/event-dispatcher/EventDispatcher.php:73 #40 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /var/www/html/learn2/system/src/Grav/Common/Grav.php:556 #39 Grav\Common\Grav:fireEvent in /var/www/html/learn2/system/src/Grav/Common/Page/Page.php:792 #38 Grav\Common\Page\Page:content in /var/www/html/learn2/user/plugins/seo/seo.php:166 #37 Grav\Plugin\seoPlugin:onPageInitialized in /var/www/html/learn2/vendor/symfony/event-dispatcher/EventDispatcher.php:264 #36 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in /var/www/html/learn2/vendor/symfony/event-dispatcher/EventDispatcher.php:239 #35 Symfony\Component\EventDispatcher\EventDispatcher:callListeners in /var/www/html/learn2/vendor/symfony/event-dispatcher/EventDispatcher.php:73 #34 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in /var/www/html/learn2/system/src/Grav/Common/Grav.php:556 #33 Grav\Common\Grav:fireEvent in /var/www/html/learn2/system/src/Grav/Common/Processors/PagesProcessor.php:44 #32 Grav\Common\Processors\PagesProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #31 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #30 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/TwigProcessor.php:38 #29 Grav\Common\Processors\TwigProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #28 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #27 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/AssetsProcessor.php:39 #26 Grav\Common\Processors\AssetsProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #25 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #24 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/SchedulerProcessor.php:40 #23 Grav\Common\Processors\SchedulerProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #22 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #21 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/BackupsProcessor.php:39 #20 Grav\Common\Processors\BackupsProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #19 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #18 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/TasksProcessor.php:69 #17 Grav\Common\Processors\TasksProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #16 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #15 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/RequestProcessor.php:63 #14 Grav\Common\Processors\RequestProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #13 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #12 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/ThemesProcessor.php:38 #11 Grav\Common\Processors\ThemesProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #10 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #9 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/PluginsProcessor.php:39 #8 Grav\Common\Processors\PluginsProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #7 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #6 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Processors/InitializeProcessor.php:130 #5 Grav\Common\Processors\InitializeProcessor:Grav\Common\Processors\{closure} in /var/www/html/learn2/system/src/Grav/Common/Debugger.php:546 #4 Grav\Common\Debugger:profile in /var/www/html/learn2/system/src/Grav/Common/Processors/InitializeProcessor.php:131 #3 Grav\Common\Processors\InitializeProcessor:process in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:50 #2 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php:62 #1 Grav\Framework\RequestHandler\RequestHandler:handle in /var/www/html/learn2/system/src/Grav/Common/Grav.php:295 #0 Grav\Common\Grav:process in /var/www/html/learn2/index.php:58
Stack frames (51)
50
Whoops\Exception\ErrorException
/user/plugins/external_links/classes/ExternalLinks.php294
49
Grav\Common\Debugger deprecatedErrorHandler
/user/plugins/external_links/classes/ExternalLinks.php294
48
Grav\Plugin\ExternalLinks getImageSize
/user/plugins/external_links/classes/ExternalLinks.php122
47
Grav\Plugin\ExternalLinks Grav\Plugin\{closure}
[internal]0
46
preg_replace_callback
/user/plugins/external_links/classes/ExternalLinks.php45
45
Grav\Plugin\ExternalLinks render
/user/plugins/external_links/external_links.php177
44
Grav\Plugin\ExternalLinksPlugin externalLinksFilter
/user/plugins/external_links/external_links.php136
43
Grav\Plugin\ExternalLinksPlugin onPageContentProcessed
/vendor/symfony/event-dispatcher/EventDispatcher.php264
42
Symfony\Component\EventDispatcher\EventDispatcher doDispatch
/vendor/symfony/event-dispatcher/EventDispatcher.php239
41
Symfony\Component\EventDispatcher\EventDispatcher callListeners
/vendor/symfony/event-dispatcher/EventDispatcher.php73
40
Symfony\Component\EventDispatcher\EventDispatcher dispatch
/system/src/Grav/Common/Grav.php556
39
Grav\Common\Grav fireEvent
/system/src/Grav/Common/Page/Page.php792
38
Grav\Common\Page\Page content
/user/plugins/seo/seo.php166
37
Grav\Plugin\seoPlugin onPageInitialized
/vendor/symfony/event-dispatcher/EventDispatcher.php264
36
Symfony\Component\EventDispatcher\EventDispatcher doDispatch
/vendor/symfony/event-dispatcher/EventDispatcher.php239
35
Symfony\Component\EventDispatcher\EventDispatcher callListeners
/vendor/symfony/event-dispatcher/EventDispatcher.php73
34
Symfony\Component\EventDispatcher\EventDispatcher dispatch
/system/src/Grav/Common/Grav.php556
33
Grav\Common\Grav fireEvent
/system/src/Grav/Common/Processors/PagesProcessor.php44
32
Grav\Common\Processors\PagesProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
31
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
30
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/TwigProcessor.php38
29
Grav\Common\Processors\TwigProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
28
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
27
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/AssetsProcessor.php39
26
Grav\Common\Processors\AssetsProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
25
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
24
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/SchedulerProcessor.php40
23
Grav\Common\Processors\SchedulerProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
22
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
21
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/BackupsProcessor.php39
20
Grav\Common\Processors\BackupsProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
19
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
18
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/TasksProcessor.php69
17
Grav\Common\Processors\TasksProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
16
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
15
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/RequestProcessor.php63
14
Grav\Common\Processors\RequestProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
13
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
12
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/ThemesProcessor.php38
11
Grav\Common\Processors\ThemesProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
10
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
9
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/PluginsProcessor.php39
8
Grav\Common\Processors\PluginsProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
7
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
6
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Processors/InitializeProcessor.php130
5
Grav\Common\Processors\InitializeProcessor Grav\Common\Processors\{closure}
/system/src/Grav/Common/Debugger.php546
4
Grav\Common\Debugger profile
/system/src/Grav/Common/Processors/InitializeProcessor.php131
3
Grav\Common\Processors\InitializeProcessor process
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php50
2
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Framework/RequestHandler/Traits/RequestHandlerTrait.php62
1
Grav\Framework\RequestHandler\RequestHandler handle
/system/src/Grav/Common/Grav.php295
0
Grav\Common\Grav process
/index.php58
/var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php
        $width = 0;
        $height = 0;
 
        // Determine image dimensions based on "src" atrribute
        if ($imgNode->hasAttribute('src')) {
            $src = $imgNode->getAttribute('src');
 
            // Simple check if the URL is internal i.e. check if path exists
            $path = $_SERVER['DOCUMENT_ROOT'] . $src;
            if (realpath($path) && is_file($path)) {
                $size = @getimagesize($path);
            } else {
                // The URL is external; try to load it (default: 32 KB)
                $size = $this->getRemoteImageSize($src, $limit * 1024);
            }
        }
 
        // Read out width and height from <img> attributes
        $width = $imgNode->hasAttribute('width') ?
            $imgNode->getAttribute('width')  : $size[0];
        $height = $imgNode->hasAttribute('height') ?
            $imgNode->getAttribute('height')  : $size[1];
 
        // Get width and height from style attribute
        if ( $imgNode->hasAttribute('style') ) {
            $style = $imgNode->getAttribute('style');
 
            // Width
            if (preg_match('~width:\s*(\d+)([a-z]+)~i', $style, $matches)) {
                $width = $matches[1];
                // Convert unit to pixel
                if ( isset($units[$matches[2]]) ) {
                    $width *= $units[$matches[2]];
                }
            }
 
            // Height
            if (preg_match('~height:\s*(\d+)([a-z]+)~i', $style, $matches)) {
                $height = $matches[1];
                // Convert unit to pixel
Arguments
  1. "Trying to access array offset on value of type bool"
    
/var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php
        $width = 0;
        $height = 0;
 
        // Determine image dimensions based on "src" atrribute
        if ($imgNode->hasAttribute('src')) {
            $src = $imgNode->getAttribute('src');
 
            // Simple check if the URL is internal i.e. check if path exists
            $path = $_SERVER['DOCUMENT_ROOT'] . $src;
            if (realpath($path) && is_file($path)) {
                $size = @getimagesize($path);
            } else {
                // The URL is external; try to load it (default: 32 KB)
                $size = $this->getRemoteImageSize($src, $limit * 1024);
            }
        }
 
        // Read out width and height from <img> attributes
        $width = $imgNode->hasAttribute('width') ?
            $imgNode->getAttribute('width')  : $size[0];
        $height = $imgNode->hasAttribute('height') ?
            $imgNode->getAttribute('height')  : $size[1];
 
        // Get width and height from style attribute
        if ( $imgNode->hasAttribute('style') ) {
            $style = $imgNode->getAttribute('style');
 
            // Width
            if (preg_match('~width:\s*(\d+)([a-z]+)~i', $style, $matches)) {
                $width = $matches[1];
                // Convert unit to pixel
                if ( isset($units[$matches[2]]) ) {
                    $width *= $units[$matches[2]];
                }
            }
 
            // Height
            if (preg_match('~height:\s*(\d+)([a-z]+)~i', $style, $matches)) {
                $height = $matches[1];
                // Convert unit to pixel
/var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php
                    }
 
                    // Set rel="noopener noreferrer"
                    $rel = $a->hasAttribute('rel') ? $a->getAttribute('rel') : '';
                    $rel = array_filter(explode(' ', $rel));
 
                    $rel[] = 'noopener';
                    $rel[] = 'noreferrer';
                    $a->setAttribute('rel', implode(' ', array_unique($rel)));
 
                    // Add image class to <a> if it has at least one <img> child element
                    $imgs = $a->getElementsByTagName('img');
                    if ($imgs->length > 1) {
                        // Add "images" class to <a> element, if it has multiple child images
                        $classes[] = 'images';
                    } elseif ($imgs->length == 1) {
                        $imgNode = $imgs->item(0);
 
                        // Get image size
                        list($width, $height) = $this->getImageSize($imgNode);
 
                        // Determine maximum dimension of image size
                        $size = max($width, $height);
 
                        // Depending on size determine image type
                        $classes[] = ((0 < $size) && ($size <= 32)) ? 'icon' : 'image';
                    } else {
                        // Add "no-image" class to <a> element, if it has no child images
                        $classes[] = 'no-image';
                    }
 
                    // Add title (aka alert text)
                    if ($options->get('title')) {
                        $language = Grav::instance()['language'];
                        $message = $language->translate(['PLUGINS.EXTERNAL_LINKS.TITLE_MESSAGE']);
 
                        // Set default title to link else, set title as data attribute
                        $key = $a->hasAttribute('title') ? 'data-title' : 'title';
                        $a->setAttribute($key, $message);
                    }
[internal]
/var/www/html/learn2/user/plugins/external_links/classes/ExternalLinks.php
     */
 
    /** -------------
     * Public methods
     * --------------
     */
 
    /**
     * Process contents i.e. apply filer to the content.
     *
     * @param  string     $content The content to render.
     * @param  array      $options Options to be passed to the renderer.
     * @param  null|Page  $page    Null or an instance of \Grav\Common\Page.
     *
     * @return string              The rendered contents.
     */
    public function render($content, $options = [], $page = null)
    {
        // Get all <a> tags and process them
        $content = preg_replace_callback('~<a(?:\s[^>]*)?>.*?</a>~i',
            function($match) use ($options, $page) {
                // Load PHP built-in DOMDocument class
                if (($dom = $this->loadDOMDocument($match[0])) === null) {
                    return $match[0];
                }
 
                // Check that there is really a link tag
                $a = $dom->getElementsByTagName('a');
                if ($a->length == 0) {
                    return $match[0];
                }
                $a = $a->item(0);
 
                // Process links with non-empty href attribute
                $href = $a->getAttribute('href');
                if (strlen($href) == 0) {
                    return $match[0];
                }
 
                // Get the class of the <a> element
/var/www/html/learn2/user/plugins/external_links/external_links.php
            $this->grav['assets']->add('plugin://external_links/assets/css/external_links.css');
        }
    }
 
    /**
     * Filter to parse external links.
     *
     * @param  string $content The content to be filtered.
     * @param  array  $options Array of options for the External links filter.
     *
     * @return string          The filtered content.
     */
    public function externalLinksFilter($content, $params = [])
    {
        // Get custom user configuration
        $page = func_num_args() > 2 ? func_get_arg(2) : $this->grav['page'];
        $config = $this->mergeConfig($page, true, $params);
 
        // Render
        return $this->init()->render($content, $config, $page);
    }
 
    /** -------------------------------
     * Private/protected helper methods
     * --------------------------------
     */
 
    /**
     * Checks if a page has already been compiled yet.
     *
     * @param  Page    $page The page to check
     * @return boolean       Returns true if page has already been
     *                       compiled yet, false otherwise
     */
    protected function compileOnce(PageInterface $page)
    {
        static $processed = [];
 
        $id = md5($page->path());
        // Make sure that contents is only processed once
/var/www/html/learn2/user/plugins/external_links/external_links.php
        /** @var Page $page */
        $page = $event['page'];
 
        $config = $this->mergeConfig($page);
        $enabled = ($config->get('process') && $config->get('enabled')) ? true : false;
 
        if ($enabled && $this->compileOnce($page)) {
            // Do nothing, if a route for a given page does not exist and check if
            // mode option is valid
            $mode = strtolower($config->get('mode', 'passive'));
            if (!$page->route() || !in_array($mode, array('active', 'passive'))) {
                return;
            }
 
            // Get content and list of exclude tags
            $content = $page->getRawContent();
 
            // Apply external links filter and save modified page content
            $page->setRawContent(
                $this->externalLinksFilter($content, $config->toArray(), $page)
            );
        }
    }
 
    /**
     * Initialize Twig configuration and filters.
     */
    public function onTwigInitialized()
    {
        // Expose function
        $this->grav['twig']->twig()->addFilter(
            new \Twig_SimpleFilter('external_links', [$this, 'externalLinksFilter'], ['is_safe' => ['html']])
        );
    }
 
    /**
     * Set needed variables to display external links.
     */
    public function onTwigSiteVariables()
    {
/var/www/html/learn2/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;
            }
        }
/var/www/html/learn2/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)
    {
/var/www/html/learn2/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];
/var/www/html/learn2/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()
    {
        // Prevent user abort allowing onShutdown event to run without interruptions.
        if (function_exists('ignore_user_abort')) {
            @ignore_user_abort(true);
        }
 
/var/www/html/learn2/system/src/Grav/Common/Page/Page.php
                    $this->content = $this->raw_content;
                    Grav::instance()->fireEvent('onPageContentRaw', new Event(['page' => $this]));
 
                    if ($twig_first) {
                        if ($process_twig) {
                            $this->processTwig();
                        }
                        if ($process_markdown) {
                            $this->processMarkdown();
                        }
 
                        // Content Processed but not cached yet
                        Grav::instance()->fireEvent('onPageContentProcessed', new Event(['page' => $this]));
                    } else {
                        if ($process_markdown) {
                            $this->processMarkdown($process_twig);
                        }
 
                        // Content Processed but not cached yet
                        Grav::instance()->fireEvent('onPageContentProcessed', new Event(['page' => $this]));
 
                        if ($process_twig) {
                            $this->processTwig();
                        }
                    }
 
                    if ($cache_enable) {
                        $this->cachePageContent();
                    }
                }
            }
 
            // Handle summary divider
            $delimiter = $config->get('site.summary.delimiter', '===');
            $divider_pos = mb_strpos($this->content, "<p>{$delimiter}</p>");
            if ($divider_pos !== false) {
                $this->summary_size = $divider_pos;
                $this->content = str_replace("<p>{$delimiter}</p>", '', $this->content);
            }
 
/var/www/html/learn2/user/plugins/seo/seo.php
 
        // Set admin specific events
        if ($this->isAdmin()) {
            $this->active = false;
            $events = [
                'onTwigTemplatePaths' => ['onTwigTemplatePaths', 0],
                'onBlueprintCreated' => ['onBlueprintCreated', 0],
               // 'onPageContentRaw' => ['onPageContentRaw', 0],
            ];
        }
 
        // Register events
  
        $this->enable($events);
    }
    public function onPageInitialized()
    {
        $page = $this->grav['page'];
        $config = $this->mergeConfig($page);
        $content = strip_tags($page->content());
        $assets = $this->grav['assets'];
        $pattern = '~((\/[^\/]+)+)\/([^\/]+)~';
        $replacement = '$1';
        $outputjson = "";
        $uri = $this->grav['uri'];
        $route = $this->config->get('plugins.admin.route');
        $microdata = [];
        $meta = $page->metadata(null);
        $cleanedMarkdown = $this->cleanMarkdown($page->content());
       
        if (isset($page->header()->googletitle)) {
            $page->header()->title = $page->header()->googletitle;
        };
        if (isset($page->header()->googledesc)) {
            
            $meta['description']['name']      = 'description';
            $meta['description']['content']   = $page->header()->googledesc;
        
        } else {
            $meta['description']['name']      = 'description';
/var/www/html/learn2/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;
            }
        }
/var/www/html/learn2/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)
    {
/var/www/html/learn2/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];
/var/www/html/learn2/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()
    {
        // Prevent user abort allowing onShutdown event to run without interruptions.
        if (function_exists('ignore_user_abort')) {
            @ignore_user_abort(true);
        }
 
/var/www/html/learn2/system/src/Grav/Common/Processors/PagesProcessor.php
    /** @var string */
    public $id = 'pages';
    /** @var string */
    public $title = 'Pages';
 
    /**
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->startTimer();
 
        // Dump Cache state
        $this->container['debugger']->addMessage($this->container['cache']->getCacheStatus());
 
        $this->container['pages']->init();
        $this->container->fireEvent('onPagesInitialized', new Event(['pages' => $this->container['pages']]));
        $this->container->fireEvent('onPageInitialized', new Event(['page' => $this->container['page']]));
 
        /** @var PageInterface $page */
        $page = $this->container['page'];
 
        if (!$page->routable()) {
            // 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 {
            $this->addMessage("Routed to page {$page->rawRoute()} (type: {$page->template()})");
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/system/src/Grav/Common/Processors/TwigProcessor.php
 */
class TwigProcessor extends ProcessorBase
{
    /** @var string */
    public $id = 'twig';
    /** @var string */
    public $title = 'Twig';
 
    /**
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->startTimer();
        $this->container['twig']->init();
        $this->stopTimer();
 
        return $handler->handle($request);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/system/src/Grav/Common/Processors/AssetsProcessor.php
class AssetsProcessor extends ProcessorBase
{
    /** @var string */
    public $id = '_assets';
    /** @var string */
    public $title = 'Assets';
 
    /**
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->startTimer();
        $this->container['assets']->init();
        $this->container->fireEvent('onAssetsInitialized');
        $this->stopTimer();
 
        return $handler->handle($request);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/system/src/Grav/Common/Processors/SchedulerProcessor.php
class SchedulerProcessor extends ProcessorBase
{
    /** @var string */
    public $id = '_scheduler';
    /** @var string */
    public $title = 'Scheduler';
 
    /**
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->startTimer();
        $scheduler = $this->container['scheduler'];
        $this->container->fireEvent('onSchedulerInitialized', new Event(['scheduler' => $scheduler]));
        $this->stopTimer();
 
        return $handler->handle($request);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/system/src/Grav/Common/Processors/BackupsProcessor.php
class BackupsProcessor extends ProcessorBase
{
    /** @var string */
    public $id = '_backups';
    /** @var string */
    public $title = 'Backups';
 
    /**
     * @param ServerRequestInterface $request
     * @param RequestHandlerInterface $handler
     * @return ResponseInterface
     */
    public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
    {
        $this->startTimer();
        $backups = $this->container['backups'];
        $backups->init();
        $this->stopTimer();
 
        return $handler->handle($request);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/system/src/Grav/Common/Processors/TasksProcessor.php
                        $response = $handler->handle($request);
                    }
 
                    $this->stopTimer();
 
                    return $response;
                } catch (NotFoundException $e) {
                    // Task not found: Let it pass through.
                }
            }
 
            if ($task) {
                $this->container->fireEvent('onTask.' . $task);
            } elseif ($action) {
                $this->container->fireEvent('onAction.' . $action);
            }
        }
        $this->stopTimer();
 
        return $handler->handle($request);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/system/src/Grav/Common/Processors/InitializeProcessor.php
            if ($response) {
                $this->stopTimer('_init');
 
                return $response;
            }
        }
 
        // Load accounts (decides class to be used).
        // TODO: remove in 2.0.
        $this->container['accounts'];
 
        // Initialize session.
        $this->initializeSession($config);
 
        $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);
 
/var/www/html/learn2/system/src/Grav/Common/Debugger.php
        }
 
        $this->addMeasures();
        $this->addDeprecations();
        $this->timers = [];
 
        return $this->debugbar->getData();
    }
 
    /**
     * Hierarchical Profiler support.
     *
     * @param callable $callable
     * @param string|null $message
     * @return mixed
     */
    public function profile(callable $callable, string $message = null)
    {
        $this->startProfiling();
        $response = $callable();
        $this->stopProfiling($message);
 
        return $response;
    }
 
    public function addTwigProfiler(Environment $twig): void
    {
        $clockwork = $this->getClockwork();
        if ($clockwork) {
            $source = new TwigClockworkDataSource($twig);
            $source->listenToEvents();
            $clockwork->addDataSource($source);
        }
    }
 
    /**
     * Start profiling code.
     *
     * @return void
     */
/var/www/html/learn2/system/src/Grav/Common/Processors/InitializeProcessor.php
                $this->stopTimer('_init');
 
                return $response;
            }
        }
 
        // Load accounts (decides class to be used).
        // TODO: remove in 2.0.
        $this->container['accounts'];
 
        // Initialize session.
        $this->initializeSession($config);
 
        $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.
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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);
    }
}
 
/var/www/html/learn2/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 = '';
/var/www/html/learn2/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;
}
 

Environment & details:

empty
empty
empty
empty
Key Value
redirect_after_login
"/faq/howto/markdown"
user
Grav\Common\User\User {#1120}
Key Value
REDIRECT_HTTPS
"on"
REDIRECT_SSL_TLS_SNI
"learn.opengeoedu.de"
REDIRECT_STATUS
"200"
HTTPS
"on"
SSL_TLS_SNI
"learn.opengeoedu.de"
HTTP_ACCEPT
"*/*"
HTTP_USER_AGENT
"claudebot"
HTTP_HOST
"learn.opengeoedu.de"
PATH
"/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
SERVER_SIGNATURE
"<address>Apache/2.4.29 (Ubuntu) Server at learn.opengeoedu.de Port 443</address>\n"
SERVER_SOFTWARE
"Apache/2.4.29 (Ubuntu)"
SERVER_NAME
"learn.opengeoedu.de"
SERVER_ADDR
"139.30.107.220"
SERVER_PORT
"443"
REMOTE_ADDR
"3.93.173.205"
DOCUMENT_ROOT
"/var/www/html/learn2/"
REQUEST_SCHEME
"https"
CONTEXT_PREFIX
""
CONTEXT_DOCUMENT_ROOT
"/var/www/html/learn2/"
SERVER_ADMIN
"info@opengeoedu.de"
SCRIPT_FILENAME
"/var/www/html/learn2/index.php"
REMOTE_PORT
"53750"
REDIRECT_URL
"/en/faq/howto/markdown"
GATEWAY_INTERFACE
"CGI/1.1"
SERVER_PROTOCOL
"HTTP/1.1"
REQUEST_METHOD
"GET"
QUERY_STRING
""
REQUEST_URI
"/en/faq/howto/markdown"
SCRIPT_NAME
"/index.php"
PHP_SELF
"/index.php"
REQUEST_TIME_FLOAT
1710849503.4376
REQUEST_TIME
1710849503
empty
0. Whoops\Handler\PrettyPageHandler
1. Whoops\Handler\CallbackHandler