@@ -5,7 +5,7 @@ |
||
5 | 5 | $this->data["content"] = $this->makePage(); |
6 | 6 | } |
7 | 7 | public function makePage() { |
8 | - $result = c_query("SELECT name FROM test","Error 01"); |
|
8 | + $result = c_query("SELECT name FROM test", "Error 01"); |
|
9 | 9 | $output = $result[0]["name"]; |
10 | 10 | jBlock(); |
11 | 11 | ?> |
@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("jate.php"); |
3 | 3 | $connection = null; |
4 | - if($jConfig->connection["enable"]) |
|
4 | + if ($jConfig->connection["enable"]) |
|
5 | 5 | $connection = new Connection( |
6 | 6 | $jConfig->connection["server"] |
7 | 7 | , $jConfig->connection["database"] |
@@ -1,13 +1,14 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("jate.php"); |
3 | 3 | $connection = null; |
4 | - if($jConfig->connection["enable"]) |
|
5 | - $connection = new Connection( |
|
4 | + if($jConfig->connection["enable"]) { |
|
5 | + $connection = new Connection( |
|
6 | 6 | $jConfig->connection["server"] |
7 | 7 | , $jConfig->connection["database"] |
8 | 8 | , $jConfig->connection["user"] |
9 | 9 | , $jConfig->connection["password"] |
10 | 10 | ); |
11 | + } |
|
11 | 12 | $webApp = new WebApp(); |
12 | 13 | $webApp->addPages($jConfig->pages); |
13 | 14 | $webApp->setDefaultPage($jConfig->pages[0]); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("main.php"); |
3 | - if(!isset($_GET["page"])) $_GET["page"] = "home"; |
|
3 | + if (!isset($_GET["page"])) $_GET["page"] = "home"; |
|
4 | 4 | $webApp->fetchPage($_GET["page"]); |
5 | 5 | $webApp->draw(); |
6 | 6 | ?> |
@@ -1,6 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | require_once("main.php"); |
3 | - if(!isset($_GET["page"])) $_GET["page"] = "home"; |
|
3 | + if(!isset($_GET["page"])) { |
|
4 | + $_GET["page"] = "home"; |
|
5 | + } |
|
4 | 6 | $webApp->fetchPage($_GET["page"]); |
5 | 7 | $webApp->draw(); |
6 | 8 | ?> |
@@ -22,17 +22,17 @@ discard block |
||
22 | 22 | $percent; |
23 | 23 | foreach (getGitLog() as $i) { |
24 | 24 | $cont++; |
25 | - if($cont % $nPerCol == 1) |
|
25 | + if ($cont % $nPerCol == 1) |
|
26 | 26 | echo '<div class="row">'; |
27 | - if(isset($i["tag"])) { |
|
28 | - $percent = explode(".",$i["tag"]); |
|
27 | + if (isset($i["tag"])) { |
|
28 | + $percent = explode(".", $i["tag"]); |
|
29 | 29 | $percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]); |
30 | 30 | } |
31 | 31 | ?> |
32 | 32 | <div class="col-lg-<?=$dim?>"> |
33 | 33 | <div class="well well-sm miniblock"> |
34 | 34 | <div class="autor"><b>Autor:</b> <?=$i["author"]?><br></div> |
35 | - <div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) echo $i["tag"]?><br></div> |
|
35 | + <div class="tag"><b>Tag:</b> <?php if (isset($i["tag"])) echo $i["tag"]?><br></div> |
|
36 | 36 | <div class="date"><b>Date:</b> <?=$i["date"]?><br></div> |
37 | 37 | <div class="message"><b>Message:</b> <?=$i["message"]?><br></div> |
38 | 38 | <div class="progress"> |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | </div> |
45 | 45 | </div> |
46 | 46 | <?php |
47 | - if($cont % $nPerCol == 0) |
|
47 | + if ($cont % $nPerCol == 0) |
|
48 | 48 | echo '</div>'; |
49 | 49 | } ?> |
50 | 50 | </div> |
@@ -22,8 +22,9 @@ discard block |
||
22 | 22 | $percent; |
23 | 23 | foreach (getGitLog() as $i) { |
24 | 24 | $cont++; |
25 | - if($cont % $nPerCol == 1) |
|
26 | - echo '<div class="row">'; |
|
25 | + if($cont % $nPerCol == 1) { |
|
26 | + echo '<div class="row">'; |
|
27 | + } |
|
27 | 28 | if(isset($i["tag"])) { |
28 | 29 | $percent = explode(".",$i["tag"]); |
29 | 30 | $percent = 100 * intval($percent[0]) + 10 * intval($percent[1]) + intval($percent[2]); |
@@ -32,7 +33,8 @@ discard block |
||
32 | 33 | <div class="col-lg-<?=$dim?>"> |
33 | 34 | <div class="well well-sm miniblock"> |
34 | 35 | <div class="autor"><b>Autor:</b> <?=$i["author"]?><br></div> |
35 | - <div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) echo $i["tag"]?><br></div> |
|
36 | + <div class="tag"><b>Tag:</b> <?php if(isset($i["tag"])) { |
|
37 | + echo $i["tag"]?><br></div> |
|
36 | 38 | <div class="date"><b>Date:</b> <?=$i["date"]?><br></div> |
37 | 39 | <div class="message"><b>Message:</b> <?=$i["message"]?><br></div> |
38 | 40 | <div class="progress"> |
@@ -46,6 +48,7 @@ discard block |
||
46 | 48 | <?php |
47 | 49 | if($cont % $nPerCol == 0) |
48 | 50 | echo '</div>'; |
51 | +} |
|
49 | 52 | } ?> |
50 | 53 | </div> |
51 | 54 | </div> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!isset($GLOBALS["JATEPath"])) |
|
2 | + if (!isset($GLOBALS["JATEPath"])) |
|
3 | 3 | $GLOBALS["JATEPath"] = []; |
4 | 4 | $commonLocations = array( |
5 | 5 | "bower_components/JATE/dist/", |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | "../../dist/" |
8 | 8 | ); |
9 | 9 | foreach ($commonLocations as $i) |
10 | - if(file_exists($i."jate/coreEngine.php")) { |
|
10 | + if (file_exists($i."jate/coreEngine.php")) { |
|
11 | 11 | array_push($GLOBALS["JATEPath"], $i); |
12 | 12 | require_once($i."jate/coreEngine.php"); |
13 | 13 | break; |
@@ -1,14 +1,16 @@ |
||
1 | 1 | <?php |
2 | - if(!isset($GLOBALS["JATEPath"])) |
|
3 | - $GLOBALS["JATEPath"] = []; |
|
2 | + if(!isset($GLOBALS["JATEPath"])) { |
|
3 | + $GLOBALS["JATEPath"] = []; |
|
4 | + } |
|
4 | 5 | $commonLocations = array( |
5 | 6 | "bower_components/JATE/dist/", |
6 | 7 | "vendor/xaberr/jate/dist/", |
7 | 8 | "../../dist/" |
8 | 9 | ); |
9 | - foreach ($commonLocations as $i) |
|
10 | - if(file_exists($i."jate/coreEngine.php")) { |
|
10 | + foreach ($commonLocations as $i) { |
|
11 | + if(file_exists($i."jate/coreEngine.php")) { |
|
11 | 12 | array_push($GLOBALS["JATEPath"], $i); |
13 | + } |
|
12 | 14 | require_once($i."jate/coreEngine.php"); |
13 | 15 | break; |
14 | 16 | } |
@@ -5,20 +5,20 @@ |
||
5 | 5 | //JATE SUFF |
6 | 6 | require_once (end($GLOBALS["JATEPath"])."jate/functions/requirer.php"); |
7 | 7 | //USER STUFF |
8 | - requireComponent ("modules/JConfig/JConfig.php"); |
|
9 | - $jConfig = new JConfig(); |
|
8 | + requireComponent("modules/JConfig/JConfig.php"); |
|
9 | + $jConfig = new JConfig(); |
|
10 | 10 | $jConfig->import("config.json"); |
11 | 11 | //JATE STUFF |
12 | - requireComponent ("functions/folder.php"); |
|
12 | + requireComponent("functions/folder.php"); |
|
13 | 13 | |
14 | 14 | //JATE SUFF |
15 | - requireComponent ("modules/Module/Module.php"); |
|
16 | - requireComponents ("functions"); |
|
17 | - requireModules ("modules"); |
|
15 | + requireComponent("modules/Module/Module.php"); |
|
16 | + requireComponents("functions"); |
|
17 | + requireModules("modules"); |
|
18 | 18 | |
19 | 19 | //USER STUFF |
20 | - requireComponent ("config.php",false); |
|
21 | - requireModules ("modules",false); |
|
22 | - requireComponent ("pages/Template.php",false); |
|
23 | - requireComponents ("pages",false); |
|
20 | + requireComponent("config.php", false); |
|
21 | + requireModules("modules", false); |
|
22 | + requireComponent("pages/Template.php", false); |
|
23 | + requireComponents("pages", false); |
|
24 | 24 | ?> |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | - function getGitLog( $_dir = "./" ) { |
|
3 | - if(!file_exists($_dir)) return []; |
|
2 | + function getGitLog($_dir = "./") { |
|
3 | + if (!file_exists($_dir)) return []; |
|
4 | 4 | $currentDir = getcwd(); |
5 | 5 | chdir($_dir); |
6 | 6 | $git_history = []; |
7 | 7 | $git_logs = []; |
8 | - $gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel")); |
|
9 | - $rootPath = str_replace('\\', '/', getcwd ()); |
|
10 | - if( $gitPath != $rootPath ) { |
|
8 | + $gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel")); |
|
9 | + $rootPath = str_replace('\\', '/', getcwd()); |
|
10 | + if ($gitPath != $rootPath) { |
|
11 | 11 | chdir($currentDir); |
12 | 12 | return []; |
13 | 13 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $git_history[$last_hash]['date'] = date('d/m/Y H:i:s A', strtotime($date)); |
48 | 48 | } |
49 | 49 | else |
50 | - $git_history[$last_hash]['message'] .= $line ." "; |
|
50 | + $git_history[$last_hash]['message'] .= $line." "; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | chdir($currentDir); |
@@ -1,6 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | function getGitLog( $_dir = "./" ) { |
3 | - if(!file_exists($_dir)) return []; |
|
3 | + if(!file_exists($_dir)) { |
|
4 | + return []; |
|
5 | + } |
|
4 | 6 | $currentDir = getcwd(); |
5 | 7 | chdir($_dir); |
6 | 8 | $git_history = []; |
@@ -35,19 +37,17 @@ discard block |
||
35 | 37 | $tag = trim($tag[0]); |
36 | 38 | $git_history[$last_hash]['tag'] = $tag; |
37 | 39 | } |
38 | - } |
|
39 | - else if (strpos($line, 'Author') === 0) { |
|
40 | + } else if (strpos($line, 'Author') === 0) { |
|
40 | 41 | $author = explode(':', $line); |
41 | 42 | $author = trim(end($author)); |
42 | 43 | $git_history[$last_hash]['author'] = $author; |
43 | - } |
|
44 | - else if (strpos($line, 'Date') === 0) { |
|
44 | + } else if (strpos($line, 'Date') === 0) { |
|
45 | 45 | $date = explode(':', $line, 2); |
46 | 46 | $date = trim(end($date)); |
47 | 47 | $git_history[$last_hash]['date'] = date('d/m/Y H:i:s A', strtotime($date)); |
48 | + } else { |
|
49 | + $git_history[$last_hash]['message'] .= $line ." "; |
|
48 | 50 | } |
49 | - else |
|
50 | - $git_history[$last_hash]['message'] .= $line ." "; |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | chdir($currentDir); |
@@ -13,9 +13,9 @@ |
||
13 | 13 | } |
14 | 14 | |
15 | 15 | function minify_output($_buffer) { |
16 | - $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
|
17 | - $replace = array ( '>', '<', '\\1' ); |
|
18 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
16 | + $search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s'); |
|
17 | + $replace = array('>', '<', '\\1'); |
|
18 | + if (preg_match("/\<html/i", $_buffer) == 1 && preg_match("/\<\/html\>/i", $_buffer) == 1) |
|
19 | 19 | $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
20 | 20 | return utf8_encode($_buffer); |
21 | 21 | } |
@@ -15,8 +15,9 @@ |
||
15 | 15 | function minify_output($_buffer) { |
16 | 16 | $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' ); |
17 | 17 | $replace = array ( '>', '<', '\\1' ); |
18 | - if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) |
|
19 | - $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
18 | + if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1) { |
|
19 | + $_buffer = preg_replace($search, $replace, utf8_decode($_buffer)); |
|
20 | + } |
|
20 | 21 | return utf8_encode($_buffer); |
21 | 22 | } |
22 | 23 | ?> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - function htmlParser( $_str) { |
|
2 | + function htmlParser($_str) { |
|
3 | 3 | return htmlentities($_str, ENT_QUOTES | ENT_IGNORE, "UTF-8"); |
4 | 4 | } |
5 | 5 | ?> |