Archived
1
0
Fork 0

Create a Bootstrap class and move bootstrap code from public/index.php

This commit is contained in:
Henrik Hautakoski 2018-06-18 17:42:30 +02:00
parent b3254e1f6c
commit e85d935734
4 changed files with 61 additions and 26 deletions

View file

@ -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');