@@ -47,14 +47,14 @@ |
||
47 | 47 | |
48 | 48 | $page = $this->di->get("page"); |
49 | 49 | $page->add( |
50 | - "anax/v2/dev/{$pages[$path]}", |
|
50 | + "anax/v2/dev/{$pages[ $path ]}", |
|
51 | 51 | [ |
52 | 52 | "mount" => "dev/" |
53 | 53 | ] |
54 | 54 | ); |
55 | 55 | |
56 | 56 | return $page->render([ |
57 | - "title" => ucfirst($pages[$path]), |
|
57 | + "title" => ucfirst($pages[ $path ]), |
|
58 | 58 | "baseTitle" => " | Anax development utilities" |
59 | 59 | ]); |
60 | 60 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | "submit" => [ |
51 | 51 | "type" => "submit", |
52 | 52 | "value" => "Answer", |
53 | - "callback" => [$this, "callbackSubmit"] |
|
53 | + "callback" => [ $this, "callbackSubmit" ] |
|
54 | 54 | ], |
55 | 55 | ] |
56 | 56 | ); |
@@ -49,7 +49,7 @@ |
||
49 | 49 | "submit" => [ |
50 | 50 | "type" => "submit", |
51 | 51 | "value" => "Skapa inlägg", |
52 | - "callback" => [$this, "callbackSubmit"] |
|
52 | + "callback" => [ $this, "callbackSubmit" ] |
|
53 | 53 | ], |
54 | 54 | ] |
55 | 55 | ); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | * "dsn" => "sqlite:memory::", |
15 | 15 | * |
16 | 16 | */ |
17 | -if ($_SERVER["SERVER_NAME"] === "www.student.bth.se") { |
|
17 | +if ($_SERVER[ "SERVER_NAME" ] === "www.student.bth.se") { |
|
18 | 18 | return [ |
19 | 19 | "dsn" => "mysql:host=blu-ray.student.bth.se;dbname=mos;", |
20 | 20 | "username" => "mos", |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | error_reporting(-1); // Report all type of errors |
25 | 25 | //error_reporting(E_ALL ^ E_DEPRECATED); // Report no deprecated errors |
26 | 26 | if (constant("ANAX_DEVELOPMENT")) { |
27 | - ini_set("display_errors", 1); // Display all errors |
|
27 | + ini_set("display_errors", 1); // Display all errors |
|
28 | 28 | } elseif (constant("ANAX_PRODUCTION")) { |
29 | - ini_set("display_errors", 0); // Display no errors |
|
30 | - ini_set("log_errors", 1); // Log errors to file error_log |
|
29 | + ini_set("display_errors", 0); // Display no errors |
|
30 | + ini_set("log_errors", 1); // Log errors to file error_log |
|
31 | 31 | ini_set("error_log", ANAX_INSTALL_PATH . "/log/error_log"); |
32 | 32 | } |
33 | 33 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | /** |
37 | 37 | * Default exception handler. |
38 | 38 | */ |
39 | -set_exception_handler(function ($e) { |
|
39 | +set_exception_handler(function($e) { |
|
40 | 40 | echo "<p>Anax: Uncaught exception:</p><p>Line " |
41 | 41 | . $e->getLine() |
42 | 42 | . " in file " |
@@ -6,7 +6,7 @@ |
||
6 | 6 | "services" => [ |
7 | 7 | "textfilter" => [ |
8 | 8 | "shared" => true, |
9 | - "callback" => function () { |
|
9 | + "callback" => function() { |
|
10 | 10 | $filter = new \Anax\TextFilter\TextFilter(); |
11 | 11 | if (is_dir(ANAX_INSTALL_PATH . "/content")) { |
12 | 12 | $filter->setFilterConfig("frontmatter", [ |
@@ -8,7 +8,7 @@ |
||
8 | 8 | "services" => [ |
9 | 9 | "configuration" => [ |
10 | 10 | "shared" => true, |
11 | - "callback" => function () { |
|
11 | + "callback" => function() { |
|
12 | 12 | $config = new \Anax\Configure\Configuration(); |
13 | 13 | $dirs = require ANAX_INSTALL_PATH . "/config/configuration.php"; |
14 | 14 | $config->setBaseDirectories($dirs); |
@@ -8,22 +8,22 @@ |
||
8 | 8 | "services" => [ |
9 | 9 | "page" => [ |
10 | 10 | "shared" => true, |
11 | - "callback" => function () { |
|
11 | + "callback" => function() { |
|
12 | 12 | $page = new \Anax\Page\Page(); |
13 | 13 | $page->setDI($this); |
14 | 14 | |
15 | 15 | // Load the configuration files |
16 | 16 | $cfg = $this->get("configuration"); |
17 | 17 | $config = $cfg->load("page.php"); |
18 | - $file = $config["file"] ?? null; |
|
18 | + $file = $config[ "file" ] ?? null; |
|
19 | 19 | |
20 | 20 | // Add all views from configuration |
21 | - $views = $config["config"]["views"] ?? []; |
|
21 | + $views = $config[ "config" ][ "views" ] ?? [ ]; |
|
22 | 22 | foreach ($views as $view) { |
23 | 23 | $page->add($view); |
24 | 24 | } |
25 | 25 | |
26 | - $layout = $config["config"]["layout"] ?? null; |
|
26 | + $layout = $config[ "config" ][ "layout" ] ?? null; |
|
27 | 27 | if (!$layout) { |
28 | 28 | throw new Exception("Missing configuration for layout in file '$file', its needed."); |
29 | 29 | } |
@@ -7,7 +7,7 @@ |
||
7 | 7 | "services" => [ |
8 | 8 | "request" => [ |
9 | 9 | "shared" => true, |
10 | - "callback" => function () { |
|
10 | + "callback" => function() { |
|
11 | 11 | $obj = new \Anax\Request\Request(); |
12 | 12 | $obj->init(); |
13 | 13 | return $obj; |