public static function initialise() { require_once 'vendor/autoload.php'; try { require_once 'lib/routing.php'; $uri = Routing::fetch_uri(); $controller = ucfirst($uri['controller']) . 'Controller'; @(include "controllers/{$uri['controller']}_controller.php"); if (substr($uri['action'], 0, 1) == '?') { $uri['action'] = ''; } if (empty($uri['action']) && method_exists($controller, 'index')) { $uri['action'] = 'index'; } // If controller found and action exists if (class_exists($controller) && method_exists($controller, $uri['action'])) { $app = new $controller(); } else { $uri = Routing::route(); $controller = ucfirst($uri['controller']) . 'Controller'; include "controllers/{$uri['controller']}_controller.php"; $app = new $controller(); } $app->loadConfig(); $app->loadTwig(); $app->loadAws(); $app->loadModels(); $app->loadPlugins(); $app->uri = $uri; // Helper var to simplify reponding to json $app->json = $app->uri['format'] == 'json'; require_once 'lib/filter.php'; $app->runFilters(); $app->loadDefaultLibs(); // Set timezone from config date_default_timezone_set($config->timezone); // Call relevant function in controller $app->loadAction(); unset($_SESSION['flash']); } catch (ValidationException $e) { ob_end_clean(); Application::flash('error', $e->getMessage()); header('Location: ' . $_SERVER['HTTP_REFERER']); } catch (RoutingException $e) { ob_end_flush(); // RoutingExceptions only thrown from static context // so must set up new Application before rendering 404 $app = new Application(); $app->loadView('pages/404'); } catch (ApplicationException $e) { ob_end_flush(); $e->app->loadView('pages/500'); } }
/* * This file is part of the Eventum (Issue Tracking System) package. * * @copyright (c) Eventum Team * @license GNU General Public License, version 2 or later (GPL-2+) * * For the full copyright and license information, * please see the COPYING and AUTHORS files * that were distributed with this source code. */ require_once __DIR__ . '/../init.php'; // since this is all hacked up anyway, let's hardcode the values // TODO: Actually use values from config $_SERVER['argv'][1] = '1'; $full_message = stream_get_contents(STDIN); $return = Routing::route($full_message); if (is_array($return)) { echo $return[1]; exit($return[0]); } elseif ($return === false) { // message was not able to be routed echo 'no route'; exit(Routing::EX_NOUSER); } /* * TODO: Save other emails // save this message in a special directory $path = "/home/eventum/bounced_emails/"; list($usec,) = explode(" ", microtime()); $filename = date('d-m-Y.H-i-s.') . $usec . '.email.txt'; $fp = fopen($path . $filename, 'a+');
<?php require_once dirname(__FILE__) . '/includes/inc.master.php'; // Route our request global $routing; $routing = new Routing(); $routing->route();
<?php include_once 'engine/routing.php'; $routing = new Routing(); $page = $routing->route(); include_once './engine/template/Template.php'; include_once 'engine/write.php'; ob_start(); header('Content-Type: text/html; charset=utf-8'); if ($page === Routing::$MAIN_PAGE) { include_once './main.php'; } elseif ($page === Routing::$PROJECT_PAGE) { include_once './projekt.php'; } elseif ($page === Routing::$ABOUT_PAGE) { Template::useFile('omnie', null); } elseif ($page === Routing::$PANEL_PAGE) { session_start(); session_regenerate_id(); include_once './panel.php'; } else { page404(); } Template::drawTemplate();