@@ -3,10 +3,7 @@ |
||
3 | 3 | use Yarak\Kernel; |
4 | 4 | use Phalcon\Mvc\View; |
5 | 5 | use Phalcon\Security; |
6 | -use Sonohini\Acl\Acl; |
|
7 | -use Sonohini\Auth\Auth; |
|
8 | 6 | use Phalcon\Mvc\Dispatcher; |
9 | -use Elasticsearch\ClientBuilder; |
|
10 | 7 | use Phalcon\Flash\Direct as Flash; |
11 | 8 | use Phalcon\Mvc\Url as UrlResolver; |
12 | 9 | use Phalcon\Mvc\View\Engine\Php as PhpEngine; |
@@ -110,9 +110,9 @@ |
||
110 | 110 | return new Security(); |
111 | 111 | }); |
112 | 112 | |
113 | - $di->set('modelsManager', function() { |
|
114 | - return new ModelsManager(); |
|
115 | - }); |
|
113 | + $di->set('modelsManager', function() { |
|
114 | + return new ModelsManager(); |
|
115 | + }); |
|
116 | 116 | |
117 | 117 | $di->setShared('yarak', function () { |
118 | 118 | $config = $this->getConfig(); |
@@ -15,11 +15,11 @@ discard block |
||
15 | 15 | use Phalcon\Session\Adapter\Files as SessionAdapter; |
16 | 16 | use Phalcon\Mvc\Model\Metadata\Memory as MetaDataAdapter; |
17 | 17 | |
18 | -$di->setShared('config', function () { |
|
18 | +$di->setShared('config', function() { |
|
19 | 19 | return include APP_PATH.'/config/config.php'; |
20 | 20 | }); |
21 | 21 | |
22 | -$di->setShared('url', function () { |
|
22 | +$di->setShared('url', function() { |
|
23 | 23 | $config = $this->getConfig(); |
24 | 24 | |
25 | 25 | $url = new UrlResolver(); |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | return $url; |
29 | 29 | }); |
30 | 30 | |
31 | -$di->setShared('view', function () { |
|
31 | +$di->setShared('view', function() { |
|
32 | 32 | $config = $this->getConfig(); |
33 | 33 | |
34 | 34 | $view = new View(); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | $view->setViewsDir($config->application->viewsDir); |
37 | 37 | |
38 | 38 | $view->registerEngines([ |
39 | - '.volt' => function ($view) { |
|
39 | + '.volt' => function($view) { |
|
40 | 40 | $config = $this->getConfig(); |
41 | 41 | |
42 | 42 | $volt = new VoltEngine($view, $this); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | return $view; |
56 | 56 | }); |
57 | 57 | |
58 | -$di->setShared('db', function () { |
|
58 | +$di->setShared('db', function() { |
|
59 | 59 | $config = $this->getConfig(); |
60 | 60 | |
61 | 61 | $class = 'Phalcon\Db\Adapter\Pdo\\'.$config->database->adapter; |
@@ -79,11 +79,11 @@ discard block |
||
79 | 79 | return $connection; |
80 | 80 | }); |
81 | 81 | |
82 | -$di->setShared('modelsMetadata', function () { |
|
82 | +$di->setShared('modelsMetadata', function() { |
|
83 | 83 | return new MetaDataAdapter(); |
84 | 84 | }); |
85 | 85 | |
86 | -$di->set('flash', function () { |
|
86 | +$di->set('flash', function() { |
|
87 | 87 | return new Flash([ |
88 | 88 | 'error' => 'alert alert-danger', |
89 | 89 | 'success' => 'alert alert-success', |
@@ -92,21 +92,21 @@ discard block |
||
92 | 92 | ]); |
93 | 93 | }); |
94 | 94 | |
95 | -$di->set('session', function () { |
|
95 | +$di->set('session', function() { |
|
96 | 96 | $session = new SessionAdapter(); |
97 | 97 | $session->start(); |
98 | 98 | |
99 | 99 | return $session; |
100 | 100 | }); |
101 | 101 | |
102 | -$di->set('dispatcher', function () { |
|
102 | +$di->set('dispatcher', function() { |
|
103 | 103 | $dispatcher = new Dispatcher(); |
104 | 104 | $dispatcher->setDefaultNamespace('Sonohini\Controllers'); |
105 | 105 | |
106 | 106 | return $dispatcher; |
107 | 107 | }); |
108 | 108 | |
109 | -$di->set('security', function () { |
|
109 | +$di->set('security', function() { |
|
110 | 110 | return new Security(); |
111 | 111 | }); |
112 | 112 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | return new ModelsManager(); |
115 | 115 | }); |
116 | 116 | |
117 | -$di->setShared('yarak', function () { |
|
117 | +$di->setShared('yarak', function() { |
|
118 | 118 | $config = $this->getConfig(); |
119 | 119 | |
120 | 120 | return new Kernel([ |
@@ -1,8 +1,5 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -use Phalcon\Db\Index; |
|
4 | -use Phalcon\Db\Column; |
|
5 | -use Phalcon\Db\Reference; |
|
6 | 3 | use Phalcon\Db\Adapter\Pdo; |
7 | 4 | use Yarak\Migrations\Migration; |
8 | 5 |
@@ -4,12 +4,12 @@ |
||
4 | 4 | * This file bootstraps the Codeception test suite. |
5 | 5 | */ |
6 | 6 | |
7 | -$config = include __DIR__ . '/config.php'; |
|
7 | +$config = include __DIR__.'/config.php'; |
|
8 | 8 | |
9 | -include __DIR__ . '/loader.php'; |
|
9 | +include __DIR__.'/loader.php'; |
|
10 | 10 | |
11 | 11 | $di = new \Phalcon\DI\FactoryDefault(); |
12 | 12 | |
13 | -include __DIR__ . '/services.php'; |
|
13 | +include __DIR__.'/services.php'; |
|
14 | 14 | |
15 | 15 | return new \Phalcon\Mvc\Application($di); |
@@ -3,8 +3,8 @@ discard block |
||
3 | 3 | * Modified: prepend directory path of current file, because of this file own different ENV under between Apache and command line. |
4 | 4 | * NOTE: please remove this comment. |
5 | 5 | */ |
6 | -defined('BASE_PATH') || define('BASE_PATH', getenv('BASE_PATH') ?: realpath(dirname(__FILE__) . '/../..')); |
|
7 | -defined('APP_PATH') || define('APP_PATH', BASE_PATH . '/app'); |
|
6 | +defined('BASE_PATH') || define('BASE_PATH', getenv('BASE_PATH') ?: realpath(dirname(__FILE__).'/../..')); |
|
7 | +defined('APP_PATH') || define('APP_PATH', BASE_PATH.'/app'); |
|
8 | 8 | |
9 | 9 | return new \Phalcon\Config([ |
10 | 10 | 'database' => [ |
@@ -16,15 +16,15 @@ discard block |
||
16 | 16 | 'charset' => 'utf8', |
17 | 17 | ], |
18 | 18 | 'application' => [ |
19 | - 'appDir' => APP_PATH . '/', |
|
20 | - 'controllersDir' => APP_PATH . '/controllers/', |
|
21 | - 'modelsDir' => APP_PATH . '/models/', |
|
22 | - 'migrationsDir' => APP_PATH . '/database/migrations/', |
|
23 | - 'viewsDir' => APP_PATH . '/views/', |
|
24 | - 'pluginsDir' => APP_PATH . '/plugins/', |
|
25 | - 'servicesDir' => APP_PATH . '/services/', |
|
26 | - 'cacheDir' => BASE_PATH . '/cache/', |
|
27 | - 'formsDir' => APP_PATH . '/forms', |
|
19 | + 'appDir' => APP_PATH.'/', |
|
20 | + 'controllersDir' => APP_PATH.'/controllers/', |
|
21 | + 'modelsDir' => APP_PATH.'/models/', |
|
22 | + 'migrationsDir' => APP_PATH.'/database/migrations/', |
|
23 | + 'viewsDir' => APP_PATH.'/views/', |
|
24 | + 'pluginsDir' => APP_PATH.'/plugins/', |
|
25 | + 'servicesDir' => APP_PATH.'/services/', |
|
26 | + 'cacheDir' => BASE_PATH.'/cache/', |
|
27 | + 'formsDir' => APP_PATH.'/forms', |
|
28 | 28 | 'baseUri' => '/', |
29 | 29 | ] |
30 | 30 | ]); |