/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
$list[$key] = $child->modified();
$sort_flags = SORT_REGULAR;
break;
case 'slug':
$list[$key] = $child->slug();
break;
case 'basename':
$list[$key] = basename($key);
break;
case (is_string($header_query[0])):
$child_header = new Header((array)$child->header());
$header_value = $child_header->get($header_query[0]);
if ($header_value) {
$list[$key] = $header_value;
} else {
$list[$key] = $header_default ?: $key;
}
$sort_flags = SORT_REGULAR;
break;
case 'manual':
Arguments
-
"Trying to access array offset on value of type null"
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
$list[$key] = $child->modified();
$sort_flags = SORT_REGULAR;
break;
case 'slug':
$list[$key] = $child->slug();
break;
case 'basename':
$list[$key] = basename($key);
break;
case (is_string($header_query[0])):
$child_header = new Header((array)$child->header());
$header_value = $child_header->get($header_query[0]);
if ($header_value) {
$list[$key] = $header_value;
} else {
$list[$key] = $header_default ?: $key;
}
$sort_flags = SORT_REGULAR;
break;
case 'manual':
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
$path = $page->path();
$children = isset($this->children[$path]) ? $this->children[$path] : [];
if (!$children) {
return $children;
}
if (!isset($this->sort[$path][$order_by])) {
$this->buildSort($path, $children, $order_by, $page->orderManual());
}
$sort = $this->sort[$path][$order_by];
if ($order_dir != 'asc') {
$sort = array_reverse($sort);
}
return $sort;
}
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
}
}
}
// Override the modified and ID so that it takes the latest change into account
$page->modified($last_modified);
$page->id($last_modified . md5($page->filePath()));
// Sort based on Defaults or Page Overridden sort order
$this->children[$page->path()] = $this->sort($page);
return $page;
}
/**
* @internal
*/
protected function buildRoutes()
{
/** @var $taxonomy Taxonomy */
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
if (!in_array($file->getBasename(), $this->ignore_files) && ($modified = $file->getMTime()) > $last_modified) {
$last_modified = $modified;
}
} elseif ($file->isDir() && !in_array($file->getFilename(), $this->ignore_folders)) {
if (!$page->path()) {
$page->path($file->getPath());
}
$path = $directory . DS . $name;
$child = $this->recurse($path, $page);
if (Utils::startsWith($name, '_')) {
$child->routable(false);
}
$this->children[$page->path()][$child->path()] = ['slug' => $child->slug()];
if ($config->get('system.pages.events.page')) {
$this->grav->fireEvent('onFolderProcessed', new Event(['page' => $page]));
}
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
/**
* Accessible method to manually reset the pages cache
*
* @param $pages_dir
* @param $page_cache_id
*/
public function resetPages($pages_dir, $page_cache_id)
{
$this->recurse($pages_dir);
$this->buildRoutes();
// cache if needed
if ($this->grav['config']->get('system.cache.enabled')) {
/** @var Cache $cache */
$cache = $this->grav['cache'];
/** @var Taxonomy $taxonomy */
$taxonomy = $this->grav['taxonomy'];
// save pages, routes, taxonomy, and sort to cache
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
}
$page_cache_id = md5($pages_dir . $last_modified . $language->getActive() . $config->checksum());
list($this->instances, $this->routes, $this->children, $taxonomy_map, $this->sort) = $cache->fetch($page_cache_id);
if (!$this->instances) {
$this->grav['debugger']->addMessage('Page cache missed, rebuilding pages..');
// recurse pages and cache result
$this->resetPages($pages_dir, $page_cache_id);
} else {
// If pages was found in cache, set the taxonomy
$this->grav['debugger']->addMessage('Page cache hit.');
$taxonomy->taxonomy($taxonomy_map);
}
} else {
$this->recurse($pages_dir);
$this->buildRoutes();
}
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Page/Pages.php
$config = $this->grav['config'];
$this->ignore_files = $config->get('system.pages.ignore_files');
$this->ignore_folders = $config->get('system.pages.ignore_folders');
$this->ignore_hidden = $config->get('system.pages.ignore_hidden');
$this->instances = [];
$this->children = [];
$this->routes = [];
$this->buildPages();
}
/**
* Get or set last modification time.
*
* @param int $modified
*
* @return int|null
*/
public function lastModified($modified = null)
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Processors/PagesProcessor.php
namespace Grav\Common\Processors;
class PagesProcessor extends ProcessorBase implements ProcessorInterface {
public $id = 'pages';
public $title = 'Pages';
public function process() {
$this->container['pages']->init();
$this->container->fireEvent('onPagesInitialized');
$this->container->fireEvent('onPageInitialized');
}
}
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Grav.php
public function process()
{
/** @var Debugger $debugger */
$debugger = $this['debugger'];
// process all processors (e.g. config, initialize, assets, ..., render)
foreach ($this->processors as $processor) {
$processor = $this[$processor];
$this->measureTime($processor->id, $processor->title, function () use ($processor) {
$processor->process();
});
}
// Set the header type
$this->header();
echo $this->output;
$debugger->render();
$this->fireEvent('onOutputRendered');
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Grav.php
$container['debugger'] = new Debugger();
$debugger = $container['debugger'];
// closure that measures time by wrapping a function into startTimer and stopTimer
// The debugger can be passed to the closure. Should be more performant
// then to get it from the container all time.
$container->measureTime = function ($timerId, $timerTitle, $callback) use ($debugger) {
$debugger->startTimer($timerId, $timerTitle);
$callback();
$debugger->stopTimer($timerId);
};
$container->measureTime('_services', 'Services', function () use ($container) {
$container->registerServices($container);
});
return $container;
}
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Grav.php
/**
* Magic Catch All Function
* Used to call closures like measureTime on the instance.
* Source: http://stackoverflow.com/questions/419804/closures-as-class-members
*/
public function __call($method, $args)
{
$closure = $this->$method;
call_user_func_array($closure, $args);
}
/**
* Initialize and return a Grav instance
*
* @param array $values
*
* @return static
*/
protected static function load(array $values)
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Grav.php
/**
* Magic Catch All Function
* Used to call closures like measureTime on the instance.
* Source: http://stackoverflow.com/questions/419804/closures-as-class-members
*/
public function __call($method, $args)
{
$closure = $this->$method;
call_user_func_array($closure, $args);
}
/**
* Initialize and return a Grav instance
*
* @param array $values
*
* @return static
*/
protected static function load(array $values)
/kunden/tecdomains.de/domains/top3.de/www/system/src/Grav/Common/Grav.php
*/
public function process()
{
/** @var Debugger $debugger */
$debugger = $this['debugger'];
// process all processors (e.g. config, initialize, assets, ..., render)
foreach ($this->processors as $processor) {
$processor = $this[$processor];
$this->measureTime($processor->id, $processor->title, function () use ($processor) {
$processor->process();
});
}
// Set the header type
$this->header();
echo $this->output;
$debugger->render();
/kunden/tecdomains.de/domains/top3.de/www/index.php
// Get the Grav instance
$grav = Grav::instance(
array(
'loader' => $loader
)
);
// Process the page
try {
$grav->process();
} catch (\Exception $e) {
$grav->fireEvent('onFatalException', new Event(['exception' => $e]));
throw $e;
}