@@ -23,48 +23,48 @@ discard block |
||
23 | 23 | |
24 | 24 | } |
25 | 25 | |
26 | - private function _loadkey(string $key , array $replace = []) |
|
26 | + private function _loadkey(string $key, array $replace = []) |
|
27 | 27 | { |
28 | - list($namespace,$group) = explode('.',$key); |
|
28 | + list($namespace, $group) = explode('.', $key); |
|
29 | 29 | $t_dir = $this->getTranslation_dirs(); |
30 | 30 | |
31 | - if(in_array($this->local,$t_dir)){ |
|
32 | - $translationBaseFolder = $this->settings['app']['translation']['translations_path'].$this->local; |
|
33 | - $translationBaseFile = $translationBaseFolder.'/'.$namespace.'.php'; |
|
34 | - if(file_exists($translationBaseFile)){ |
|
31 | + if (in_array($this->local, $t_dir)) { |
|
32 | + $translationBaseFolder = $this->settings['app']['translation']['translations_path'] . $this->local; |
|
33 | + $translationBaseFile = $translationBaseFolder . '/' . $namespace . '.php'; |
|
34 | + if (file_exists($translationBaseFile)) { |
|
35 | 35 | $lang = include ($translationBaseFile); |
36 | - }else{ |
|
36 | + }else { |
|
37 | 37 | return $key; |
38 | 38 | } |
39 | - }else{ |
|
39 | + }else { |
|
40 | 40 | } |
41 | - $keyArr = explode('.',$key); |
|
41 | + $keyArr = explode('.', $key); |
|
42 | 42 | unset($keyArr[0]); |
43 | 43 | $keyArr = array_values($keyArr); |
44 | - $lang_new = $this->getDataFromTranslation($lang,$keyArr); |
|
44 | + $lang_new = $this->getDataFromTranslation($lang, $keyArr); |
|
45 | 45 | |
46 | - if(count($replace) > 0){ |
|
47 | - foreach($replace as $key=>$replace_item){ |
|
48 | - if(strpos($lang_new,'%') != 0){ |
|
49 | - str_replace($key,$replace_item,$lang_new); |
|
46 | + if (count($replace) > 0) { |
|
47 | + foreach ($replace as $key=>$replace_item) { |
|
48 | + if (strpos($lang_new, '%') != 0) { |
|
49 | + str_replace($key, $replace_item, $lang_new); |
|
50 | 50 | } |
51 | 51 | } |
52 | - }else{ |
|
52 | + }else { |
|
53 | 53 | return $lang_new; |
54 | 54 | } |
55 | 55 | } |
56 | 56 | |
57 | 57 | |
58 | - public function getDataFromTranslation( $data, $keyArr){ |
|
59 | - $arrayFound = isset($data[$keyArr[0]]) ? $data[$keyArr[0]] : ''; |
|
60 | - if($arrayFound){ |
|
58 | + public function getDataFromTranslation($data, $keyArr) { |
|
59 | + $arrayFound = isset($data[$keyArr[0]]) ? $data[$keyArr[0]] : ''; |
|
60 | + if ($arrayFound) { |
|
61 | 61 | unset($keyArr[0]); |
62 | 62 | $keyArr = array_values($keyArr); |
63 | - if(isset($keyArr[0])){ |
|
64 | - return $this->getDataFromTranslation($arrayFound,$keyArr); |
|
63 | + if (isset($keyArr[0])) { |
|
64 | + return $this->getDataFromTranslation($arrayFound, $keyArr); |
|
65 | 65 | } |
66 | 66 | } |
67 | - return $arrayFound ; |
|
67 | + return $arrayFound; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | |
74 | 74 | public function trans(string $key, array $replace = []) |
75 | 75 | { |
76 | - return $this->_loadkey($key,$replace); |
|
76 | + return $this->_loadkey($key, $replace); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | |
87 | 87 | |
88 | - return array_diff($dir,$ex_folders); |
|
88 | + return array_diff($dir, $ex_folders); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | } |
92 | 92 | \ No newline at end of file |
@@ -7,70 +7,70 @@ |
||
7 | 7 | class ImageService extends _Service |
8 | 8 | { |
9 | 9 | |
10 | - public function cropResize($src,$destUrl, $width, $height, $quality = 80,$fileExt = 'jpg') |
|
10 | + public function cropResize($src, $destUrl, $width, $height, $quality = 80, $fileExt = 'jpg') |
|
11 | 11 | { |
12 | 12 | $image = GImage::open($src); |
13 | 13 | $image->cropResize($width, $height); |
14 | - $destUrl = $destUrl.'.'.$fileExt; |
|
15 | - $image->save($destUrl, $fileExt = 'jpg', $quality ); |
|
14 | + $destUrl = $destUrl . '.' . $fileExt; |
|
15 | + $image->save($destUrl, $fileExt = 'jpg', $quality); |
|
16 | 16 | |
17 | 17 | |
18 | 18 | return $image; |
19 | 19 | } |
20 | 20 | |
21 | - public function scaleResize($src,$destUrl, $width, $height, $quality = 80,$fileExt = 'jpg') |
|
21 | + public function scaleResize($src, $destUrl, $width, $height, $quality = 80, $fileExt = 'jpg') |
|
22 | 22 | { |
23 | 23 | $image = GImage::open($src); |
24 | 24 | $image->scaleResize($width, $height); |
25 | - $destUrl = $destUrl.'.'.$fileExt; |
|
26 | - $image->save($destUrl, $fileExt = 'jpg', $quality ); |
|
25 | + $destUrl = $destUrl . '.' . $fileExt; |
|
26 | + $image->save($destUrl, $fileExt = 'jpg', $quality); |
|
27 | 27 | |
28 | 28 | |
29 | 29 | return $image; |
30 | 30 | } |
31 | 31 | |
32 | - public function resize($src,$destUrl, $width, $height, $quality = 80,$fileExt = 'jpg') |
|
32 | + public function resize($src, $destUrl, $width, $height, $quality = 80, $fileExt = 'jpg') |
|
33 | 33 | { |
34 | 34 | $image = GImage::open($src); |
35 | 35 | $image->resize($width, $height); |
36 | - $destUrl = $destUrl.'.'.$fileExt; |
|
37 | - $image->save($destUrl, $fileExt = 'jpg', $quality ); |
|
36 | + $destUrl = $destUrl . '.' . $fileExt; |
|
37 | + $image->save($destUrl, $fileExt = 'jpg', $quality); |
|
38 | 38 | |
39 | 39 | |
40 | 40 | return $image; |
41 | 41 | } |
42 | 42 | |
43 | - public function zoomCrop($src,$destUrl, $width, $height, $quality = 80,$fileExt = 'jpg') |
|
43 | + public function zoomCrop($src, $destUrl, $width, $height, $quality = 80, $fileExt = 'jpg') |
|
44 | 44 | { |
45 | 45 | $image = GImage::open($src); |
46 | 46 | $image->zoomCrop($width, $height); |
47 | - $destUrl = $destUrl.'.'.$fileExt; |
|
48 | - $image->save($destUrl, $fileExt = 'jpg', $quality ); |
|
47 | + $destUrl = $destUrl . '.' . $fileExt; |
|
48 | + $image->save($destUrl, $fileExt = 'jpg', $quality); |
|
49 | 49 | return $image; |
50 | 50 | } |
51 | 51 | |
52 | - public function createPhotos($src,$photoid,$type='user_photo', $dimensions = false) |
|
52 | + public function createPhotos($src, $photoid, $type = 'user_photo', $dimensions = false) |
|
53 | 53 | { |
54 | 54 | // Get default dimensions |
55 | - $dest = realpath('.'.$GLOBALS['settings']['image']['upload_path']); |
|
55 | + $dest = realpath('.' . $GLOBALS['settings']['image']['upload_path']); |
|
56 | 56 | |
57 | 57 | $defaultDimensions = $dimensions ? $dimensions : $GLOBALS['settings']['image'][$type]['dimensions']; |
58 | 58 | foreach ($defaultDimensions as $keys=>$dimension) |
59 | 59 | { |
60 | - if(!isset($dimension[2])) $dimension[2] = 100; // quality |
|
61 | - if(!isset($dimension[4])) $dimension[4] = 'jpg'; // quality |
|
60 | + if (!isset($dimension[2])) $dimension[2] = 100; // quality |
|
61 | + if (!isset($dimension[4])) $dimension[4] = 'jpg'; // quality |
|
62 | 62 | |
63 | - $destUrl = $dest.'/'.getImageDirName($photoid,$type).getImageFileName($photoid,$keys,$type); |
|
63 | + $destUrl = $dest . '/' . getImageDirName($photoid, $type) . getImageFileName($photoid, $keys, $type); |
|
64 | 64 | |
65 | - if(isset($dimension[3]) && $dimension[3] == true){ |
|
66 | - $image = $this->zoomCrop($src,trim($destUrl),$dimension[0], $dimension[1], $dimension[2],$dimension[4]); |
|
65 | + if (isset($dimension[3]) && $dimension[3] == true) { |
|
66 | + $image = $this->zoomCrop($src, trim($destUrl), $dimension[0], $dimension[1], $dimension[2], $dimension[4]); |
|
67 | 67 | }else { |
68 | - $image = $this->cropResize($src,trim($destUrl),$dimension[0], $dimension[1], $dimension[2],$dimension[4]); |
|
68 | + $image = $this->cropResize($src, trim($destUrl), $dimension[0], $dimension[1], $dimension[2], $dimension[4]); |
|
69 | 69 | } |
70 | 70 | |
71 | 71 | // $image = $this->cropResize($src,trim($destUrl),$dimension[0], $dimension[1], $dimension[2],$dimension[4]); |
72 | 72 | |
73 | - if($image ){ |
|
73 | + if ($image) { |
|
74 | 74 | $cropedArr[$keys] = $src; |
75 | 75 | } |
76 | 76 | } |
@@ -57,14 +57,20 @@ |
||
57 | 57 | $defaultDimensions = $dimensions ? $dimensions : $GLOBALS['settings']['image'][$type]['dimensions']; |
58 | 58 | foreach ($defaultDimensions as $keys=>$dimension) |
59 | 59 | { |
60 | - if(!isset($dimension[2])) $dimension[2] = 100; // quality |
|
61 | - if(!isset($dimension[4])) $dimension[4] = 'jpg'; // quality |
|
60 | + if(!isset($dimension[2])) { |
|
61 | + $dimension[2] = 100; |
|
62 | + } |
|
63 | + // quality |
|
64 | + if(!isset($dimension[4])) { |
|
65 | + $dimension[4] = 'jpg'; |
|
66 | + } |
|
67 | + // quality |
|
62 | 68 | |
63 | 69 | $destUrl = $dest.'/'.getImageDirName($photoid,$type).getImageFileName($photoid,$keys,$type); |
64 | 70 | |
65 | 71 | if(isset($dimension[3]) && $dimension[3] == true){ |
66 | 72 | $image = $this->zoomCrop($src,trim($destUrl),$dimension[0], $dimension[1], $dimension[2],$dimension[4]); |
67 | - }else { |
|
73 | + } else { |
|
68 | 74 | $image = $this->cropResize($src,trim($destUrl),$dimension[0], $dimension[1], $dimension[2],$dimension[4]); |
69 | 75 | } |
70 | 76 |
@@ -22,13 +22,13 @@ discard block |
||
22 | 22 | |
23 | 23 | public function hasRole($roleName) |
24 | 24 | { |
25 | - if(!self::check()){ |
|
25 | + if (!self::check()) { |
|
26 | 26 | return false; |
27 | 27 | } |
28 | - $userRoles = UserDataAccess::getUserRoles(isset($_SESSION['user']['user_id']) ? $_SESSION['user']['user_id'] : 0); |
|
28 | + $userRoles = UserDataAccess::getUserRoles(isset($_SESSION['user']['user_id']) ? $_SESSION['user']['user_id'] : 0); |
|
29 | 29 | $hasAccess = false; |
30 | - foreach ($userRoles as $role){ |
|
31 | - if($role->name == $roleName){ |
|
30 | + foreach ($userRoles as $role) { |
|
31 | + if ($role->name == $roleName) { |
|
32 | 32 | $hasAccess = true; |
33 | 33 | break; |
34 | 34 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | return isset($_SESSION['user']['user_id']); |
43 | 43 | } |
44 | 44 | |
45 | - public function attempt(string $loginField,string $password) |
|
45 | + public function attempt(string $loginField, string $password) |
|
46 | 46 | { |
47 | 47 | $user = UserDataAccess::getUserLoginField($loginField); |
48 | 48 | if (!$user) { |
@@ -52,17 +52,17 @@ discard block |
||
52 | 52 | ]; |
53 | 53 | } |
54 | 54 | $setting = Config::get('settings.auth'); |
55 | - if(1 || $setting['2step']){ |
|
56 | - return $this->twoStepAuth($loginField,$password); |
|
57 | - }else{ |
|
58 | - if ($this->checkPass($password,$user->password)) { |
|
55 | + if (1 || $setting['2step']) { |
|
56 | + return $this->twoStepAuth($loginField, $password); |
|
57 | + }else { |
|
58 | + if ($this->checkPass($password, $user->password)) { |
|
59 | 59 | $_SESSION['user']['user_id'] = $user->id; |
60 | 60 | $_SESSION['user']['mobile'] = $user->mobile; |
61 | 61 | return [ |
62 | 62 | 'type'=>'success', |
63 | 63 | 'message'=> 'Logined', |
64 | 64 | ]; |
65 | - }else{ |
|
65 | + }else { |
|
66 | 66 | return [ |
67 | 67 | 'type'=>'error', |
68 | 68 | 'message'=> 'password mismatch', |
@@ -77,9 +77,9 @@ discard block |
||
77 | 77 | |
78 | 78 | |
79 | 79 | |
80 | - public function checkPass($password,$database_pass) |
|
80 | + public function checkPass($password, $database_pass) |
|
81 | 81 | { |
82 | - if($database_pass == $password){ |
|
82 | + if ($database_pass == $password) { |
|
83 | 83 | return true; |
84 | 84 | } |
85 | 85 | return false; |
@@ -87,10 +87,10 @@ discard block |
||
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | - public function twoStepAuth(string $loginField,string $password) |
|
90 | + public function twoStepAuth(string $loginField, string $password) |
|
91 | 91 | { |
92 | 92 | $user = UserDataAccess::getUserLoginField($loginField); |
93 | - if(UserDataAccess::checkToken($password,$loginField)){ |
|
93 | + if (UserDataAccess::checkToken($password, $loginField)) { |
|
94 | 94 | $_SESSION['user']['user_id'] = $user->id; |
95 | 95 | $_SESSION['user']['mobile'] = $user->mobile; |
96 | 96 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'type'=>'success', |
99 | 99 | 'message'=> 'Logined', |
100 | 100 | ]; |
101 | - }else{ |
|
101 | + }else { |
|
102 | 102 | return [ |
103 | 103 | 'type'=>'error', |
104 | 104 | 'message'=> 'problem!', |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $setting = Config::get('settings.auth'); |
55 | 55 | if(1 || $setting['2step']){ |
56 | 56 | return $this->twoStepAuth($loginField,$password); |
57 | - }else{ |
|
57 | + } else{ |
|
58 | 58 | if ($this->checkPass($password,$user->password)) { |
59 | 59 | $_SESSION['user']['user_id'] = $user->id; |
60 | 60 | $_SESSION['user']['mobile'] = $user->mobile; |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | 'type'=>'success', |
63 | 63 | 'message'=> 'Logined', |
64 | 64 | ]; |
65 | - }else{ |
|
65 | + } else{ |
|
66 | 66 | return [ |
67 | 67 | 'type'=>'error', |
68 | 68 | 'message'=> 'password mismatch', |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | 'type'=>'success', |
99 | 99 | 'message'=> 'Logined', |
100 | 100 | ]; |
101 | - }else{ |
|
101 | + } else{ |
|
102 | 102 | return [ |
103 | 103 | 'type'=>'error', |
104 | 104 | 'message'=> 'problem!', |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | $container = $app->getContainer(); |
5 | 5 | |
6 | 6 | /* database connection */ |
7 | -$container['db'] = function ($container) { |
|
7 | +$container['db'] = function($container) { |
|
8 | 8 | $db = $container['settings']['databases']['db']; |
9 | 9 | $pdo = new PDO("mysql:host=" . $db['host'] . ";dbname=" . $db['database'], |
10 | 10 | $db['username'], $db['password']); |
@@ -52,18 +52,18 @@ discard block |
||
52 | 52 | // |
53 | 53 | |
54 | 54 | |
55 | -$container['generalErrorHandler'] = function ($container) { |
|
55 | +$container['generalErrorHandler'] = function($container) { |
|
56 | 56 | return new \Core\Handlers\GeneralErrorHandler($container); |
57 | 57 | }; |
58 | 58 | |
59 | 59 | |
60 | 60 | // Service factory for the ORM |
61 | -$container['validator'] = function () { |
|
61 | +$container['validator'] = function() { |
|
62 | 62 | return new App\Validation\Validator(); |
63 | 63 | }; |
64 | 64 | |
65 | 65 | |
66 | -$container['eloquent'] = function ($container) { |
|
66 | +$container['eloquent'] = function($container) { |
|
67 | 67 | $db = $container['settings']['databases']['db']; |
68 | 68 | |
69 | 69 | $capsule = new \Illuminate\Database\Capsule\Manager; |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | |
84 | 84 | |
85 | 85 | // monolog |
86 | -$container['logger'] = function ($c) { |
|
86 | +$container['logger'] = function($c) { |
|
87 | 87 | $settings = $c->get('settings')['app']['logger']; |
88 | 88 | $logger = new Monolog\Logger($settings['name']); |
89 | 89 | $logger->pushProcessor(new Monolog\Processor\UidProcessor()); |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | }; |
93 | 93 | |
94 | 94 | // not found handler |
95 | -$container['notFoundHandler'] = function ($container) { |
|
96 | - return function (\Slim\Http\Request $request, \Slim\Http\Response $response) use ($container) { |
|
95 | +$container['notFoundHandler'] = function($container) { |
|
96 | + return function(\Slim\Http\Request $request, \Slim\Http\Response $response) use ($container) { |
|
97 | 97 | return $container['view']->render($response->withStatus(404), '404'); |
98 | 98 | }; |
99 | 99 | }; |
@@ -103,23 +103,23 @@ discard block |
||
103 | 103 | $translator = new \Core\Translator\Translator($container); |
104 | 104 | $translator->init(); |
105 | 105 | |
106 | -$container['translator'] = function () use ($translator) { |
|
106 | +$container['translator'] = function() use ($translator) { |
|
107 | 107 | return $translator; |
108 | 108 | }; |
109 | 109 | |
110 | 110 | |
111 | 111 | // Register provider |
112 | -$container['flash'] = function () { |
|
112 | +$container['flash'] = function() { |
|
113 | 113 | return new \Slim\Flash\Messages(); |
114 | 114 | }; |
115 | 115 | |
116 | 116 | |
117 | 117 | // |
118 | -$container['session'] = function ($container) { |
|
118 | +$container['session'] = function($container) { |
|
119 | 119 | $setting_session_driver = $container['settings']['session']['driver'] ?? 'session'; |
120 | 120 | |
121 | 121 | $sessionOBJ = new \Core\Services\Session(); |
122 | - $session = $sessionOBJ->init($setting_session_driver) ; |
|
122 | + $session = $sessionOBJ->init($setting_session_driver); |
|
123 | 123 | return $session; |
124 | 124 | }; |
125 | 125 | |
@@ -130,17 +130,17 @@ discard block |
||
130 | 130 | |
131 | 131 | |
132 | 132 | // Register Blade View helper |
133 | -$container['view'] = function ($container) { |
|
133 | +$container['view'] = function($container) { |
|
134 | 134 | $messages = $container->flash->getMessages(); |
135 | 135 | |
136 | - if(!is_dir('../app/View/cache')){ |
|
136 | + if (!is_dir('../app/View/cache')) { |
|
137 | 137 | @mkdir('../app/View/cache'); |
138 | 138 | } |
139 | 139 | |
140 | 140 | |
141 | 141 | $viewSettings = $container['settings']['view']; |
142 | 142 | return new \Slim\Views\Blade( |
143 | - [$viewSettings['blade_template_path'].$viewSettings['template']], |
|
143 | + [$viewSettings['blade_template_path'] . $viewSettings['template']], |
|
144 | 144 | $viewSettings['blade_cache_path'], |
145 | 145 | null, |
146 | 146 | [ |
@@ -152,11 +152,11 @@ discard block |
||
152 | 152 | }; |
153 | 153 | |
154 | 154 | // Register Blade View helper |
155 | -$container['json'] = function ($container) { |
|
155 | +$container['json'] = function($container) { |
|
156 | 156 | return new \Core\Handlers\JsonHandler(); |
157 | 157 | }; |
158 | 158 | |
159 | -$app->getContainer()['view']->getRenderer()->getCompiler()->directive('helloWorld', function(){ |
|
159 | +$app->getContainer()['view']->getRenderer()->getCompiler()->directive('helloWorld', function() { |
|
160 | 160 | |
161 | 161 | return "<?php echo 'Hello Directive'; ?>"; |
162 | 162 | }); |
@@ -171,14 +171,14 @@ discard block |
||
171 | 171 | |
172 | 172 | |
173 | 173 | /*Dynamic containers in services*/ |
174 | -$dir = scandir(__APP_ROOT__.'/core/Services/'); |
|
174 | +$dir = scandir(__APP_ROOT__ . '/core/Services/'); |
|
175 | 175 | $ex_folders = array('..', '.'); |
176 | -$filesInServices = array_diff($dir,$ex_folders); |
|
176 | +$filesInServices = array_diff($dir, $ex_folders); |
|
177 | 177 | |
178 | -foreach($filesInServices as $service){ |
|
179 | - $content = preg_replace('/.php/','',$service); |
|
180 | - $container[$content] = function () use ($content){ |
|
181 | - $class = '\\Core\\Services\\'.$content ; |
|
178 | +foreach ($filesInServices as $service) { |
|
179 | + $content = preg_replace('/.php/', '', $service); |
|
180 | + $container[$content] = function() use ($content){ |
|
181 | + $class = '\\Core\\Services\\' . $content; |
|
182 | 182 | return new $class(); |
183 | 183 | }; |
184 | 184 | } |
@@ -1,25 +1,25 @@ discard block |
||
1 | 1 | <?php |
2 | -define('__APP_ROOT__',__DIR__ . '/../') ; |
|
2 | +define('__APP_ROOT__', __DIR__ . '/../'); |
|
3 | 3 | $APPROOT = __APP_ROOT__; |
4 | -require __APP_ROOT__.'bootstrap/bootstrap.php'; |
|
5 | -require __APP_ROOT__.'vendor/autoload.php'; |
|
4 | +require __APP_ROOT__ . 'bootstrap/bootstrap.php'; |
|
5 | +require __APP_ROOT__ . 'vendor/autoload.php'; |
|
6 | 6 | |
7 | 7 | $env = new \Core\Helpers\Env(); |
8 | 8 | |
9 | 9 | defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
10 | 10 | |
11 | 11 | /*Dynamic containers in services*/ |
12 | -$config_dir = scandir(__APP_ROOT__.'/config/'); |
|
12 | +$config_dir = scandir(__APP_ROOT__ . '/config/'); |
|
13 | 13 | $ex_config_folders = array('..', '.'); |
14 | -$filesInConfig = array_diff($config_dir,$ex_config_folders); |
|
14 | +$filesInConfig = array_diff($config_dir, $ex_config_folders); |
|
15 | 15 | if (!isset($configs)) { |
16 | 16 | $configs = array(); |
17 | 17 | } |
18 | -$i=0; |
|
19 | -foreach($filesInConfig as $config_file){ |
|
20 | - if($config_file === 'phpmig.php'){continue;} |
|
21 | - $file[$i] = include_once __APP_ROOT__.'config/'.$config_file; |
|
22 | - if(is_array($file[$i])){ |
|
18 | +$i = 0; |
|
19 | +foreach ($filesInConfig as $config_file) { |
|
20 | + if ($config_file === 'phpmig.php') {continue; } |
|
21 | + $file[$i] = include_once __APP_ROOT__ . 'config/' . $config_file; |
|
22 | + if (is_array($file[$i])) { |
|
23 | 23 | $configs = array_merge($configs, $file[$i]); |
24 | 24 | $i++; |
25 | 25 | } |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | $config['settings'] = $configs; |
30 | -require __APP_ROOT__.'core/Functions/general_helpers.php'; |
|
30 | +require __APP_ROOT__ . 'core/Functions/general_helpers.php'; |
|
31 | 31 | |
32 | 32 | |
33 | 33 | $app = new \Core\App($config); |
34 | 34 | |
35 | -if($config['settings']['debug'] && !$config['settings']['tracy']['active']){ |
|
35 | +if ($config['settings']['debug'] && !$config['settings']['tracy']['active']) { |
|
36 | 36 | ini_set('display_errors', 1); |
37 | 37 | ini_set('display_startup_errors', 1); |
38 | 38 | error_reporting(E_ALL); |
@@ -41,18 +41,18 @@ discard block |
||
41 | 41 | |
42 | 42 | use SlimFacades\Facade; |
43 | 43 | // get container app |
44 | -require __APP_ROOT__.'bootstrap/dependencies.php'; |
|
44 | +require __APP_ROOT__ . 'bootstrap/dependencies.php'; |
|
45 | 45 | |
46 | -require __APP_ROOT__.'bootstrap/routes.php'; |
|
47 | -require __APP_ROOT__.'core/Functions/helpers.php'; |
|
46 | +require __APP_ROOT__ . 'bootstrap/routes.php'; |
|
47 | +require __APP_ROOT__ . 'core/Functions/helpers.php'; |
|
48 | 48 | |
49 | -if(php_sapi_name() != 'cli') { |
|
50 | - if($config['settings']['debug'] && $config['settings']['tracy']['active']){ |
|
49 | +if (php_sapi_name() != 'cli') { |
|
50 | + if ($config['settings']['debug'] && $config['settings']['tracy']['active']) { |
|
51 | 51 | Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT, $config['settings']['tracy']['path']); |
52 | 52 | } |
53 | 53 | Facade::setFacadeApplication($app); |
54 | 54 | |
55 | - require __APP_ROOT__.'bootstrap/middlewares.php'; |
|
55 | + require __APP_ROOT__ . 'bootstrap/middlewares.php'; |
|
56 | 56 | |
57 | 57 | $app->run(); |
58 | 58 |
@@ -9,11 +9,11 @@ |
||
9 | 9 | 'showSlimEnvironmentPanel' => 1, |
10 | 10 | 'showSlimRequestPanel' => 1, |
11 | 11 | 'showSlimResponsePanel' => 1, |
12 | - 'showSlimContainer' =>1 , |
|
12 | + 'showSlimContainer' =>1, |
|
13 | 13 | 'showEloquentORMPanel' => 1, |
14 | - 'showIdiormPanel' => 0,// > 0 mean you enable logging |
|
14 | + 'showIdiormPanel' => 0, // > 0 mean you enable logging |
|
15 | 15 | // but show or not panel you decide in browser in panel selector |
16 | - 'showDoctrinePanel' => 'em',// here also enable logging and you must enter your Doctrine container name |
|
16 | + 'showDoctrinePanel' => 'em', // here also enable logging and you must enter your Doctrine container name |
|
17 | 17 | // and also as above show or not panel you decide in browser in panel selector |
18 | 18 | 'showProfilerPanel' => 1, |
19 | 19 | 'showVendorVersionsPanel' => 1, |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | return [ |
3 | 3 | // Renderer settings |
4 | - 'view' => [ |
|
5 | - 'blade_template_path' => '../app/View/', // String or array of multiple paths |
|
6 | - 'blade_cache_path' => '../app/View/cache', // Mandatory by default, though could probably turn caching off for development |
|
7 | - 'template' => 'blade', // template name |
|
8 | - ], |
|
4 | + 'view' => [ |
|
5 | + 'blade_template_path' => '../app/View/', // String or array of multiple paths |
|
6 | + 'blade_cache_path' => '../app/View/cache', // Mandatory by default, though could probably turn caching off for development |
|
7 | + 'template' => 'blade', // template name |
|
8 | + ], |
|
9 | 9 | ]; |
10 | 10 | ?> |
@@ -5,7 +5,7 @@ |
||
5 | 5 | 'displayErrorDetails' => true, |
6 | 6 | 'addContentLengthHeader' => true, |
7 | 7 | 'determineRouteBeforeAppMiddleware' => true, |
8 | - 'debug'=>true , |
|
8 | + 'debug'=>true, |
|
9 | 9 | 'image' => [ |
10 | 10 | 'dir' => $APPROOT . '/public/uploads' |
11 | 11 | ], |