コード例 #1
0
ファイル: Madeam.php プロジェクト: joshdavey/madeam
 * Include core files
 * These files will be included in 99% of requests so it is more effecient to include them now
 * than for them to be autoloaded.
 */
$madeamLibrary = dirname(__FILE__) . '/madeam/';
require $madeamLibrary . 'Framework.php';
require $madeamLibrary . 'Controller.php';
require $madeamLibrary . 'Inflector.php';
require $madeamLibrary . 'Exception.php';
require $madeamLibrary . 'Middleware.php';
require $madeamLibrary . 'Router.php';
require $madeamLibrary . 'View.php';
/**
 * Define include paths
 */
Framework::$pathToProject = getcwd() . '/';
set_include_path(Framework::$pathToProject . 'application/models' . PATH_SEPARATOR . Framework::$pathToProject . 'application/controllers' . PATH_SEPARATOR . Framework::$pathToProject . 'application/middleware' . PATH_SEPARATOR . Framework::$pathToProject . 'application/vendor' . PATH_SEPARATOR . Framework::$pathToProject . 'application' . PATH_SEPARATOR . get_include_path() . PATH_SEPARATOR . dirname(dirname(dirname(__FILE__))) . '');
/**
 * Set global exception handler when an exception isn't caught
 */
set_exception_handler('madeam\\Exception::handle');
/**
 * Madeam's class Autoloader. This method should be used for autoloading by loading it with spl.
 * Example: spl_autoload_register('madeam\autoload');
 * 
 * @param string $class
 * @author Joshua Davey
 */
function autoload($class)
{
    // set class file name)