/web/pierke/flytobiggs.com/v3/lib/external/packages/tigron/skeleton-object/lib/Skeleton/Object/Slug.php
/**
* Make the slug unique
*/
return $this->trait_slug_unique($slug);
}
/**
* get by slug
*
* @access public
* @param string $name
* @return Object $object
*/
public static function get_by_slug($slug) {
$table = self::trait_get_database_table();
$db = self::trait_get_database();
$id = $db->get_one('SELECT ' . self::trait_get_table_field_id() . ' FROM ' . $db->quote_identifier($table) . ' WHERE slug=?', [$slug]);
if ($id === null) {
throw new \Exception('Object not found');
}
return self::get_by_id($id);
}
}
Arguments
/web/pierke/flytobiggs.com/v3/app/front/module/Plane.php
if (isset($_GET['type'])) {
$plane_type = \Plane_Type::get_by_slug($_GET['type']);
$pager->add_condition('plane_type_id', $plane_type->id);
$template->assign('selected_plane_type', $plane_type);
}
$pager->page();
$template->assign('pager', $pager);
}
/**
* Plane details
*
* @access private
*/
private function detail() {
$slug = $_GET['slug'];
$plane = \Plane::get_by_slug($slug);
$template = Template::get();
$template->assign('plane', $plane);
$template->assign('selected_plane_type', $plane->plane_type);
$template->assign('action', 'detail');
}
}
/web/pierke/flytobiggs.com/v3/app/front/module/Plane.php
* @var bool $login_required (reported by PHPInsights)
*/
protected bool $login_required = false;
/**
* Template
*
* @access protected
* @var string $template (reported by PHPInsights)
*/
protected ?string $template = 'plane.twig';
/**
* Display method
*
* @access public
*/
public function display(): void {
if (isset($_GET['slug'])) {
$this->detail();
return;
}
$template = Template::get();
$pager = new Pager('plane');
$pager->add_condition('archived', 'IS', NULL);
if (isset($_GET['type'])) {
$plane_type = \Plane_Type::get_by_slug($_GET['type']);
$pager->add_condition('plane_type_id', $plane_type->id);
$template->assign('selected_plane_type', $plane_type);
}
$pager->page();
$template->assign('pager', $pager);
}
/**
/web/pierke/flytobiggs.com/v3/lib/external/packages/tigron/skeleton-application-web/lib/Skeleton/Application/Web/Module.php
/**
* Handle the request
*
* @access public
*/
public function handle_request(): void {
// Find out which method to call, fall back to calling display()
if (
isset($_REQUEST['action']) === true
&& is_string($_REQUEST['action']) === true
&& method_exists($this, 'display_' . $_REQUEST['action']) === true
) {
if (class_exists('\Skeleton\Template\Template') === true) {
$template = \Skeleton\Application\Web\Template::Get();
$template->assign('action', $_REQUEST['action']);
}
call_user_func([$this, 'display_' . $_REQUEST['action']]);
} else {
$this->display();
}
// If the module has defined a template, render it
if ($this->template !== null && $this->template !== false) {
$template = \Skeleton\Application\Web\Template::Get();
$template->display($this->template);
}
}
/**
* Is login required?
*
* @access public
*/
public function is_login_required(): bool {
return $this->login_required;
}
/**
* Get the classname of the current module
/web/pierke/flytobiggs.com/v3/lib/external/packages/tigron/skeleton-application-web/lib/Skeleton/Application/Web/Module.php
$template->add_environment('sticky_session', $sticky->get_as_array());
}
// Call our magic secure() method before passing on the request
$allowed = true;
if (method_exists($this, 'secure') === true) {
$allowed = $this->secure();
}
// If the request is not allowed, make sure it gets handled properly
if ($allowed === false) {
$application->call_event('module', 'access_denied', [$this]);
} else {
// Call the bootstrap method if it exists
if (method_exists($this, 'bootstrap') === true) {
$this->bootstrap();
}
// Handle request
$this->handle_request();
}
// Call the teardown event if it exists
$application->call_event('module', 'teardown', [$this]);
}
/**
* get module_path
*
* @access public
* @return string $path
*/
public function get_module_path(): string {
$reflection = new \ReflectionClass($this);
$application = Application::Get();
$path = '/' . str_replace($application->module_path, '', $reflection->getFileName());
$path = strtolower($path);
return str_replace('.php', '', $path);
}
/web/pierke/flytobiggs.com/v3/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/pierke/flytobiggs.com/v3/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/pierke/flytobiggs.com/v3/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/pierke/flytobiggs.com/v3/webroot/handler.php
<?php
declare(strict_types=1);
ini_set('pcre.recursion_limit', 10000000);
ini_set('pcre.backtrack_limit', 10000000);
ini_set('pcre.jit', 0);
/**
* Handler file
*
* Calls the Handler class
*/
require_once '../lib/base/Bootstrap.php';
Bootstrap::boot();
\Skeleton\Core\Http\Handler::Run();