/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
$sort_flags = SORT_REGULAR;
break;
case 'publish_date':
$list[$key] = $child->publishDate();
$sort_flags = SORT_REGULAR;
break;
case 'unpublish_date':
$list[$key] = $child->unpublishDate();
$sort_flags = SORT_REGULAR;
break;
case 'slug':
$list[$key] = $child->slug();
break;
case 'basename':
$list[$key] = basename($key);
break;
case 'folder':
$list[$key] = $child->folder();
break;
case (is_string($header_query[0])):
$child_header = new Header((array)$child->header());
$header_value = $child_header->get($header_query[0]);
if (is_array($header_value)) {
$list[$key] = implode(',',$header_value);
} elseif ($header_value) {
$list[$key] = $header_value;
} else {
$list[$key] = $header_default ?: $key;
}
$sort_flags = $sort_flags ?: SORT_REGULAR;
break;
case 'manual':
case 'default':
default:
$list[$key] = $key;
$sort_flags = $sort_flags ?: SORT_REGULAR;
}
}
if (!$sort_flags) {
Arguments
"Trying to access array offset on value of type null"
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
$sort_flags = SORT_REGULAR;
break;
case 'publish_date':
$list[$key] = $child->publishDate();
$sort_flags = SORT_REGULAR;
break;
case 'unpublish_date':
$list[$key] = $child->unpublishDate();
$sort_flags = SORT_REGULAR;
break;
case 'slug':
$list[$key] = $child->slug();
break;
case 'basename':
$list[$key] = basename($key);
break;
case 'folder':
$list[$key] = $child->folder();
break;
case (is_string($header_query[0])):
$child_header = new Header((array)$child->header());
$header_value = $child_header->get($header_query[0]);
if (is_array($header_value)) {
$list[$key] = implode(',',$header_value);
} elseif ($header_value) {
$list[$key] = $header_value;
} else {
$list[$key] = $header_default ?: $key;
}
$sort_flags = $sort_flags ?: SORT_REGULAR;
break;
case 'manual':
case 'default':
default:
$list[$key] = $key;
$sort_flags = $sort_flags ?: SORT_REGULAR;
}
}
if (!$sort_flags) {
Arguments
8
"Trying to access array offset on value of type null"
"/home/kjennnet/public_html/integritytranscription.com/system/src/Grav/Common/Page/Pages.php"
1264
array:11 [
"path" => "788f614f6c3cbd27c895ebb45b657a81"
"pages" => array:3 [
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about/_skills" => array:1 [
"slug" => "_skills"
]
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about/01._about" => array:1 [
"slug" => "_about"
]
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about/_clients" => array:1 [
"slug" => "_clients"
]
]
"order_by" => "default"
"manual" => array:4 [
0 => "_about"
1 => "_skills"
2 => "_testimonials"
3 => "_clients"
]
"sort_flags" => null
"list" => []
"header_default" => null
"header_query" => null
"info" => array:1 [
"slug" => "_skills"
]
"key" => "/home/kjennnet/public_html/integritytranscription.com/user/pages/about/_skills"
"child" => Page {}
]
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
/**
* @param Collection $collection
* @param $orderBy
* @param string $orderDir
* @param null $orderManual
*
* @return array
* @internal
*/
public function sortCollection(Collection $collection, $orderBy, $orderDir = 'asc', $orderManual = null, $sort_flags = null)
{
$items = $collection->toArray();
if (!$items) {
return [];
}
$lookup = md5(json_encode($items) . json_encode($orderManual) . $orderBy . $orderDir);
if (!isset($this->sort[$lookup][$orderBy])) {
$this->buildSort($lookup, $items, $orderBy, $orderManual, $sort_flags);
}
$sort = $this->sort[$lookup][$orderBy];
if ($orderDir !== 'asc') {
$sort = array_reverse($sort);
}
return $sort;
}
/**
* Get a page instance.
*
* @param string $path The filesystem full path of the page
*
* @return Page
* @throws \Exception
*/
Arguments
"788f614f6c3cbd27c895ebb45b657a81"
array:3 [
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about/_skills" => array:1 [
"slug" => "_skills"
]
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about/01._about" => array:1 [
"slug" => "_about"
]
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about/_clients" => array:1 [
"slug" => "_clients"
]
]
"default"
array:4 [
0 => "_about"
1 => "_skills"
2 => "_testimonials"
3 => "_clients"
]
null
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Collection.php
}
parent::remove($key);
return $this;
}
/**
* Reorder collection.
*
* @param string $by
* @param string $dir
* @param array $manual
* @param string $sort_flags
*
* @return $this
*/
public function order($by, $dir = 'asc', $manual = null, $sort_flags = null)
{
$this->items = $this->pages->sortCollection($this, $by, $dir, $manual, $sort_flags);
return $this;
}
/**
* Check to see if this item is the first in the collection.
*
* @param string $path
*
* @return boolean True if item is first.
*/
public function isFirst($path)
{
if ($this->items && $path == array_keys($this->items)[0]) {
return true;
} else {
return false;
}
}
Arguments
Collection {}
"default"
"asc"
array:4 [
0 => "_about"
1 => "_skills"
2 => "_testimonials"
3 => "_clients"
]
null
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Page.php
$start = isset($params['dateRange']['start']) ? $params['dateRange']['start'] : 0;
$end = isset($params['dateRange']['end']) ? $params['dateRange']['end'] : false;
$field = isset($params['dateRange']['field']) ? $params['dateRange']['field'] : false;
$collection->dateRange($start, $end, $field);
}
if (isset($params['order'])) {
$by = isset($params['order']['by']) ? $params['order']['by'] : 'default';
$dir = isset($params['order']['dir']) ? $params['order']['dir'] : 'asc';
$custom = isset($params['order']['custom']) ? $params['order']['custom'] : null;
$sort_flags = isset($params['order']['sort_flags']) ? $params['order']['sort_flags'] : null;
if (is_array($sort_flags)) {
$sort_flags = array_map('constant', $sort_flags); //transform strings to constant value
$sort_flags = array_reduce($sort_flags, function ($a, $b) {
return $a | $b;
}, 0); //merge constant values using bit or
}
$collection->order($by, $dir, $custom, $sort_flags);
}
/** @var Grav $grav */
$grav = Grav::instance()['grav'];
// New Custom event to handle things like pagination.
$grav->fireEvent('onCollectionProcessed', new Event(['collection' => $collection]));
// Slice and dice the collection if pagination is required
if ($pagination) {
$params = $collection->params();
$limit = isset($params['limit']) ? $params['limit'] : 0;
$start = !empty($params['pagination']) ? ($uri->currentPage() - 1) * $limit : 0;
if ($limit && $collection->count() > $limit) {
$collection->slice($start, $limit);
}
}
Arguments
"default"
"asc"
array:4 [
0 => "_about"
1 => "_skills"
2 => "_testimonials"
3 => "_clients"
]
null
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
if (Utils::startsWith($filename, '_')) {
$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]));
}
}
// Set routability to false if no page found
if (!$content_exists) {
$page->routable(false);
}
// Override the modified time if modular
if ($page->template() === 'modular') {
foreach ($page->collection() as $child) {
$modified = $child->modified();
if ($modified > $last_modified) {
$last_modified = $modified;
}
}
}
// 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
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
$this->grav->fireEvent('onPageProcessed', new Event(['page' => $page]));
}
}
// Now handle all the folders under the page.
/** @var \FilesystemIterator $file */
foreach ($folders as $file) {
$filename = $file->getFilename();
// if folder contains separator, continue
if (Utils::contains($file->getFilename(), $config->get('system.param_sep', ':'))) {
continue;
}
if (!$page->path()) {
$page->path($file->getPath());
}
$path = $directory . DS . $filename;
$child = $this->recurse($path, $page);
if (Utils::startsWith($filename, '_')) {
$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]));
}
}
// Set routability to false if no page found
if (!$content_exists) {
$page->routable(false);
}
// Override the modified time if modular
if ($page->template() === 'modular') {
foreach ($page->collection() as $child) {
Arguments
"/home/kjennnet/public_html/integritytranscription.com/user/pages/about"
Page {}
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
default:
$hash = Folder::lastModifiedFile($pages_dir);
}
$this->pages_cache_id = md5($pages_dir . $hash . $language->getActive() . $config->checksum());
list($this->instances, $this->routes, $this->children, $taxonomy_map, $this->sort) = $cache->fetch($this->pages_cache_id);
if (!$this->instances) {
$this->grav['debugger']->addMessage('Page cache missed, rebuilding pages..');
// recurse pages and cache result
$this->resetPages($pages_dir, $this->pages_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();
}
}
/**
* Accessible method to manually reset the pages cache
*
* @param $pages_dir
*/
public function resetPages($pages_dir)
{
$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'];
Arguments
"/home/kjennnet/public_html/integritytranscription.com/user/pages"
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Page
/Pages.php
}
return $this->baseUrl($lang, $absolute) . Uri::filterPath($route);
}
/**
* Class initialization. Must be called before using this class.
*/
public function init()
{
$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)
{
if ($modified && $modified > $this->last_modified) {
$this->last_modified = $modified;
}
return $this->last_modified;
}
/**
* Returns a list of all pages.
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Processors
/PagesProcessor.php
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Common\Processors;
use Grav\Common\Page\Page;
use RocketTheme\Toolbox\Event\Event;
class PagesProcessor extends ProcessorBase implements ProcessorInterface
{
public $id = 'pages';
public $title = 'Pages';
public function process()
{
// 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 Page $page */
$page = $this->container['page'];
if (!$page->routable()) {
// If no page found, fire event
$event = $this->container->fireEvent('onPageNotFound', new Event(['page' => $page]));
if (isset($event->page)) {
unset ($this->container['page']);
$this->container['page'] = $event->page;
} else {
throw new \RuntimeException('Page Not Found', 404);
}
}
}
}
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Grav.php
} elseif ($values) {
$instance = self::$instance;
foreach ($values as $key => $value) {
$instance->offsetSet($key, $value);
}
}
return self::$instance;
}
/**
* Process a request
*/
public function process()
{
// 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();
});
}
/** @var Debugger $debugger */
$debugger = $this['debugger'];
$debugger->render();
register_shutdown_function([$this, 'shutdown']);
}
/**
* Set the system locale based on the language and configuration
*/
public function setLocale()
{
// Initialize Locale if set and configured.
if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {
$language = $this['language']->getLanguage();
setlocale(LC_ALL, strlen($language) < 3 ? ($language . '_' . strtoupper($language)) : $language);
} elseif ($this['config']->get('system.default_locale')) {
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Grav.php
*
* @param array $values
*
* @return static
*/
protected static function load(array $values)
{
$container = new static($values);
$container['grav'] = $container;
$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;
}
/**
* Register all services
* Services are defined in the diMap. They can either only the class
* of a Service Provider or a pair of serviceKey => serviceClass that
* gets directly mapped into the container.
*
* @return void
*/
protected function registerServices()
{
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Grav.php
ob_end_flush();
@ob_flush();
flush();
}
}
// Run any time consuming tasks.
$this->fireEvent('onShutdown');
}
/**
* 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)
{
$container = new static($values);
$container['grav'] = $container;
$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
Arguments
"pages"
"Pages"
Closure {
class: "Grav\Common\Grav"
this: Grav { …}
use: {
$processor: PagesProcessor { …}
}
}
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Grav.php
ob_end_flush();
@ob_flush();
flush();
}
}
// Run any time consuming tasks.
$this->fireEvent('onShutdown');
}
/**
* 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)
{
$container = new static($values);
$container['grav'] = $container;
$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
Arguments
Closure {
class: "Grav\Common\Grav"
parameters: {
$timerId: {}
$timerTitle: {}
$callback: {}
}
use: {
$debugger: Debugger { …}
}
}
array:3 [
0 => "pages"
1 => "Pages"
2 => Closure {
class: "Grav\Common\Grav"
this: Grav { …}
use: {
$processor: PagesProcessor { …}
}
}
]
/home
/kjennnet
/public_html
/integritytranscription.com
/system
/src
/Grav
/Common
/Grav.php
$instance = self::$instance;
foreach ($values as $key => $value) {
$instance->offsetSet($key, $value);
}
}
return self::$instance;
}
/**
* Process a request
*/
public function process()
{
// 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();
});
}
/** @var Debugger $debugger */
$debugger = $this['debugger'];
$debugger->render();
register_shutdown_function([$this, 'shutdown']);
}
/**
* Set the system locale based on the language and configuration
*/
public function setLocale()
{
// Initialize Locale if set and configured.
if ($this['language']->enabled() && $this['config']->get('system.languages.override_locale')) {
$language = $this['language']->getLanguage();
setlocale(LC_ALL, strlen($language) < 3 ? ($language . '_' . strtoupper($language)) : $language);
} elseif ($this['config']->get('system.default_locale')) {
setlocale(LC_ALL, $this['config']->get('system.default_locale'));
Arguments
"measureTime"
array:3 [
0 => "pages"
1 => "Pages"
2 => Closure {
class: "Grav\Common\Grav"
this: Grav { …}
use: {
$processor: PagesProcessor { …}
}
}
]
/home
/kjennnet
/public_html
/integritytranscription.com
/index.php
// Set timezone to default, falls back to system if php.ini not set
date_default_timezone_set(@date_default_timezone_get());
// Set internal encoding if mbstring loaded
if (!extension_loaded('mbstring')) {
die("'mbstring' extension is not loaded. This is required for Grav to run correctly");
}
mb_internal_encoding('UTF-8');
// Get the Grav instance
$grav = Grav::instance(
array(
'loader' => $loader
)
);
// Process the page
try {
$grav->process();
} catch (\Exception $e) {
$grav->fireEvent('onFatalException', new Event(array('exception' => $e)));
throw $e;
}