コード例 #1
0
ファイル: bootstrap.php プロジェクト: eceon/framework
<?php

/**
 * @author Ted van Diepen
 */
$sourcePath = dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'src';
// add the src directory to the include path
set_include_path(get_include_path() . PATH_SEPARATOR . $sourcePath);
// include psr-4 loader
require_once 'Eceon\\Autoload.php';
// create loader
$loader = new Eceon\Autoload();
$loader->addNamespace('Eceon\\', $sourcePath . DIRECTORY_SEPARATOR . 'Eceon');
$loader->register();
echo "loaded bootstrap\n";
コード例 #2
0
ファイル: index.php プロジェクト: eceon/skeleton-project
<?php

define('BASE_PATH', substr(__DIR__, 0, strrpos(__DIR__, DIRECTORY_SEPARATOR)));
set_include_path(get_include_path() . PATH_SEPARATOR . BASE_PATH);
// register autoload
include 'src\\Eceon\\Autoload.php';
$loader = new Eceon\Autoload();
$loader->register();
$loader->addNamespace('Application//', 'application/');
// create DI container
$dic = new Eceon\DI\Container('app.di.container');
// create di loader and load application wire file
$diLoader = new Eceon\DI\Loader\XML();
$diLoader->importFileIntoContainer($dic, 'application/app.xml');
// request & response
$request = $dic->load('app.request');
$response = $dic->load('app.response');
// create frontcontroller
$frontController = $dic->load('app.frontcontroller');
// run frontcontroller
$frontController->run($request, $response);