@@ -5,41 +5,41 @@ |
||
5 | 5 | public $DEBUG; |
6 | 6 | public $pages; |
7 | 7 | public function __construct() { |
8 | - $this->connection["enable"] = false; |
|
9 | - $this->connection["user"] = ""; |
|
8 | + $this->connection["enable"] = false; |
|
9 | + $this->connection["user"] = ""; |
|
10 | 10 | $this->connection["password"] = ""; |
11 | 11 | $this->connection["database"] = ""; |
12 | - $this->connection["server"] = ""; |
|
13 | - $this->all = ""; |
|
12 | + $this->connection["server"] = ""; |
|
13 | + $this->all = ""; |
|
14 | 14 | $this->DEBUG = 0; |
15 | 15 | $this->pages = []; |
16 | 16 | } |
17 | - public function import( $_path, $_type = "misc" ) { |
|
17 | + public function import($_path, $_type = "misc") { |
|
18 | 18 | $data = file_get_contents($_path); |
19 | 19 | $data = json_decode($data); |
20 | - if( $_type == "connection" ) |
|
20 | + if ($_type == "connection") |
|
21 | 21 | $this->overlayConnection($data); |
22 | 22 | else |
23 | 23 | $this->overlayMisc($data); |
24 | 24 | } |
25 | - protected function overlayConnection( $_data ) { |
|
25 | + protected function overlayConnection($_data) { |
|
26 | 26 | $this->connection = $this->obj2array($_data); |
27 | 27 | } |
28 | - protected function overlayMisc( $_data ) { |
|
28 | + protected function overlayMisc($_data) { |
|
29 | 29 | $this->importObject($_data); |
30 | 30 | } |
31 | - protected function obj2array ( &$_instance ) { |
|
32 | - $clone = (array) $_instance; |
|
31 | + protected function obj2array(&$_instance) { |
|
32 | + $clone = (array) $_instance; |
|
33 | 33 | $return = []; |
34 | 34 | $return['___SOURCE_KEYS_'] = $clone; |
35 | - while ( list ($key, $value) = each ($clone) ) { |
|
36 | - $temp = explode ("\0", $key); |
|
37 | - $newkey = $temp[count($temp)-1]; |
|
35 | + while (list ($key, $value) = each($clone)) { |
|
36 | + $temp = explode("\0", $key); |
|
37 | + $newkey = $temp[count($temp) - 1]; |
|
38 | 38 | $return[$newkey] = &$return['___SOURCE_KEYS_'][$key]; |
39 | 39 | } |
40 | 40 | return $return; |
41 | 41 | } |
42 | - protected function importObject( $_object ) { |
|
42 | + protected function importObject($_object) { |
|
43 | 43 | foreach (get_object_vars($_object) as $key => $value) |
44 | 44 | $this->$key = $value; |
45 | 45 | } |
@@ -17,10 +17,11 @@ discard block |
||
17 | 17 | public function import( $_path, $_type = "misc" ) { |
18 | 18 | $data = file_get_contents($_path); |
19 | 19 | $data = json_decode($data); |
20 | - if( $_type == "connection" ) |
|
21 | - $this->overlayConnection($data); |
|
22 | - else |
|
23 | - $this->overlayMisc($data); |
|
20 | + if( $_type == "connection" ) { |
|
21 | + $this->overlayConnection($data); |
|
22 | + } else { |
|
23 | + $this->overlayMisc($data); |
|
24 | + } |
|
24 | 25 | } |
25 | 26 | protected function overlayConnection( $_data ) { |
26 | 27 | $this->connection = $this->obj2array($_data); |
@@ -40,8 +41,9 @@ discard block |
||
40 | 41 | return $return; |
41 | 42 | } |
42 | 43 | protected function importObject( $_object ) { |
43 | - foreach (get_object_vars($_object) as $key => $value) |
|
44 | - $this->$key = $value; |
|
44 | + foreach (get_object_vars($_object) as $key => $value) { |
|
45 | + $this->$key = $value; |
|
46 | + } |
|
45 | 47 | } |
46 | 48 | } |
47 | 49 | ?> |
@@ -6,23 +6,23 @@ |
||
6 | 6 | require_once (end($GLOBALS["JATEPath"])."jate/functions/requirer.php"); |
7 | 7 | |
8 | 8 | //USER STUFF |
9 | - requireComponent ("modules/JConfig/JConfig.php"); |
|
10 | - $jConfig = new JConfig(); |
|
11 | - $jConfig->import("config/connection.json","connection"); |
|
9 | + requireComponent("modules/JConfig/JConfig.php"); |
|
10 | + $jConfig = new JConfig(); |
|
11 | + $jConfig->import("config/connection.json", "connection"); |
|
12 | 12 | $jConfig->import("config/misc.json"); |
13 | 13 | $jConfig->import("config/router.json"); |
14 | 14 | |
15 | 15 | //JATE STUFF |
16 | - requireComponent ("functions/folder.php"); |
|
16 | + requireComponent("functions/folder.php"); |
|
17 | 17 | |
18 | 18 | //JATE SUFF |
19 | - requireComponent ("modules/Module/Module.php"); |
|
20 | - requireComponents ("functions"); |
|
21 | - requireModules ("modules"); |
|
19 | + requireComponent("modules/Module/Module.php"); |
|
20 | + requireComponents("functions"); |
|
21 | + requireModules("modules"); |
|
22 | 22 | |
23 | 23 | //USER STUFF |
24 | - requireComponent ("config.php",false); |
|
25 | - requireModules ("modules",false); |
|
26 | - requireComponent ("pages/Template.php",false); |
|
27 | - requireComponents ("pages",false); |
|
24 | + requireComponent("config.php", false); |
|
25 | + requireModules("modules", false); |
|
26 | + requireComponent("pages/Template.php", false); |
|
27 | + requireComponents("pages", false); |
|
28 | 28 | ?> |