Example #1
0
 /**
  * BitSso系统启动方法
  */
 public static function Start()
 {
     global $router;
     spl_autoload_register('BitSso\\BitSso::Load');
     //BitSso自动加载方法
     if (BSS_DEBUG) {
         error_reporting(0);
         set_error_handler('BitSso\\System\\Debug::Error');
         //注册错误报告方法
     } else {
         error_reporting(0);
     }
     register_shutdown_function('BitSso\\System\\Debug::shutDown');
     //注册致命错误捕获方法
     require BSS_PATH . BSS_SYSTEM . 'functinos.php';
     $router = System\Router::createRouter();
     //创建url路由类
     System\Debug::shutDown();
     //结束后执行结束方法
 }
Example #2
0
 * Set your applications current timezone
 */
date_default_timezone_set(System\Config::app('timezone', 'UTC'));
/**
 * Import helpers
 */
require APP . 'helpers' . EXT;
/**
 * Import defined routes
 */
require APP . 'routes' . EXT;
/**
 * Error handling
 */
System\Error::register();
/**
 * Set input
 */
System\Input::detect(System\Request::method());
/**
 * Read session data
 */
System\Session::start();
/**
 * Route the request
 */
$response = System\Router::create()->dispatch();
/**
 * Output stuff
 */
$response->send();
Example #3
0
<?php

error_reporting(E_ALL);
if (file_exists('./vendor/autoload.php')) {
    require './vendor/autoload.php';
} else {
    echo "<h1>Install via Composer. Type 'composer install' in Terminal.</h1>";
    exit;
}
if (!is_readable("./app/Config.php")) {
    echo "<h1>No Config found. (config.php in /app)</h1>";
    exit;
}
define('SITE_ROOT', realpath(dirname(__FILE__)));
App\Config::init();
Helpers\Session::init();
require "./app/routes.php";
System\Router::dispatch();