/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/system
/src
/Grav
/Common
/Page
/Page.php
$this->process = $config->get('system.pages.process');
$this->published = true;
}
/**
* Initializes the page instance variables based on a file
*
* @param \SplFileInfo $file The file information for the .md file that the page represents
* @param string $extension
*
* @return $this
*/
public function init(\SplFileInfo $file, $extension = null)
{
$config = Grav::instance()['config'];
$this->hide_home_route = $config->get('system.home.hide_in_urls', false);
$this->home_route = $this->adjustRouteCase($config->get('system.home.alias'));
$this->filePath($file->getPathName());
$this->modified($file->getMTime());
$this->id($this->modified() . md5($this->filePath()));
$this->routable(true);
$this->header();
$this->date();
$this->metadata();
$this->url();
$this->visible();
$this->modularTwig(strpos($this->slug(), '_') === 0);
$this->setPublishState();
$this->published();
$this->urlExtension();
// some extension logic
if (empty($extension)) {
$this->extension('.' . $file->getExtension());
} else {
$this->extension($extension);
}
// extract page language from page extension
Arguments
"SplFileInfo::getMTime(): stat failed for /var/www/vhosts/s18723618.onlinehome-server.info/ludwigfeuchtemessung.de/user/pages/02.produkte/05.wireless-systeme/03.fl-mobimic-slimline/produkt..md"
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/system
/src
/Grav
/Common
/Page
/Page.php
$this->process = $config->get('system.pages.process');
$this->published = true;
}
/**
* Initializes the page instance variables based on a file
*
* @param \SplFileInfo $file The file information for the .md file that the page represents
* @param string $extension
*
* @return $this
*/
public function init(\SplFileInfo $file, $extension = null)
{
$config = Grav::instance()['config'];
$this->hide_home_route = $config->get('system.home.hide_in_urls', false);
$this->home_route = $this->adjustRouteCase($config->get('system.home.alias'));
$this->filePath($file->getPathName());
$this->modified($file->getMTime());
$this->id($this->modified() . md5($this->filePath()));
$this->routable(true);
$this->header();
$this->date();
$this->metadata();
$this->url();
$this->visible();
$this->modularTwig(strpos($this->slug(), '_') === 0);
$this->setPublishState();
$this->published();
$this->urlExtension();
// some extension logic
if (empty($extension)) {
$this->extension('.' . $file->getExtension());
} else {
$this->extension($extension);
}
// extract page language from page extension
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/user
/plugins
/fludwig-pdf-generator
/fludwig-pdf-generator.php
// $page = $this->grav::instance()['page'];
// fucking 1&1 workaround
$cnf = $this->grav;
$instance = call_user_func(array($cnf, "instance")); //, $key, ...otherposibleadditionalparameters... ));
$page = $instance['page'];
// find the product page (always german)
$product = $page->find($this->uri->query('produkt'));
// get current language
$language = $this->uri->query('lang');
// english file path construction
$page_name_without_ext = substr($product->name(), 0, -(strlen($product->extension())));
$translated_page_path = $product->path() . DS . $page_name_without_ext . '.' . $language . '.md';
// finally... language specific product data in Page object
$translated_product = new Page();
$translated_product->init(new \SplFileInfo($translated_page_path), $language . '.md');
// dump('lang', $language);
// dump('found page', $translated_product);
// $translation = $cnf['language']->translate(['PLUGINS.FLUDWIG_PDF_GENERATOR.PLUGIN_STATUS'], [$language]);
// dump($translation);
if ($translated_product) {
$GLOBALS['HEADLINE_USAGE'] = $cnf['language']->translate(['PLUGINS.FLUDWIG_PDF_GENERATOR.HEADLINE_USAGE'], [$language]);
$GLOBALS['HEADLINE_FEATURES'] = $cnf['language']->translate(['PLUGINS.FLUDWIG_PDF_GENERATOR.HEADLINE_FEATURES'], [$language]);
$GLOBALS['HEADLINE_TECHNICAL'] = $cnf['language']->translate(['PLUGINS.FLUDWIG_PDF_GENERATOR.HEADLINE_TECHNICAL'], [$language]);
$GLOBALS['HEADER_IMAGE'] = $cnf['language']->translate(['PLUGINS.FLUDWIG_PDF_GENERATOR.HEADER_IMAGE'], [$language]);
$GLOBALS['FOOTER_IMAGE'] = $cnf['language']->translate(['PLUGINS.FLUDWIG_PDF_GENERATOR.FOOTER_IMAGE'], [$language]);
$pdfManager->makeDocument($language, $translated_product);
exit();
}
echo 'SHAAZ! 404 - nix gefunden';
exit();
}
Arguments
SplFileInfo {
path: "/var/www/vhosts/s18723618.onlinehome-server.info/ludwigfeuchtemessung.de/user/pages/02.produkte/05.wireless-systeme/03.fl-mobimic-slimline"
filename: "produkt..md"
basename: "produkt..md"
pathname: "/var/www/vhosts/s18723618.onlinehome-server.info/ludwigfeuchtemessung.de/user/pages/02.produkte/05.wireless-systeme/03.fl-mobimic-slimline/produkt..md"
extension: "md"
realPath: false
writable: false
readable: false
executable: false
file: false
dir: false
link: false
}
".md"
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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] = array();
foreach ($this->listeners[$eventName] as $priority => $listeners) {
foreach ($listeners as $k => $listener) {
if (\is_array($listener) && isset($listener[0]) && $listener[0] instanceof \Closure) {
$listener[0] = $listener[0]();
$this->listeners[$eventName][$priority][$k] = $listener;
}
$this->sorted[$eventName][] = $listener;
Arguments
Event {}
"onPageInitialized"
EventDispatcher {}
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/vendor
/symfony
/event-dispatcher
/EventDispatcher.php
* @author Jordi Boggiano <j.boggiano@seld.be>
* @author Jordan Alliot <jordan.alliot@gmail.com>
* @author Nicolas Grekas <p@tchwork.com>
*/
class EventDispatcher implements EventDispatcherInterface
{
private $listeners = array();
private $sorted = array();
/**
* {@inheritdoc}
*/
public function dispatch($eventName, Event $event = null)
{
if (null === $event) {
$event = new Event();
}
if ($listeners = $this->getListeners($eventName)) {
$this->doDispatch($listeners, $eventName, $event);
}
return $event;
}
/**
* {@inheritdoc}
*/
public function getListeners($eventName = null)
{
if (null !== $eventName) {
if (empty($this->listeners[$eventName])) {
return array();
}
if (!isset($this->sorted[$eventName])) {
$this->sortListeners($eventName);
}
return $this->sorted[$eventName];
Arguments
array:4 [
0 => array:2 [
0 => AdminPlugin {}
1 => "onPageInitialized"
]
1 => array:2 [
0 => LoginPlugin {}
1 => "authorizePage"
]
2 => array:2 [
0 => FludwigPdfGeneratorPlugin {}
1 => "onPageInitialized"
]
3 => array:2 [
0 => FormPlugin {}
1 => "onPageInitialized"
]
]
"onPageInitialized"
Event {}
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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
"onPageInitialized"
Event {}
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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
"onPageInitialized"
Event {}
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/system
/src
/Grav
/Common
/Processors
/PagesProcessor.php
*/
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);
}
}
}
}
Arguments
"onPageInitialized"
Event {}
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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')) {
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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()
{
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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 { …}
}
}
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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 { …}
}
}
]
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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 { …}
}
}
]
/var
/www
/vhosts
/s18723618.onlinehome-server.info
/ludwigfeuchtemessung.de
/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;
}