/homepages/8/d185364483/htdocs/holzwerk/index.php
});
//NEWS
Flight::route('GET /news', function () {
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('news', array('produktdetail' => false));
});
//INFO einezelartikel
Flight::route('GET /info/@url', function ($url) {
$seo="info/" . $url;
$db = Flight::db();
$linked=$db->query("SELECT artikel, titel FROM linked WHERE seo='$seo'")->fetch(PDO::FETCH_BOTH);
$artid= $linked['artikel'];
$artikel=$db->query("SELECT * FROM artikel WHERE idx=$artid")->fetch(PDO::FETCH_ASSOC);
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('informationen', array('artikel'=>$artikel));
});
//PROJEKTE & INFO
Flight::route('GET /informationen', function () {
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('projekte', array('produktdetail' => false));
});
//////KATEGORIEN
Flight::route('GET /kategorien', function () {
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
/homepages/8/d185364483/htdocs/holzwerk/index.php
});
//NEWS
Flight::route('GET /news', function () {
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('news', array('produktdetail' => false));
});
//INFO einezelartikel
Flight::route('GET /info/@url', function ($url) {
$seo="info/" . $url;
$db = Flight::db();
$linked=$db->query("SELECT artikel, titel FROM linked WHERE seo='$seo'")->fetch(PDO::FETCH_BOTH);
$artid= $linked['artikel'];
$artikel=$db->query("SELECT * FROM artikel WHERE idx=$artid")->fetch(PDO::FETCH_ASSOC);
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('informationen', array('artikel'=>$artikel));
});
//PROJEKTE & INFO
Flight::route('GET /informationen', function () {
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('projekte', array('produktdetail' => false));
});
//////KATEGORIEN
Flight::route('GET /kategorien', function () {
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
/homepages/8/d185364483/htdocs/holzwerk/flight/core/Dispatcher.php
}
/**
* Calls a function.
*
* @param string $func Name of function to call
* @param array $params Function parameters
* @return mixed Function results
*/
public static function callFunction($func, array &$params = array()) {
// Call static method
if (is_string($func) && strpos($func, '::') !== false) {
return call_user_func_array($func, $params);
}
switch (count($params)) {
case 0:
return $func();
case 1:
return $func($params[0]);
case 2:
return $func($params[0], $params[1]);
case 3:
return $func($params[0], $params[1], $params[2]);
case 4:
return $func($params[0], $params[1], $params[2], $params[3]);
case 5:
return $func($params[0], $params[1], $params[2], $params[3], $params[4]);
default:
return call_user_func_array($func, $params);
}
}
/**
* Invokes a method.
*
* @param mixed $func Class method
* @param array $params Class method parameters
* @return mixed Function results
*/
/homepages/8/d185364483/htdocs/holzwerk/flight/core/Dispatcher.php
$args = array(&$params, &$output);
foreach ($filters as $callback) {
$continue = $this->execute($callback, $args);
if ($continue === false) break;
}
}
/**
* Executes a callback function.
*
* @param callback $callback Callback function
* @param array $params Function parameters
* @return mixed Function results
* @throws \Exception
*/
public static function execute($callback, array &$params = array()) {
if (is_callable($callback)) {
return is_array($callback) ?
self::invokeMethod($callback, $params) :
self::callFunction($callback, $params);
}
else {
throw new \Exception('Invalid callback specified.');
}
}
/**
* Calls a function.
*
* @param string $func Name of function to call
* @param array $params Function parameters
* @return mixed Function results
*/
public static function callFunction($func, array &$params = array()) {
// Call static method
if (is_string($func) && strpos($func, '::') !== false) {
return call_user_func_array($func, $params);
}
switch (count($params)) {
/homepages/8/d185364483/htdocs/holzwerk/flight/Engine.php
// Flush any existing output
if (ob_get_length() > 0) {
$response->write(ob_get_clean());
}
// Enable output buffering
ob_start();
// Route the request
while ($route = $router->route($request)) {
$params = array_values($route->params);
// Add route info to the parameter list
if ($route->pass) {
$params[] = $route;
}
// Call route handler
$continue = $this->dispatcher->execute(
$route->callback,
$params
);
$dispatched = true;
if (!$continue) break;
$router->next();
$dispatched = false;
}
if (!$dispatched) {
$this->notFound();
}
}
/**
* Stops the framework and outputs the current response.
*
/homepages/8/d185364483/htdocs/holzwerk/flight/core/Dispatcher.php
return call_user_func_array($func, $params);
}
}
/**
* Invokes a method.
*
* @param mixed $func Class method
* @param array $params Class method parameters
* @return mixed Function results
*/
public static function invokeMethod($func, array &$params = array()) {
list($class, $method) = $func;
$instance = is_object($class);
switch (count($params)) {
case 0:
return ($instance) ?
$class->$method() :
$class::$method();
case 1:
return ($instance) ?
$class->$method($params[0]) :
$class::$method($params[0]);
case 2:
return ($instance) ?
$class->$method($params[0], $params[1]) :
$class::$method($params[0], $params[1]);
case 3:
return ($instance) ?
$class->$method($params[0], $params[1], $params[2]) :
$class::$method($params[0], $params[1], $params[2]);
case 4:
return ($instance) ?
$class->$method($params[0], $params[1], $params[2], $params[3]) :
$class::$method($params[0], $params[1], $params[2], $params[3]);
case 5:
return ($instance) ?
$class->$method($params[0], $params[1], $params[2], $params[3], $params[4]) :
/homepages/8/d185364483/htdocs/holzwerk/flight/core/Dispatcher.php
public function filter($filters, &$params, &$output) {
$args = array(&$params, &$output);
foreach ($filters as $callback) {
$continue = $this->execute($callback, $args);
if ($continue === false) break;
}
}
/**
* Executes a callback function.
*
* @param callback $callback Callback function
* @param array $params Function parameters
* @return mixed Function results
* @throws \Exception
*/
public static function execute($callback, array &$params = array()) {
if (is_callable($callback)) {
return is_array($callback) ?
self::invokeMethod($callback, $params) :
self::callFunction($callback, $params);
}
else {
throw new \Exception('Invalid callback specified.');
}
}
/**
* Calls a function.
*
* @param string $func Name of function to call
* @param array $params Function parameters
* @return mixed Function results
*/
public static function callFunction($func, array &$params = array()) {
// Call static method
if (is_string($func) && strpos($func, '::') !== false) {
return call_user_func_array($func, $params);
}
/homepages/8/d185364483/htdocs/holzwerk/flight/core/Dispatcher.php
protected $filters = array();
/**
* Dispatches an event.
*
* @param string $name Event name
* @param array $params Callback parameters
* @return string Output of callback
* @throws \Exception
*/
public function run($name, array $params = array()) {
$output = '';
// Run pre-filters
if (!empty($this->filters[$name]['before'])) {
$this->filter($this->filters[$name]['before'], $params, $output);
}
// Run requested method
$output = $this->execute($this->get($name), $params);
// Run post-filters
if (!empty($this->filters[$name]['after'])) {
$this->filter($this->filters[$name]['after'], $params, $output);
}
return $output;
}
/**
* Assigns a callback to an event.
*
* @param string $name Event name
* @param callback $callback Callback function
*/
public function set($name, $callback) {
$this->events[$name] = $callback;
}
/**
/homepages/8/d185364483/htdocs/holzwerk/flight/Engine.php
$this->loader = new Loader();
$this->dispatcher = new Dispatcher();
$this->init();
}
/**
* Handles calls to class methods.
*
* @param string $name Method name
* @param array $params Method parameters
* @return mixed Callback results
* @throws \Exception
*/
public function __call($name, $params) {
$callback = $this->dispatcher->get($name);
if (is_callable($callback)) {
return $this->dispatcher->run($name, $params);
}
if (!$this->loader->get($name)) {
throw new \Exception("{$name} must be a mapped method.");
}
$shared = (!empty($params)) ? (bool)$params[0] : true;
return $this->loader->load($name, $shared);
}
/*** Core Methods ***/
/**
* Initializes the framework.
*/
public function init() {
static $initialized = false;
$self = $this;
/homepages/8/d185364483/htdocs/holzwerk/flight/core/Dispatcher.php
return call_user_func_array($func, $params);
}
}
/**
* Invokes a method.
*
* @param mixed $func Class method
* @param array $params Class method parameters
* @return mixed Function results
*/
public static function invokeMethod($func, array &$params = array()) {
list($class, $method) = $func;
$instance = is_object($class);
switch (count($params)) {
case 0:
return ($instance) ?
$class->$method() :
$class::$method();
case 1:
return ($instance) ?
$class->$method($params[0]) :
$class::$method($params[0]);
case 2:
return ($instance) ?
$class->$method($params[0], $params[1]) :
$class::$method($params[0], $params[1]);
case 3:
return ($instance) ?
$class->$method($params[0], $params[1], $params[2]) :
$class::$method($params[0], $params[1], $params[2]);
case 4:
return ($instance) ?
$class->$method($params[0], $params[1], $params[2], $params[3]) :
$class::$method($params[0], $params[1], $params[2], $params[3]);
case 5:
return ($instance) ?
$class->$method($params[0], $params[1], $params[2], $params[3], $params[4]) :
/homepages/8/d185364483/htdocs/holzwerk/flight/Flight.php
*/
private static $engine;
// Don't allow object instantiation
private function __construct() {}
private function __destruct() {}
private function __clone() {}
/**
* Handles calls to static methods.
*
* @param string $name Method name
* @param array $params Method parameters
* @return mixed Callback results
* @throws \Exception
*/
public static function __callStatic($name, $params) {
$app = Flight::app();
return \flight\core\Dispatcher::invokeMethod(array($app, $name), $params);
}
/**
* @return \flight\Engine Application instance
*/
public static function app() {
static $initialized = false;
if (!$initialized) {
require_once __DIR__.'/autoload.php';
self::$engine = new \flight\Engine();
$initialized = true;
}
return self::$engine;
}
}
/homepages/8/d185364483/htdocs/holzwerk/index.php
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('infos', array('infocontent' => utf8_encode($info)));
});
Flight::route('GET /datenschutz', function () {
$info = file_get_contents("datenschutz.html");
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('infos', array('infocontent' => utf8_encode($info)));
});
Flight::route('GET /anfahrt', function () {
$info = file_get_contents("anfahrt.html");
Flight::render('nav', array('kat' => "", 'subA' => "", 'navA' => ""), 'nav_content');
Flight::render('footer', array('kat' => ""), 'footer_content');
Flight::render('infos', array('infocontent' => utf8_encode($info)));
});
Flight::start();