@@ -21,16 +21,19 @@ discard block |
||
21 | 21 | $this->server["RELATIVE"] = str_replace("/index.php", "", $_SERVER["PHP_SELF"]); |
22 | 22 | } |
23 | 23 | public function import( $_path, $_type = "misc" ) { |
24 | - if(!file_exists($_path)) |
|
25 | - Debug::fatal("File [$_path] not found."); |
|
24 | + if(!file_exists($_path)) { |
|
25 | + Debug::fatal("File [$_path] not found."); |
|
26 | + } |
|
26 | 27 | $data = file_get_contents($_path); |
27 | 28 | $data = json_decode($data); |
28 | - if($data === NULL) |
|
29 | - Debug::fatal("Error processing [$_path]"); |
|
30 | - if( $_type == "connection" ) |
|
31 | - $this->overlayConnection($data); |
|
32 | - else |
|
33 | - $this->overlayMisc($data); |
|
29 | + if($data === NULL) { |
|
30 | + Debug::fatal("Error processing [$_path]"); |
|
31 | + } |
|
32 | + if( $_type == "connection" ) { |
|
33 | + $this->overlayConnection($data); |
|
34 | + } else { |
|
35 | + $this->overlayMisc($data); |
|
36 | + } |
|
34 | 37 | } |
35 | 38 | protected function overlayConnection( $_data ) { |
36 | 39 | $this->connection = $this->obj2array($_data); |
@@ -50,8 +53,9 @@ discard block |
||
50 | 53 | return $return; |
51 | 54 | } |
52 | 55 | protected function importObject( $_object ) { |
53 | - foreach (get_object_vars($_object) as $key => $value) |
|
54 | - $this->$key = $value; |
|
56 | + foreach (get_object_vars($_object) as $key => $value) { |
|
57 | + $this->$key = $value; |
|
58 | + } |
|
55 | 59 | } |
56 | 60 | } |
57 | 61 | ?> |
@@ -18,8 +18,9 @@ discard block |
||
18 | 18 | } |
19 | 19 | |
20 | 20 | function jBlockFileMan( $_path, $_type, $_parameters = [] ) { |
21 | - if(!file_exists($_path)) |
|
22 | - Debug::fatal("File [$_path] not found."); |
|
21 | + if(!file_exists($_path)) { |
|
22 | + Debug::fatal("File [$_path] not found."); |
|
23 | + } |
|
23 | 24 | $temp = file_get_contents($_path); |
24 | 25 | return jBlockParsing($_type, $temp, $_parameters); |
25 | 26 | } |
@@ -54,8 +55,9 @@ discard block |
||
54 | 55 | function minifyOutput($_buffer) { |
55 | 56 | $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
56 | 57 | $replace = array ( '>', '<', '\\1' ); |
57 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
58 | - $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
58 | + if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) { |
|
59 | + $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
60 | + } |
|
59 | 61 | return utf8_encode($_buffer); |
60 | 62 | } |
61 | 63 | ?> |