@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | // Check if vendor folder exist |
3 | 3 | if(file_exists(__DIR__ . '/../vendor')) { |
4 | - (require __DIR__ . '/../src/start.php')->run(); |
|
4 | + (require __DIR__ . '/../src/start.php')->run(); |
|
5 | 5 | } else { |
6 | 6 | ?> |
7 | 7 | <!DOCTYPE html> |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | // Check if vendor folder exist |
3 | -if(file_exists(__DIR__ . '/../vendor')) { |
|
3 | +if (file_exists(__DIR__ . '/../vendor')) { |
|
4 | 4 | (require __DIR__ . '/../src/start.php')->run(); |
5 | 5 | } else { |
6 | 6 | ?> |
@@ -114,13 +114,13 @@ |
||
114 | 114 | /** |
115 | 115 | * Administration delete page function |
116 | 116 | * |
117 | - * called to delete fpage and return to administration Pages section |
|
118 | - * |
|
119 | - * @param object $request |
|
120 | - * @param object $response |
|
121 | - * @param array $args |
|
122 | - * |
|
123 | - * @return object $response |
|
117 | + * called to delete fpage and return to administration Pages section |
|
118 | + * |
|
119 | + * @param object $request |
|
120 | + * @param object $response |
|
121 | + * @param array $args |
|
122 | + * |
|
123 | + * @return object $response |
|
124 | 124 | */ |
125 | 125 | public function adminDelPage(Request $request, Response $response, array $args): Response |
126 | 126 | { |
@@ -8,8 +8,7 @@ |
||
8 | 8 | |
9 | 9 | if (file_exists(EXTRACT_DIRECTORY.'/vendor/autoload.php') === true) { |
10 | 10 | echo "Extracted autoload already exists. Skipping phar extraction as presumably it's already extracted."; |
11 | -} |
|
12 | -else{ |
|
11 | +} else{ |
|
13 | 12 | $composerPhar = ROOT.'composer.phar'; |
14 | 13 | if (!file_exists($composerPhar)) { |
15 | 14 | $composer = file_get_contents('https://getcomposer.org/download/latest-stable/composer.phar'); |
@@ -3,20 +3,20 @@ |
||
3 | 3 | define('EXTRACT_DIRECTORY', "../composer"); |
4 | 4 | |
5 | 5 | if(file_exists(ROOT.'vendor')) { |
6 | - return header('Location: /'); |
|
6 | + return header('Location: /'); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | if (file_exists(EXTRACT_DIRECTORY.'/vendor/autoload.php') === true) { |
10 | - echo "Extracted autoload already exists. Skipping phar extraction as presumably it's already extracted."; |
|
10 | + echo "Extracted autoload already exists. Skipping phar extraction as presumably it's already extracted."; |
|
11 | 11 | } |
12 | 12 | else{ |
13 | - $composerPhar = ROOT.'composer.phar'; |
|
14 | - if (!file_exists($composerPhar)) { |
|
13 | + $composerPhar = ROOT.'composer.phar'; |
|
14 | + if (!file_exists($composerPhar)) { |
|
15 | 15 | $composer = file_get_contents('https://getcomposer.org/download/latest-stable/composer.phar'); |
16 | 16 | file_put_contents($composerPhar, $composer); |
17 | - } |
|
18 | - $composerExtract = new Phar($composerPhar); |
|
19 | - $composerExtract->extractTo(EXTRACT_DIRECTORY); |
|
17 | + } |
|
18 | + $composerExtract = new Phar($composerPhar); |
|
19 | + $composerExtract->extractTo(EXTRACT_DIRECTORY); |
|
20 | 20 | } |
21 | 21 | |
22 | 22 | require_once (EXTRACT_DIRECTORY.'/vendor/autoload.php'); |
@@ -2,15 +2,15 @@ discard block |
||
2 | 2 | define('ROOT', "../"); |
3 | 3 | define('EXTRACT_DIRECTORY', "../composer"); |
4 | 4 | |
5 | -if(file_exists(ROOT.'vendor')) { |
|
5 | +if (file_exists(ROOT . 'vendor')) { |
|
6 | 6 | return header('Location: /'); |
7 | 7 | } |
8 | 8 | |
9 | -if (file_exists(EXTRACT_DIRECTORY.'/vendor/autoload.php') === true) { |
|
9 | +if (file_exists(EXTRACT_DIRECTORY . '/vendor/autoload.php') === true) { |
|
10 | 10 | echo "Extracted autoload already exists. Skipping phar extraction as presumably it's already extracted."; |
11 | 11 | } |
12 | -else{ |
|
13 | - $composerPhar = ROOT.'composer.phar'; |
|
12 | +else { |
|
13 | + $composerPhar = ROOT . 'composer.phar'; |
|
14 | 14 | if (!file_exists($composerPhar)) { |
15 | 15 | $composer = file_get_contents('https://getcomposer.org/download/latest-stable/composer.phar'); |
16 | 16 | file_put_contents($composerPhar, $composer); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $composerExtract->extractTo(EXTRACT_DIRECTORY); |
20 | 20 | } |
21 | 21 | |
22 | -require_once (EXTRACT_DIRECTORY.'/vendor/autoload.php'); |
|
22 | +require_once (EXTRACT_DIRECTORY . '/vendor/autoload.php'); |
|
23 | 23 | |
24 | 24 | //Use the Composer classes |
25 | 25 | use Composer\Console\Application; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $container->set('themesdir', __DIR__ . '/../public/themes/'); |
39 | 39 | |
40 | 40 | // Set settings array in container for use in all routes |
41 | -$container->set('settings', function () { |
|
41 | +$container->set('settings', function() { |
|
42 | 42 | $config = file_get_contents(__DIR__ . '/../config/config.json'); |
43 | 43 | $settings = json_decode($config, true); |
44 | 44 | return $settings; |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | mkdir($container->get('cachedir'), 0755, true); |
74 | 74 | } else { |
75 | 75 | // Flush Cache folder if disabled |
76 | - if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true )) { |
|
76 | + if ((file_exists($container->get('cachedir'))) && ($settings["devMode"] == true)) { |
|
77 | 77 | $path = $container->get('cachedir'); |
78 | 78 | $files = glob($path . '/*'); |
79 | 79 | foreach ($files as $file) { |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | AppFactory::setContainer($container); |
88 | 88 | |
89 | 89 | // Set Twig engine for templating |
90 | -$container->set('view', function () { |
|
90 | +$container->set('view', function() { |
|
91 | 91 | $settings = json_decode(file_get_contents(__DIR__ . '/../config/config.json'), true); |
92 | 92 | $tpls = [ |
93 | 93 | __DIR__ . "/../resources/views/", |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | }); |
116 | 116 | |
117 | 117 | //Set Session engine |
118 | -$container->set('session', function () { |
|
118 | +$container->set('session', function() { |
|
119 | 119 | return new \SlimSession\Helper(); |
120 | 120 | }); |
121 | 121 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | // Admin routes |
168 | 168 | $app->get('/login', HomeController::class . ":login")->setName('login'); |
169 | 169 | $app->post('/login', HomeController::class . ":loginPost")->setName('login-post'); |
170 | -$app->group('/admin', function (RouteCollectorProxy $group) { |
|
170 | +$app->group('/admin', function(RouteCollectorProxy $group) { |
|
171 | 171 | $group->get('', AdminController::class . ":adminIndex")->setName('admin'); |
172 | 172 | $group->get('/social', AdminController::class . ":adminSocial")->setName('admin-social'); |
173 | 173 | $group->get('/wallet', WalletController::class . ":viewWallet")->setName('admin-wallet'); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | |
190 | 190 | foreach ($pages as $page) { |
191 | 191 | $route = substr($page, 0, strrpos($page, ".")); |
192 | - $app->get('/' . $route, function ($request, $response) { |
|
192 | + $app->get('/' . $route, function($request, $response) { |
|
193 | 193 | $settings = $this->get('settings'); |
194 | 194 | $uri = $request->getUri(); |
195 | 195 | $route = substr(strrchr($uri, "/"), 1); |