@@ -22,11 +22,11 @@ |
||
22 | 22 | |
23 | 23 | public function render(ResponseInterface $response, $template, array $data = []) |
24 | 24 | { |
25 | - if ($this->layout){ |
|
25 | + if ($this->layout) { |
|
26 | 26 | $viewOutput = $this->fetch($template, $data); |
27 | 27 | $layoutOutput = $this->fetch($this->layout, array('content' => $viewOutput)); |
28 | 28 | $response->getBody()->write($layoutOutput); |
29 | - } else { |
|
29 | + }else { |
|
30 | 30 | $output = parent::render($response, $template, $data); |
31 | 31 | $response->getBody()->write($output); |
32 | 32 | } |
@@ -5,12 +5,12 @@ |
||
5 | 5 | use Phpmig\Adapter; |
6 | 6 | use Illuminate\Database\Capsule\Manager as Capsule; |
7 | 7 | include 'settings.php'; |
8 | -$capsule = new Capsule; |
|
8 | +$capsule = new Capsule; |
|
9 | 9 | $capsule->addConnection($config['settings']['db']); |
10 | 10 | $capsule->setAsGlobal(); |
11 | 11 | $capsule->bootEloquent(); |
12 | 12 | $container = new ArrayObject(); |
13 | 13 | $container['phpmig.adapter'] = new Adapter\Illuminate\Database($capsule, 'migrations'); |
14 | -$container['phpmig.migrations_path'] = 'database/migrations'; |
|
14 | +$container['phpmig.migrations_path'] = 'database/migrations'; |
|
15 | 15 | $container['phpmig.migrations_template_path'] = 'core/resources/templates/create_migration.txt'; |
16 | 16 | return $container; |
17 | 17 | \ No newline at end of file |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | -define('__APP_ROOT__',__DIR__ . '/../') ; |
|
2 | +define('__APP_ROOT__', __DIR__ . '/../'); |
|
3 | 3 | |
4 | 4 | require '../bootstrap/server.php'; |
5 | 5 |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | /* database connection */ |
7 | 7 | |
8 | 8 | |
9 | -$container['db'] = function ($container) { |
|
9 | +$container['db'] = function($container) { |
|
10 | 10 | $db = $container['settings']['db']; |
11 | 11 | $pdo = new PDO("mysql:host=" . $db['host'] . ";dbname=" . $db['database'], |
12 | 12 | $db['username'], $db['password']); |
@@ -18,19 +18,19 @@ discard block |
||
18 | 18 | // |
19 | 19 | |
20 | 20 | |
21 | -$c['generalErrorHandler'] = function ($container) { |
|
21 | +$c['generalErrorHandler'] = function($container) { |
|
22 | 22 | return new \Core\Handlers\GeneralErrorHandler($container); |
23 | 23 | }; |
24 | 24 | |
25 | 25 | |
26 | 26 | |
27 | 27 | // Service factory for the ORM |
28 | -$container['validator'] = function ($container) { |
|
28 | +$container['validator'] = function($container) { |
|
29 | 29 | return new App\Validation\Validator(); |
30 | 30 | }; |
31 | 31 | |
32 | 32 | |
33 | -$container['eloquent'] = function ($container) { |
|
33 | +$container['eloquent'] = function($container) { |
|
34 | 34 | $capsule = new \Illuminate\Database\Capsule\Manager; |
35 | 35 | $capsule->addConnection($container['settings']['db']); |
36 | 36 | $capsule->setAsGlobal(); |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | |
49 | 49 | |
50 | 50 | // monolog |
51 | -$container['logger'] = function ($c) { |
|
51 | +$container['logger'] = function($c) { |
|
52 | 52 | $settings = $c->get('settings')['logger']; |
53 | 53 | $logger = new Monolog\Logger($settings['name']); |
54 | 54 | $logger->pushProcessor(new Monolog\Processor\UidProcessor()); |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | }; |
58 | 58 | |
59 | 59 | // Register Blade View helper |
60 | -$container['view'] = function ($container) { |
|
60 | +$container['view'] = function($container) { |
|
61 | 61 | |
62 | 62 | $messages = $container->flash->getMessages(); |
63 | 63 | |
64 | 64 | |
65 | 65 | return new \Slim\Views\Blade( |
66 | - $container['settings']['view']['blade_template_path'].$container['settings']['view']['template'], |
|
66 | + $container['settings']['view']['blade_template_path'] . $container['settings']['view']['template'], |
|
67 | 67 | $container['settings']['view']['blade_cache_path'], |
68 | 68 | null, |
69 | 69 | [ |
@@ -75,13 +75,13 @@ discard block |
||
75 | 75 | $translator = new \Core\Translator\Translator($container); |
76 | 76 | $translator->init(); |
77 | 77 | |
78 | -$container['translator'] = function ($container) use ($translator) { |
|
78 | +$container['translator'] = function($container) use ($translator) { |
|
79 | 79 | return $translator; |
80 | 80 | }; |
81 | 81 | |
82 | 82 | |
83 | 83 | // Register provider |
84 | -$container['flash'] = function () { |
|
84 | +$container['flash'] = function() { |
|
85 | 85 | return new \Slim\Flash\Messages(); |
86 | 86 | }; |
87 | 87 |
@@ -26,9 +26,9 @@ |
||
26 | 26 | |
27 | 27 | |
28 | 28 | $route->post('/console', 'RunTracy\Controllers\RunTracyConsole:index'); |
29 | -$route->get('/', HomeController::class.':index'); |
|
30 | -$route->get('/register[/{params:.*}]', \App\Controller\User\AuthController::class.':get_register_Action'); |
|
31 | -$route->post('/register', \App\Controller\User\AuthController::class.':post_register_Action'); |
|
32 | -$route->get('/login', \App\Controller\User\AuthController::class.':get_login_Action'); |
|
33 | -$route->post('/login', \App\Controller\User\AuthController::class.':post_login_Action'); |
|
29 | +$route->get('/', HomeController::class . ':index'); |
|
30 | +$route->get('/register[/{params:.*}]', \App\Controller\User\AuthController::class . ':get_register_Action'); |
|
31 | +$route->post('/register', \App\Controller\User\AuthController::class . ':post_register_Action'); |
|
32 | +$route->get('/login', \App\Controller\User\AuthController::class . ':get_login_Action'); |
|
33 | +$route->post('/login', \App\Controller\User\AuthController::class . ':post_login_Action'); |
|
34 | 34 |
@@ -23,15 +23,15 @@ discard block |
||
23 | 23 | 'path' => __DIR__ . '/../storage/logs/app.log', |
24 | 24 | ], |
25 | 25 | 'db' => [ |
26 | - 'driver' => $env($APPROOT,'DB_DRIVER', 'mysql'), |
|
27 | - 'host' => $env($APPROOT,'DB_HOST', 'localhost'), |
|
28 | - 'database' => $env($APPROOT,'DB_NAME', 'cafesaba'), |
|
29 | - 'username' => $env($APPROOT,'DB_USERNAME', 'root'), |
|
30 | - 'password' => $env($APPROOT,'DB_PASS', 'root'), |
|
31 | - 'charset' => $env($APPROOT,'DB_CHARSET', 'utf8'), |
|
32 | - 'collation' => $env($APPROOT,'DB_COLLATION', 'utf8_unicode_ci'), |
|
33 | - 'prefix' => $env($APPROOT,'DB_PREFIX', ''), |
|
34 | - 'port' => $env($APPROOT,'DB_PORT', 3306), |
|
26 | + 'driver' => $env($APPROOT, 'DB_DRIVER', 'mysql'), |
|
27 | + 'host' => $env($APPROOT, 'DB_HOST', 'localhost'), |
|
28 | + 'database' => $env($APPROOT, 'DB_NAME', 'cafesaba'), |
|
29 | + 'username' => $env($APPROOT, 'DB_USERNAME', 'root'), |
|
30 | + 'password' => $env($APPROOT, 'DB_PASS', 'root'), |
|
31 | + 'charset' => $env($APPROOT, 'DB_CHARSET', 'utf8'), |
|
32 | + 'collation' => $env($APPROOT, 'DB_COLLATION', 'utf8_unicode_ci'), |
|
33 | + 'prefix' => $env($APPROOT, 'DB_PREFIX', ''), |
|
34 | + 'port' => $env($APPROOT, 'DB_PORT', 3306), |
|
35 | 35 | ], |
36 | 36 | 'view' => [ |
37 | 37 | 'path' => '../app/View', |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | 'showSlimEnvironmentPanel' => 1, |
50 | 50 | 'showSlimRequestPanel' => 1, |
51 | 51 | 'showSlimResponsePanel' => 1, |
52 | - 'showSlimContainer' =>1 , |
|
52 | + 'showSlimContainer' =>1, |
|
53 | 53 | 'showEloquentORMPanel' => 1, |
54 | - 'showIdiormPanel' => 0,// > 0 mean you enable logging |
|
54 | + 'showIdiormPanel' => 0, // > 0 mean you enable logging |
|
55 | 55 | // but show or not panel you decide in browser in panel selector |
56 | - 'showDoctrinePanel' => 'em',// here also enable logging and you must enter your Doctrine container name |
|
56 | + 'showDoctrinePanel' => 'em', // here also enable logging and you must enter your Doctrine container name |
|
57 | 57 | // and also as above show or not panel you decide in browser in panel selector |
58 | 58 | 'showProfilerPanel' => 1, |
59 | 59 | 'showVendorVersionsPanel' => 1, |