Example #1
0
<?php

$url = (string) @$_GET['URL'];
if (!$url || $url[0] != '/') {
    $url = "/{$url}";
}
try {
    require_once dirname(__FILE__) . '/php/init.php';
    $router = new Core\Router(config()->routes);
    print $router->route($url);
} catch (Exception $e) {
    print file_get_contents(dirname(__FILE__) . '/php/App/Shared/View/500.html');
    if (DEBUG) {
        print '<p>' . $e->getMessage() . '</p>' . error_log((string) $e, E_USER_ERROR);
    }
}
Example #2
0
<?php

//if(str_replace('www.',null,$_SERVER['HTTP_HOST']) == 'jonathan-sharp.co.uk')
//     die("Coming soon!");
/** 
 * Das index, ja?
 */
require 'core_path.php';
require CORE_PATH . '/core.php';
import('core.routing');
$router = new \Core\Router();
$router->route($_GET['route']);
Example #3
0
<?php

if (extension_loaded('xhprof')) {
    include_once '/usr/share/php/xhprof_lib/utils/xhprof_lib.php';
    include_once '/usr/share/php/xhprof_lib/utils/xhprof_runs.php';
    xhprof_enable(XHPROF_FLAGS_CPU + XHPROF_FLAGS_MEMORY);
}
require_once 'core_path.php';
require_once CORE_PATH . '/core.php';
define('DATETIME_FORMAT', "Ymd.Hi");
define('DATE_FORMAT', "l j<\\s\\u\\p>S</\\s\\u\\p> F 'y");
import('core.routing');
$router = new \Core\Router();
$router->route(URI);
if (extension_loaded('xhprof')) {
    $profiler_namespace = 'core';
    // namespace for your application
    $xhprof_data = xhprof_disable();
    $xhprof_runs = new XHProfRuns_Default();
    $run_id = $xhprof_runs->save_run($xhprof_data, $profiler_namespace);
    // url to the XHProf UI libraries (change the host name and path)
    $profiler_url = sprintf('http://trouble.0xf.nl/xhprof/xhprof_html/index.php?run=%s&source=%s', $run_id, $profiler_namespace);
    echo '<a href="' . $profiler_url . '" target="_blank">Profiler output</a>';
}
Example #4
0
<?php

session_start();
define("ROOT_DIR", __DIR__);
include "autoload.php";
include "vendor/autoload.php";
include "src/Core/Exceptions.php";
$router = new \Core\Router();
$router->route();
$app = new \Core\Application();
$app->run($router->getController(), $router->getAction());
Example #5
0
 /**
  * Route, and pass to the Dispatcher to run our controller/action.
  *
  * @access private
  */
 private function route()
 {
     $this->_router->route();
 }