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
|
|
@ -69,6 +69,25 @@ class Services extends DiDefault
|
|||
return $config;
|
||||
}
|
||||
|
||||
protected function _initSharedLoader()
|
||||
{
|
||||
$config = $this->get('config');
|
||||
$loader = new \Phalcon\Loader();
|
||||
|
||||
$loader->registerNamespaces(array(
|
||||
'App\Controller' => $config->application->controllersDir,
|
||||
'App\Listener' => $config->application->listenersDir,
|
||||
'App\Model' => $config->application->modelsDir,
|
||||
'App\Form' => $config->application->formsDir,
|
||||
'Httpcb' => $config->application->libraryDir,
|
||||
));
|
||||
|
||||
$loader->registerFiles(array(APP_PATH . '/vendor/autoload.php'));
|
||||
$loader->register();
|
||||
|
||||
return $loader;
|
||||
}
|
||||
|
||||
protected function _initSharedDispatcher()
|
||||
{
|
||||
$config = $this->get('config');
|
||||
|
|
|
|||
Reference in a new issue