@@ -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,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; |
@@ -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); |
@@ -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 | } |
@@ -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 | ?> |
@@ -7,37 +7,37 @@ |
||
7 | 7 | public function __construct() { |
8 | 8 | parent::__construct(); |
9 | 9 | $this->pages = []; |
10 | - $this->defaultPage = ["Page404",[]]; |
|
10 | + $this->defaultPage = ["Page404", []]; |
|
11 | 11 | $this->currentPage = null; |
12 | 12 | $this->connection = null; |
13 | 13 | } |
14 | - public function addPage( $_page ) { |
|
14 | + public function addPage($_page) { |
|
15 | 15 | $label = ""; |
16 | 16 | $class = ""; |
17 | 17 | $param = []; |
18 | - if(is_array($_page)) { |
|
18 | + if (is_array($_page)) { |
|
19 | 19 | $label = $_page[0]; |
20 | 20 | $class = $_page[1]; |
21 | - if(isset($_page[2])) |
|
21 | + if (isset($_page[2])) |
|
22 | 22 | $param = $_page[2]; |
23 | 23 | } else { |
24 | 24 | $label = $_page; |
25 | 25 | $class = $_page; |
26 | 26 | } |
27 | - $this->pages[$label] = [$class,$param]; |
|
27 | + $this->pages[$label] = [$class, $param]; |
|
28 | 28 | } |
29 | - public function addPages( $_pages ) { |
|
29 | + public function addPages($_pages) { |
|
30 | 30 | foreach ($_pages as $i) |
31 | 31 | $this->addPage($i); |
32 | 32 | } |
33 | - public function fetchPage( $_label ) { |
|
33 | + public function fetchPage($_label) { |
|
34 | 34 | $temp = $this->defaultPage; |
35 | - if(isset($this->pages[$_label])) |
|
35 | + if (isset($this->pages[$_label])) |
|
36 | 36 | $temp = $this->pages[$_label]; |
37 | 37 | $this->currentPage = new $temp[0]($temp[1]); |
38 | 38 | return $this->currentPage; |
39 | 39 | } |
40 | - public function setDefaultPage( $_page ) { |
|
40 | + public function setDefaultPage($_page) { |
|
41 | 41 | $this->defaultPage = $_page; |
42 | 42 | } |
43 | 43 | public function draw() { |
@@ -1,17 +1,17 @@ |
||
1 | 1 | <?php |
2 | 2 | class Statistic extends Module { |
3 | - public function __construct( $_webApp ) { |
|
3 | + public function __construct($_webApp) { |
|
4 | 4 | parent::__construct(); |
5 | 5 | $pages = []; |
6 | 6 | $stats = []; |
7 | 7 | $pages = $_webApp->pages; |
8 | - foreach ( $pages as $k => $v ) { |
|
8 | + foreach ($pages as $k => $v) { |
|
9 | 9 | $temp = new $v[0]($v[1]); |
10 | 10 | $temp->addDipendences(); |
11 | 11 | $stats[$k] = []; |
12 | 12 | $stats[$k]["page"] = $v[0]; |
13 | 13 | $stats[$k]["css"] = $temp->data["css"]; |
14 | - $stats[$k]["js"] = $temp->data["js"]; |
|
14 | + $stats[$k]["js"] = $temp->data["js"]; |
|
15 | 15 | } |
16 | 16 | $this->data = $stats; |
17 | 17 | } |
@@ -7,20 +7,20 @@ |
||
7 | 7 | parent::__construct(); |
8 | 8 | $args = func_get_args(); |
9 | 9 | $count = func_num_args(); |
10 | - if (method_exists($this,$func='__construct'.$count)) |
|
11 | - call_user_func_array(array($this,$func),$args); |
|
10 | + if (method_exists($this, $func = '__construct'.$count)) |
|
11 | + call_user_func_array(array($this, $func), $args); |
|
12 | 12 | } |
13 | 13 | public function __construct0() { |
14 | 14 | $this->connection = null; |
15 | 15 | $this->database = null; |
16 | 16 | } |
17 | - public function __construct4( $_srv, $_db, $_usr, $_pass) { |
|
17 | + public function __construct4($_srv, $_db, $_usr, $_pass) { |
|
18 | 18 | $this->connection = "mysql:host=$_srv;dbname=$_db"; |
19 | - $this->database = new PDO( $this->connection, $_usr, $_pass,array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'")); |
|
19 | + $this->database = new PDO($this->connection, $_usr, $_pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'")); |
|
20 | 20 | $this->info = []; |
21 | - $this->info["server"] = $_srv; |
|
21 | + $this->info["server"] = $_srv; |
|
22 | 22 | $this->info["database"] = $_db; |
23 | - $this->info["user"] = $_usr; |
|
23 | + $this->info["user"] = $_usr; |
|
24 | 24 | $this->info["password"] = $_pass; |
25 | 25 | } |
26 | 26 | } |