Create a Bootstrap class and move bootstrap code from public/index.php
This commit is contained in:
parent
b3254e1f6c
commit
e85d935734
4 changed files with 61 additions and 26 deletions
|
|
@ -2,22 +2,20 @@
|
|||
|
||||
defined('APP_PATH') || define('APP_PATH', realpath('..'));
|
||||
|
||||
/**
|
||||
* Read the configuration
|
||||
*/
|
||||
$config = include APP_PATH . "/app/config/config.php";
|
||||
require_once APP_PATH . "/app/library/Bootstrap.php";
|
||||
require_once APP_PATH . "/app/library/Services.php";
|
||||
|
||||
/**
|
||||
* Bootstrap the application.
|
||||
*/
|
||||
$bootstrap = new \Httpcb\Bootstrap(new Httpcb\Services());
|
||||
|
||||
$config = $bootstrap->getDI()->get('config');
|
||||
if ($config->application->debug) {
|
||||
(new Phalcon\Debug)->listen();
|
||||
}
|
||||
|
||||
/**
|
||||
* Read auto-loader
|
||||
*/
|
||||
include APP_PATH . "/app/config/loader.php";
|
||||
|
||||
/**
|
||||
* Handle the request
|
||||
*/
|
||||
$app = new Phalcon\Mvc\Application(new Httpcb\Services());
|
||||
echo $app->handle()->getContent();
|
||||
echo $bootstrap->run();
|
||||
|
|
|
|||
Reference in a new issue