/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Cache.php
case 'apc':
$driver = new DoctrineCache\ApcCache();
break;
case 'apcu':
$driver = new DoctrineCache\ApcuCache();
break;
case 'wincache':
$driver = new DoctrineCache\WinCacheCache();
break;
case 'xcache':
$driver = new DoctrineCache\XcacheCache();
break;
case 'memcache':
$memcache = new \Memcache();
$memcache->connect($this->config->get('system.cache.memcache.server', 'localhost'),
$this->config->get('system.cache.memcache.port', 11211));
$driver = new DoctrineCache\MemcacheCache();
$driver->setMemcache($memcache);
break;
case 'memcached':
$memcached = new \Memcached();
$memcached->addServer($this->config->get('system.cache.memcached.server', 'localhost'),
$this->config->get('system.cache.memcached.port', 11211));
$driver = new DoctrineCache\MemcachedCache();
$driver->setMemcached($memcached);
break;
case 'redis':
$redis = new \Redis();
$socket = $this->config->get('system.cache.redis.socket', false);
$password = $this->config->get('system.cache.redis.password', false);
if ($socket) {
$redis->connect($socket);
} else {
Arguments
"Memcache::connect(): Server 157.90.249.37 (tcp 11211, udp 0) failed with: Connection timed out (110)"
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Cache.php
case 'apc':
$driver = new DoctrineCache\ApcCache();
break;
case 'apcu':
$driver = new DoctrineCache\ApcuCache();
break;
case 'wincache':
$driver = new DoctrineCache\WinCacheCache();
break;
case 'xcache':
$driver = new DoctrineCache\XcacheCache();
break;
case 'memcache':
$memcache = new \Memcache();
$memcache->connect($this->config->get('system.cache.memcache.server', 'localhost'),
$this->config->get('system.cache.memcache.port', 11211));
$driver = new DoctrineCache\MemcacheCache();
$driver->setMemcache($memcache);
break;
case 'memcached':
$memcached = new \Memcached();
$memcached->addServer($this->config->get('system.cache.memcached.server', 'localhost'),
$this->config->get('system.cache.memcached.port', 11211));
$driver = new DoctrineCache\MemcachedCache();
$driver->setMemcached($memcached);
break;
case 'redis':
$redis = new \Redis();
$socket = $this->config->get('system.cache.redis.socket', false);
$password = $this->config->get('system.cache.redis.password', false);
if ($socket) {
$redis->connect($socket);
} else {
Arguments
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Cache.php
$this->now = time();
$this->cache_dir = $grav['locator']->findResource('cache://doctrine', true, true);
/** @var Uri $uri */
$uri = $grav['uri'];
$prefix = $this->config->get('system.cache.prefix');
if (is_null($this->enabled)) {
$this->enabled = (bool)$this->config->get('system.cache.enabled');
}
// Cache key allows us to invalidate all cache on configuration changes.
$this->key = ($prefix ? $prefix : 'g') . '-' . substr(md5($uri->rootUrl(true) . $this->config->key() . GRAV_VERSION),
2, 8);
$this->driver_setting = $this->config->get('system.cache.driver');
$this->driver = $this->getCacheDriver();
// Set the cache namespace to our unique key
$this->driver->setNamespace($this->key);
}
/**
* Public accessor to set the enabled state of the cache
*
* @param $enabled
*/
public function setEnabled($enabled)
{
$this->enabled = (bool) $enabled;
}
/**
* Returns the current enabled state
*
* @return bool
*/
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Cache.php
protected static $images_remove = [
'cache://images'
];
protected static $cache_remove = [
'cache://'
];
protected static $tmp_remove = [
'tmp://'
];
/**
* Constructor
*
* @param Grav $grav
*/
public function __construct(Grav $grav)
{
$this->init($grav);
}
/**
* Initialization that sets a base key and the driver based on configuration settings
*
* @param Grav $grav
*
* @return void
*/
public function init(Grav $grav)
{
/** @var Config $config */
$this->config = $grav['config'];
$this->now = time();
$this->cache_dir = $grav['locator']->findResource('cache://doctrine', true, true);
/** @var Uri $uri */
$uri = $grav['uri'];
Arguments
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Grav.php
*
* @return void
*/
protected function registerServiceProvider($serviceClass)
{
$this->register(new $serviceClass);
}
/**
* Register a service with the container.
*
* @param string $serviceKey
* @param string $serviceClass
*
* @return void
*/
protected function registerService($serviceKey, $serviceClass)
{
$this[$serviceKey] = function ($c) use ($serviceClass) {
return new $serviceClass($c);
};
}
/**
* This attempts to find media, other files, and download them
*
* @param $path
*/
public function fallbackUrl($path)
{
$this->fireEvent('onPageFallBackUrl');
/** @var Uri $uri */
$uri = $this['uri'];
/** @var Config $config */
$config = $this['config'];
$uri_extension = $uri->extension();
$fallback_types = $config->get('system.media.allowed_fallback_types', null);
Arguments
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/vendor
/pimple
/pimple
/src
/Pimple
/Container.php
{
if (!isset($this->keys[$id])) {
throw new UnknownIdentifierException($id);
}
if (
isset($this->raw[$id])
|| !\is_object($this->values[$id])
|| isset($this->protected[$this->values[$id]])
|| !\method_exists($this->values[$id], '__invoke')
) {
return $this->values[$id];
}
if (isset($this->factories[$this->values[$id]])) {
return $this->values[$id]($this);
}
$raw = $this->values[$id];
$val = $this->values[$id] = $raw($this);
$this->raw[$id] = $raw;
$this->frozen[$id] = true;
return $val;
}
/**
* Checks if a parameter or an object is set.
*
* @param string $id The unique identifier for the parameter or object
*
* @return bool
*/
public function offsetExists($id)
{
return isset($this->keys[$id]);
}
/**
Arguments
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/user
/plugins
/problems
/problems.php
if ($this->isAdmin()) {
$this->active = false;
return;
}
// Run through potential issues
if ($this->problemChecker()) {
$this->renderProblems();
}
}
public function onPluginsInitialized()
{
if ($this->isAdmin()) {
$this->active = false;
return;
}
/** @var Cache $cache */
$cache = $this->grav['cache'];
$validated_prefix = 'problem-check-';
$this->check = CACHE_DIR . $validated_prefix . $cache->getKey();
if (!file_exists($this->check)) {
// If no issues remain, save a state file in the cache
if (!$this->problemChecker()) {
// delete any existing validated files
foreach (new \GlobIterator(CACHE_DIR . $validated_prefix . '*') as $fileInfo) {
@unlink($fileInfo->getPathname());
}
// create a file in the cache dir so it only runs on cache changes
touch($this->check);
} else {
$this->renderProblems();
}
}
Arguments
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/vendor
/symfony
/event-dispatcher
/EventDispatcher.php
}
}
/**
* Triggers the listeners of an event.
*
* This method can be overridden to add functionality that is executed
* for each listener.
*
* @param callable[] $listeners The event listeners
* @param string $eventName The name of the event to dispatch
* @param Event $event The event object to pass to the event handlers/listeners
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $listener) {
if ($event->isPropagationStopped()) {
break;
}
call_user_func($listener, $event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
*
* @param string $eventName The name of the event
*/
private function sortListeners($eventName)
{
krsort($this->listeners[$eventName]);
$this->sorted[$eventName] = call_user_func_array('array_merge', $this->listeners[$eventName]);
}
}
Arguments
Event {}
"onPluginsInitialized"
EventDispatcher {}
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/vendor
/symfony
/event-dispatcher
/EventDispatcher.php
}
}
/**
* Triggers the listeners of an event.
*
* This method can be overridden to add functionality that is executed
* for each listener.
*
* @param callable[] $listeners The event listeners
* @param string $eventName The name of the event to dispatch
* @param Event $event The event object to pass to the event handlers/listeners
*/
protected function doDispatch($listeners, $eventName, Event $event)
{
foreach ($listeners as $listener) {
if ($event->isPropagationStopped()) {
break;
}
call_user_func($listener, $event, $eventName, $this);
}
}
/**
* Sorts the internal list of listeners for the given event by priority.
*
* @param string $eventName The name of the event
*/
private function sortListeners($eventName)
{
krsort($this->listeners[$eventName]);
$this->sorted[$eventName] = call_user_func_array('array_merge', $this->listeners[$eventName]);
}
}
Arguments
array:2 [
0 => ProblemsPlugin {}
1 => "onPluginsInitialized"
]
Event {}
"onPluginsInitialized"
EventDispatcher {}
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/vendor
/symfony
/event-dispatcher
/EventDispatcher.php
*/
class EventDispatcher implements EventDispatcherInterface
{
private $listeners = array();
private $sorted = array();
/**
* {@inheritdoc}
*/
public function dispatch($eventName, Event $event = null)
{
if (null === $event) {
$event = new Event();
}
$event->setDispatcher($this);
$event->setName($eventName);
if ($listeners = $this->getListeners($eventName)) {
$this->doDispatch($listeners, $eventName, $event);
}
return $event;
}
/**
* {@inheritdoc}
*/
public function getListeners($eventName = null)
{
if (null !== $eventName) {
if (!isset($this->listeners[$eventName])) {
return array();
}
if (!isset($this->sorted[$eventName])) {
$this->sortListeners($eventName);
}
return $this->sorted[$eventName];
Arguments
array:10 [
0 => array:2 [
0 => ProblemsPlugin {}
1 => "onPluginsInitialized"
]
1 => array:2 [
0 => AdminPlugin {#1}
1 => "setup"
]
2 => array:2 [
0 => FormPlugin {#2}
1 => "autoload"
]
3 => array:2 [
0 => LoginPlugin {#3}
1 => "initializeSession"
]
4 => array:2 [
0 => AdminPlugin {#1}
1 => "onPluginsInitialized"
]
5 => array:2 [
0 => LoginPlugin {#3}
1 => "initializeLogin"
]
6 => array:2 [
0 => EmailPlugin {}
1 => "onPluginsInitialized"
]
7 => array:2 [
0 => FormPlugin {#2}
1 => "onPluginsInitialized"
]
8 => array:2 [
0 => FrontendEditButtonPlugin {}
1 => "onPluginsInitialized"
]
9 => array:2 [
0 => TinyMCEEditorPlugin {}
1 => "onPluginsInitialized"
]
]
"onPluginsInitialized"
Event {}
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/vendor
/rockettheme
/toolbox
/Event
/src
/EventDispatcher.php
use Symfony\Component\EventDispatcher\Event as BaseEvent;
use Symfony\Component\EventDispatcher\EventDispatcher as BaseEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Implements Symfony EventDispatcher interface.
*
* @package RocketTheme\Toolbox\Event
* @author RocketTheme
* @license MIT
*/
class EventDispatcher extends BaseEventDispatcher implements EventDispatcherInterface
{
public function dispatch($eventName, BaseEvent $event = null)
{
if (null === $event) {
$event = new Event();
}
return parent::dispatch($eventName, $event);
}
}
Arguments
"onPluginsInitialized"
Event {}
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Grav.php
// Vary: Accept-Encoding
if ($this['config']->get('system.pages.vary_accept_encoding', false)) {
header('Vary: Accept-Encoding');
}
}
/**
* Fires an event with optional parameters.
*
* @param string $eventName
* @param Event $event
*
* @return Event
*/
public function fireEvent($eventName, Event $event = null)
{
/** @var EventDispatcher $events */
$events = $this['events'];
return $events->dispatch($eventName, $event);
}
/**
* Set the final content length for the page and flush the buffer
*
*/
public function shutdown()
{
// Prevent user abort allowing onShutdown event to run without interruptions.
if (function_exists('ignore_user_abort')) {
@ignore_user_abort(true);
}
// Close the session allowing new requests to be handled.
if (isset($this['session'])) {
$this['session']->close();
}
if ($this['config']->get('system.debugger.shutdown.close_connection', true)) {
// Flush the response and close the connection to allow time consuming tasks to be performed without leaving
Arguments
"onPluginsInitialized"
Event {}
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/system
/src
/Grav
/Common
/Processors
/PluginsProcessor.php
<?php
/**
* @package Grav.Common.Processors
*
* @copyright Copyright (C) 2015 - 2018 Trilby Media, LLC. All rights reserved.
* @license MIT License; see LICENSE file for details.
*/
namespace Grav\Common\Processors;
class PluginsProcessor extends ProcessorBase implements ProcessorInterface
{
public $id = 'plugins';
public $title = 'Plugins';
public function process()
{
$this->container['plugins']->init();
$this->container->fireEvent('onPluginsInitialized');
}
}
Arguments
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/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')) {
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/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()
{
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/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
"plugins"
"Plugins"
Closure {
class: "Grav\Common\Grav"
this: Grav { …}
use: {
$processor: PluginsProcessor {}
}
file: "/srv/www/freistilbox/clients/c11000/s2305/.deploy/releases/031071e743557fe10285ce686cf3bb342dd1b152/docroot/system/src/Grav/Common/Grav.php"
line: "131 to 133"
}
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/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 {}
}
file: "/srv/www/freistilbox/clients/c11000/s2305/.deploy/releases/031071e743557fe10285ce686cf3bb342dd1b152/docroot/system/src/Grav/Common/Grav.php"
line: "372 to 376"
}
array:3 [
0 => "plugins"
1 => "Plugins"
2 => Closure {
class: "Grav\Common\Grav"
this: Grav { …}
use: {
$processor: PluginsProcessor {}
}
file: "/srv/www/freistilbox/clients/c11000/s2305/.deploy/releases/031071e743557fe10285ce686cf3bb342dd1b152/docroot/system/src/Grav/Common/Grav.php"
line: "131 to 133"
}
]
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/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 => "plugins"
1 => "Plugins"
2 => Closure {
class: "Grav\Common\Grav"
this: Grav { …}
use: {
$processor: PluginsProcessor {}
}
file: "/srv/www/freistilbox/clients/c11000/s2305/.deploy/releases/031071e743557fe10285ce686cf3bb342dd1b152/docroot/system/src/Grav/Common/Grav.php"
line: "131 to 133"
}
]
/srv
/www
/freistilbox
/clients
/c11000
/s2305
/.deploy
/releases
/031071e743557fe10285ce686cf3bb342dd1b152
/docroot
/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;
}