@@ -5,7 +5,7 @@ |
||
5 | 5 | 'displayErrorDetails' => true, |
6 | 6 | 'app' => [ |
7 | 7 | 'log_timer' => true, |
8 | - 'debug'=>true , |
|
8 | + 'debug'=>true, |
|
9 | 9 | 'image' => [ |
10 | 10 | 'dir' => __APP_ROOT__ . '/public/uploads' |
11 | 11 | ], |
@@ -2,15 +2,15 @@ |
||
2 | 2 | return [ |
3 | 3 | 'databases'=>[ |
4 | 4 | 'db' => [ |
5 | - 'driver' => $env(__APP_ROOT__,'DB_DRIVER', 'mysql'), |
|
6 | - 'host' => $env(__APP_ROOT__,'DB_HOST', 'localhost'), |
|
7 | - 'database' => $env(__APP_ROOT__,'DB_NAME', 'cafesaba'), |
|
8 | - 'username' => $env(__APP_ROOT__,'DB_USERNAME', 'root'), |
|
9 | - 'password' => $env(__APP_ROOT__,'DB_PASS', ''), |
|
10 | - 'charset' => $env(__APP_ROOT__,'DB_CHARSET', 'utf8'), |
|
11 | - 'collation' => $env(__APP_ROOT__,'DB_COLLATION', 'utf8_unicode_ci'), |
|
12 | - 'prefix' => $env(__APP_ROOT__,'DB_PREFIX', ''), |
|
13 | - 'port' => $env(__APP_ROOT__,'DB_PORT', 3306), |
|
5 | + 'driver' => $env(__APP_ROOT__, 'DB_DRIVER', 'mysql'), |
|
6 | + 'host' => $env(__APP_ROOT__, 'DB_HOST', 'localhost'), |
|
7 | + 'database' => $env(__APP_ROOT__, 'DB_NAME', 'cafesaba'), |
|
8 | + 'username' => $env(__APP_ROOT__, 'DB_USERNAME', 'root'), |
|
9 | + 'password' => $env(__APP_ROOT__, 'DB_PASS', ''), |
|
10 | + 'charset' => $env(__APP_ROOT__, 'DB_CHARSET', 'utf8'), |
|
11 | + 'collation' => $env(__APP_ROOT__, 'DB_COLLATION', 'utf8_unicode_ci'), |
|
12 | + 'prefix' => $env(__APP_ROOT__, 'DB_PREFIX', ''), |
|
13 | + 'port' => $env(__APP_ROOT__, 'DB_PORT', 3306), |
|
14 | 14 | ], |
15 | 15 | ] |
16 | 16 | ]; |
17 | 17 | \ No newline at end of file |
@@ -6,12 +6,12 @@ |
||
6 | 6 | use Illuminate\Database\Capsule\Manager as Capsule; |
7 | 7 | $env = new \Core\Helpers\Env(); |
8 | 8 | $config = include 'databases.php'; |
9 | -$capsule = new Capsule; |
|
9 | +$capsule = new Capsule; |
|
10 | 10 | $capsule->addConnection($config['databases']['db']); |
11 | 11 | $capsule->setAsGlobal(); |
12 | 12 | $capsule->bootEloquent(); |
13 | 13 | $container = new ArrayObject(); |
14 | 14 | $container['phpmig.adapter'] = new Adapter\Illuminate\Database($capsule, 'migrations'); |
15 | -$container['phpmig.migrations_path'] = 'database/migrations'; |
|
15 | +$container['phpmig.migrations_path'] = 'database/migrations'; |
|
16 | 16 | $container['phpmig.migrations_template_path'] = 'core/resources/templates/create_migration.txt'; |
17 | 17 | return $container; |
18 | 18 | \ No newline at end of file |
@@ -1,23 +1,23 @@ discard block |
||
1 | 1 | <?php |
2 | -define('__APP_ROOT__',__DIR__ . '/../') ; |
|
3 | -require __APP_ROOT__.'bootstrap/bootstrap.php'; |
|
4 | -require __APP_ROOT__.'vendor/autoload.php'; |
|
2 | +define('__APP_ROOT__', __DIR__ . '/../'); |
|
3 | +require __APP_ROOT__ . 'bootstrap/bootstrap.php'; |
|
4 | +require __APP_ROOT__ . 'vendor/autoload.php'; |
|
5 | 5 | |
6 | 6 | $env = new \Core\Helpers\Env(); |
7 | 7 | defined('DS') || define('DS', DIRECTORY_SEPARATOR); |
8 | 8 | |
9 | 9 | /*Dynamic containers in services*/ |
10 | -$config_dir = scandir(__APP_ROOT__.'/config/'); |
|
10 | +$config_dir = scandir(__APP_ROOT__ . '/config/'); |
|
11 | 11 | $ex_config_folders = array('..', '.'); |
12 | -$filesInConfig = array_diff($config_dir,$ex_config_folders); |
|
12 | +$filesInConfig = array_diff($config_dir, $ex_config_folders); |
|
13 | 13 | if (!isset($configs)) { |
14 | 14 | $configs = array(); |
15 | 15 | } |
16 | -$i=0; |
|
17 | -foreach($filesInConfig as $config_file){ |
|
18 | - if($config_file === 'phpmig.php'){continue;} |
|
19 | - $file[$i] = include_once __APP_ROOT__.'config/'.$config_file; |
|
20 | - if(is_array($file[$i])){ |
|
16 | +$i = 0; |
|
17 | +foreach ($filesInConfig as $config_file) { |
|
18 | + if ($config_file === 'phpmig.php') {continue; } |
|
19 | + $file[$i] = include_once __APP_ROOT__ . 'config/' . $config_file; |
|
20 | + if (is_array($file[$i])) { |
|
21 | 21 | $configs = array_merge($configs, $file[$i]); |
22 | 22 | $i++; |
23 | 23 | } |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | $config['settings'] = $configs; |
28 | -require __APP_ROOT__.'core/Functions/general_helpers.php'; |
|
28 | +require __APP_ROOT__ . 'core/Functions/general_helpers.php'; |
|
29 | 29 | |
30 | 30 | $app = new \Core\App($config); |
31 | -if($config['settings']['app']['debug'] && !$config['settings']['tracy']['active']){ |
|
31 | +if ($config['settings']['app']['debug'] && !$config['settings']['tracy']['active']) { |
|
32 | 32 | error_reporting(-1); |
33 | 33 | ini_set('display_errors', 1); |
34 | 34 | ini_set('display_startup_errors', 1); |
@@ -37,16 +37,16 @@ discard block |
||
37 | 37 | |
38 | 38 | use SlimFacades\Facade; |
39 | 39 | // get container app |
40 | -require __APP_ROOT__.'bootstrap/dependencies.php'; |
|
41 | -require __APP_ROOT__.'bootstrap/routes.php'; |
|
42 | -require __APP_ROOT__.'core/Functions/helpers.php'; |
|
43 | -if(php_sapi_name() != 'cli') { |
|
44 | - if($config['settings']['app']['debug'] && (int)$config['settings']['tracy']['active']){ |
|
40 | +require __APP_ROOT__ . 'bootstrap/dependencies.php'; |
|
41 | +require __APP_ROOT__ . 'bootstrap/routes.php'; |
|
42 | +require __APP_ROOT__ . 'core/Functions/helpers.php'; |
|
43 | +if (php_sapi_name() != 'cli') { |
|
44 | + if ($config['settings']['app']['debug'] && (int) $config['settings']['tracy']['active']) { |
|
45 | 45 | Tracy\Debugger::enable(Tracy\Debugger::DEVELOPMENT, $config['settings']['tracy']['path']); |
46 | 46 | } |
47 | 47 | Facade::setFacadeApplication($app); |
48 | 48 | |
49 | - require __APP_ROOT__.'bootstrap/middlewares.php'; |
|
49 | + require __APP_ROOT__ . 'bootstrap/middlewares.php'; |
|
50 | 50 | |
51 | 51 | $app->run(); |
52 | 52 |