/mnt/web112/a2/40/53077740/htdocs/daniel/system/src/Grav/Common/Page/Pages.php
case 'modified':
$list[$key] = $child->modified();
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;
}
break;
case 'manual':
case 'default':
/mnt/web112/a2/40/53077740/htdocs/daniel/system/src/Grav/Common/Page/Pages.php
case 'modified':
$list[$key] = $child->modified();
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;
}
break;
case 'manual':
case 'default':
/mnt/web112/a2/40/53077740/htdocs/daniel/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;
}
/mnt/web112/a2/40/53077740/htdocs/daniel/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 */
/mnt/web112/a2/40/53077740/htdocs/daniel/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
/mnt/web112/a2/40/53077740/htdocs/daniel/system/src/Grav/Common/Page/Pages.php
}
$page_cache_id = md5(USER_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();
}
/mnt/web112/a2/40/53077740/htdocs/daniel/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)
/mnt/web112/a2/40/53077740/htdocs/daniel/system/src/Grav/Common/Grav.php
$this['assets']->init();
$this->fireEvent('onAssetsInitialized');
$debugger->startTimer('twig', 'Twig');
$this['twig']->init();
$debugger->stopTimer('twig');
$debugger->startTimer('pages', 'Pages');
$this['pages']->init();
$this->fireEvent('onPagesInitialized');
$debugger->stopTimer('pages');
$this->fireEvent('onPageInitialized');
$debugger->addAssets();
// Process whole page as required
$debugger->startTimer('render', 'Render');
$this->output = $this['output'];
$this->fireEvent('onOutputGenerated');
/mnt/web112/a2/40/53077740/htdocs/daniel/index.php
// Get the Grav instance
$grav = Grav::instance(
array(
'loader' => $loader
)
);
// Process the page
try {
$grav->process();
} catch (\Exception $e) {
$grav->fireEvent('onFatalException');
throw $e;
}