/web/lionel/all4you-sprl.be/yogagunas/app/www/event/Module.php
$languages = \Language::get_all();
$template->assign('languages', $languages);
if (isset($_GET['language'])) {
$_SESSION['language'] = \Language::get_by_name_short($_GET['language']);
unset($_GET['language']);
}
$hreflangs = [];
foreach ($languages as $language) {
$hreflang = $module->get_module_path() . '?';
foreach ($_GET as $key => $value) {
if ($key != 'language' && is_array(value) === false ) {
$hreflang .= $key . '=' . $value . '&';
}
}
$hreflang .= 'language=' . $language->name_short;
$hreflang = \Rewrite::reverse_link($hreflang);
$hreflang = 'https://' . \Skeleton\Core\Application::get()->hostnames[0] . $hreflang;
$hreflangs[] = $hreflang;
}
$template->assign('hreflangs', $hreflangs);
parent::bootstrap($module);
}
}
Arguments
"Undefined property: Skeleton\Application\Web::$hostnames"
/web/lionel/all4you-sprl.be/yogagunas/app/www/event/Module.php
$languages = \Language::get_all();
$template->assign('languages', $languages);
if (isset($_GET['language'])) {
$_SESSION['language'] = \Language::get_by_name_short($_GET['language']);
unset($_GET['language']);
}
$hreflangs = [];
foreach ($languages as $language) {
$hreflang = $module->get_module_path() . '?';
foreach ($_GET as $key => $value) {
if ($key != 'language' && is_array(value) === false ) {
$hreflang .= $key . '=' . $value . '&';
}
}
$hreflang .= 'language=' . $language->name_short;
$hreflang = \Rewrite::reverse_link($hreflang);
$hreflang = 'https://' . \Skeleton\Core\Application::get()->hostnames[0] . $hreflang;
$hreflangs[] = $hreflang;
}
$template->assign('hreflangs', $hreflangs);
parent::bootstrap($module);
}
}
/web/lionel/all4you-sprl.be/yogagunas/lib/external/packages/tigron/skeleton-core/lib/Skeleton/Core/Application.php
return $this->events[strtolower($context)];
}
$event = new $default($this);
$this->events[strtolower($context)] = $event;
return $this->events[strtolower($context)];
}
throw new \Exception('There is no event found for context ' . $requested_context);
}
/**
* Call event
*
* @access public
* @param $arguments mixed[]
*/
public function call_event(string $context, string $action, array $arguments = []): mixed {
$event = $this->load_event($context);
return call_user_func_array([$event, $action], $arguments);
}
/**
* Event exists
*
* @access public
*/
public function event_exists(string $context, string $action): bool {
try {
$event = $this->load_event($context);
} catch (\Exception $e) {
return false;
}
if (is_callable([$event, $action])) {
return true;
}
return false;
}
/web/lionel/all4you-sprl.be/yogagunas/lib/external/packages/tigron/skeleton-core/lib/Skeleton/Core/Application.php
return $this->events[strtolower($context)];
}
$event = new $default($this);
$this->events[strtolower($context)] = $event;
return $this->events[strtolower($context)];
}
throw new \Exception('There is no event found for context ' . $requested_context);
}
/**
* Call event
*
* @access public
* @param $arguments mixed[]
*/
public function call_event(string $context, string $action, array $arguments = []): mixed {
$event = $this->load_event($context);
return call_user_func_array([$event, $action], $arguments);
}
/**
* Event exists
*
* @access public
*/
public function event_exists(string $context, string $action): bool {
try {
$event = $this->load_event($context);
} catch (\Exception $e) {
return false;
}
if (is_callable([$event, $action])) {
return true;
}
return false;
}
/web/lionel/all4you-sprl.be/yogagunas/lib/external/packages/tigron/skeleton-application-web/lib/Skeleton/Application/Web.php
/**
* Validate CSRF
*/
$csrf = \Skeleton\Application\Web\Security\Csrf::get();
if ($session_properties['resumed'] === true && !$csrf->validate()) {
$this->call_event('security', 'csrf_validate_failed');
}
/**
* Check for replays
*/
$replay = \Skeleton\Application\Web\Security\Replay::get();
if ($replay->check() === false) {
$this->call_event('security', 'replay_detected');
}
if ($module !== null) {
$this->call_event('module', 'bootstrap', [ $module ]);
$module->accept_request();
$this->call_event('module', 'teardown', [ $module ]);
}
}
/**
* Search module
*
* @access public
*/
public function route(string $request_uri): object {
/**
* Remove leading slash
*/
if ($request_uri[0] === '/') {
$request_uri = substr($request_uri, 1);
}
if (substr($request_uri, -1) === '/') {
$request_uri = substr($request_uri, 0, strlen($request_uri) - 1);
/web/lionel/all4you-sprl.be/yogagunas/lib/external/packages/tigron/skeleton-core/lib/Skeleton/Core/Application.php
*/
public function accept(): void {
/**
* If this application is launched while another application has been
* set, we need to take over the request_relative_uri
* This happens when whitin an application, another application is
* started.
*/
$application = self::get();
$this->request_relative_uri = $application->request_relative_uri;
$this->hostname = $application->hostname;
\Skeleton\Core\Application::set($this);
$continue = $this->call_event('application', 'bootstrap', []);
register_shutdown_function([$this, 'call_event'], 'application', 'teardown', []);
if ($continue) {
$this->run();
}
}
/**
* Run the application
*
* @access public
*/
abstract public function run(): void;
/**
* Load all events
*
* @access public
*/
public function load_event(string $requested_context): object {
if (isset($this->events[$requested_context])) {
return $this->events[$requested_context];
}
/web/lionel/all4you-sprl.be/yogagunas/lib/external/packages/tigron/skeleton-core/lib/Skeleton/Core/Http/Handler.php
} elseif (isset($_SERVER['SERVER_NAME'])) {
$hostname = $_SERVER['SERVER_NAME'];
} elseif (isset($_SERVER['SERVER_ADDR'])) {
$hostname = $_SERVER['SERVER_ADDR'];
} else {
throw new \Exception('Not a web request');
}
// Remove port number from host
$hostname = preg_replace('/:\d+$/', '', $hostname);
/**
* Define the application
*/
try {
$application = Application::detect($hostname, $request_uri);
} catch (\Skeleton\Core\Exception_Unknown_Application $e) {
Status::code_404('application');
}
$application->accept();
}
}
/web/lionel/all4you-sprl.be/yogagunas/webroot/handler.php
<?php
/**
* Initialize the application
*
* @author Christophe Gosiau <christophe@tigron.be>
* @author Gerry Demaret <gerry@tigron.be>
* @author David Vandemaele <david@tigron.be>
*/
require_once '../lib/base/Bootstrap.php';
Bootstrap::boot();
\Skeleton\Core\Http\Handler::Run();