@@ -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 | } |
@@ -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 | } |
@@ -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> |
@@ -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> |
@@ -7,6 +7,11 @@ |
||
7 | 7 | $this->connection = []; |
8 | 8 | $this->currentConnection = null; |
9 | 9 | } |
10 | + |
|
11 | + /** |
|
12 | + * @param string $_name |
|
13 | + * @param Connection|null $_connection |
|
14 | + */ |
|
10 | 15 | public function addConnection( $_name, $_connection ) { |
11 | 16 | $this->connection["$_name"] = $_connection; |
12 | 17 | $this->currentConnection = $_connection; |
@@ -7,42 +7,42 @@ |
||
7 | 7 | $this->connection = []; |
8 | 8 | $this->currentConnection = null; |
9 | 9 | } |
10 | - public function addConnection( $_name, $_connection ) { |
|
10 | + public function addConnection($_name, $_connection) { |
|
11 | 11 | $this->connection["$_name"] = $_connection; |
12 | 12 | $this->currentConnection = $_connection; |
13 | 13 | |
14 | 14 | foreach ($this->modules as &$module) |
15 | - if(isset($module->currentConnection)) |
|
15 | + if (isset($module->currentConnection)) |
|
16 | 16 | $module->addConnection($_name, $_connection); |
17 | 17 | } |
18 | - public function setConnection( $_name ) { |
|
18 | + public function setConnection($_name) { |
|
19 | 19 | $this->currentConnection = $this->connection["$_name"]; |
20 | 20 | } |
21 | - public function query( $_query ) { |
|
21 | + public function query($_query) { |
|
22 | 22 | $this->stdQuery($_query); |
23 | 23 | return true; |
24 | 24 | } |
25 | - public function queryInsert( $_query ) { |
|
25 | + public function queryInsert($_query) { |
|
26 | 26 | $temp = $this->stdQuery($_query); |
27 | 27 | return $this->currentConnection->database->lastInsertId(); |
28 | 28 | } |
29 | 29 | |
30 | - public function queryFetch( $_query ) { |
|
30 | + public function queryFetch($_query) { |
|
31 | 31 | $temp = $this->stdQuery($_query); |
32 | 32 | return $temp->fetchAll(PDO::FETCH_ASSOC); |
33 | 33 | } |
34 | 34 | |
35 | - public function queryArray( $_query ) { |
|
35 | + public function queryArray($_query) { |
|
36 | 36 | $temp = $this->stdQuery($_query); |
37 | 37 | return $temp->fetchAll(PDO::FETCH_COLUMN, 0); |
38 | 38 | } |
39 | 39 | |
40 | - protected function stdQuery( $_query ) { |
|
40 | + protected function stdQuery($_query) { |
|
41 | 41 | $database = $this->currentConnection->database; |
42 | 42 | $error = "Error query [$_query]"; |
43 | 43 | $query = $database->prepare($_query); |
44 | 44 | $_result = $query->execute(); |
45 | - if(!$_result) { |
|
45 | + if (!$_result) { |
|
46 | 46 | echo "$_query<br>"; |
47 | 47 | echo "Something wrong: $error"; |
48 | 48 | var_dump($query->errorInfo()); |
@@ -11,9 +11,10 @@ |
||
11 | 11 | $this->connection["$_name"] = $_connection; |
12 | 12 | $this->currentConnection = $_connection; |
13 | 13 | |
14 | - foreach ($this->modules as &$module) |
|
15 | - if(isset($module->currentConnection)) |
|
14 | + foreach ($this->modules as &$module) { |
|
15 | + if(isset($module->currentConnection)) |
|
16 | 16 | $module->addConnection($_name, $_connection); |
17 | + } |
|
17 | 18 | } |
18 | 19 | public function setConnection( $_name ) { |
19 | 20 | $this->currentConnection = $this->connection["$_name"]; |
@@ -1,4 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | + /** |
|
3 | + * @param string $_path |
|
4 | + */ |
|
2 | 5 | function requireComponent( $_path, $_local = true ) { |
3 | 6 | $path = getJFolder($_path, $_local, debug_backtrace()); |
4 | 7 | if(file_exists($path) && isPhp($path)) |
@@ -6,6 +9,10 @@ discard block |
||
6 | 9 | else |
7 | 10 | requireError($_path); |
8 | 11 | } |
12 | + |
|
13 | + /** |
|
14 | + * @param string $_path |
|
15 | + */ |
|
9 | 16 | function requireComponents( $_path, $_local = true ) { |
10 | 17 | $path = getJFolder($_path, $_local, debug_backtrace()); |
11 | 18 | if(file_exists($path)) { |
@@ -38,6 +45,10 @@ discard block |
||
38 | 45 | $path = getJFolder($_path, $_local, debug_backtrace()); |
39 | 46 | require_once( $path ); |
40 | 47 | } |
48 | + |
|
49 | + /** |
|
50 | + * @param boolean $_local |
|
51 | + */ |
|
41 | 52 | function getJFolder( $_path, $_local, $_stack ) { |
42 | 53 | if($_local) { |
43 | 54 | $stackInfo = $_stack; |
@@ -1,45 +1,45 @@ |
||
1 | 1 | <?php |
2 | - function requireComponent( $_path, $_local = true ) { |
|
2 | + function requireComponent($_path, $_local = true) { |
|
3 | 3 | $path = getJFolder($_path, $_local, debug_backtrace()); |
4 | - if(file_exists($path) && isPhp($path)) |
|
4 | + if (file_exists($path) && isPhp($path)) |
|
5 | 5 | jRequire($path, false, 0); |
6 | 6 | else |
7 | 7 | requireError($_path); |
8 | 8 | } |
9 | - function requireComponents( $_path, $_local = true ) { |
|
9 | + function requireComponents($_path, $_local = true) { |
|
10 | 10 | $path = getJFolder($_path, $_local, debug_backtrace()); |
11 | - if(file_exists($path)) { |
|
11 | + if (file_exists($path)) { |
|
12 | 12 | $files = subFolderFile($path); |
13 | 13 | foreach ($files as $i) { |
14 | - if(isPhp($path."/".$i)) |
|
14 | + if (isPhp($path."/".$i)) |
|
15 | 15 | requireComponent($path."/".$i, false, 0); |
16 | 16 | } |
17 | 17 | } else |
18 | 18 | requireError($_path); |
19 | 19 | } |
20 | - function requireError( $_path ) { |
|
20 | + function requireError($_path) { |
|
21 | 21 | global $DEBUG; |
22 | - if( $DEBUG == 1 ) |
|
22 | + if ($DEBUG == 1) |
|
23 | 23 | echo "Error load ($_path)<br>"; |
24 | 24 | } |
25 | - function isPhp ( $_file ) { |
|
26 | - if(!is_file($_file)) return false; |
|
25 | + function isPhp($_file) { |
|
26 | + if (!is_file($_file)) return false; |
|
27 | 27 | $info = pathinfo($_file); |
28 | 28 | return ($info["extension"] == "php") || ($info["extension"] == "PHP"); |
29 | 29 | } |
30 | - function requireModules( $_path, $_local = true ) { |
|
30 | + function requireModules($_path, $_local = true) { |
|
31 | 31 | $path = getJFolder($_path, $_local, debug_backtrace()); |
32 | 32 | $subFolders = subFolderDir($path); |
33 | 33 | foreach ($subFolders as $i) { |
34 | 34 | requireComponents($path."/".$i, false, 0); |
35 | 35 | } |
36 | 36 | } |
37 | - function jRequire( $_path, $_local = true ) { |
|
37 | + function jRequire($_path, $_local = true) { |
|
38 | 38 | $path = getJFolder($_path, $_local, debug_backtrace()); |
39 | - require_once( $path ); |
|
39 | + require_once($path); |
|
40 | 40 | } |
41 | - function getJFolder( $_path, $_local, $_stack ) { |
|
42 | - if($_local) { |
|
41 | + function getJFolder($_path, $_local, $_stack) { |
|
42 | + if ($_local) { |
|
43 | 43 | $stackInfo = $_stack; |
44 | 44 | $folder = dirname($stackInfo[0]["file"]); |
45 | 45 | $file = "$folder/$_path"; |
@@ -1,29 +1,35 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | function requireComponent( $_path, $_local = true ) { |
3 | 3 | $path = getJFolder($_path, $_local, debug_backtrace()); |
4 | - if(file_exists($path) && isPhp($path)) |
|
5 | - jRequire($path, false, 0); |
|
6 | - else |
|
7 | - requireError($_path); |
|
4 | + if(file_exists($path) && isPhp($path)) { |
|
5 | + jRequire($path, false, 0); |
|
6 | + } else { |
|
7 | + requireError($_path); |
|
8 | + } |
|
8 | 9 | } |
9 | 10 | function requireComponents( $_path, $_local = true ) { |
10 | 11 | $path = getJFolder($_path, $_local, debug_backtrace()); |
11 | 12 | if(file_exists($path)) { |
12 | 13 | $files = subFolderFile($path); |
13 | 14 | foreach ($files as $i) { |
14 | - if(isPhp($path."/".$i)) |
|
15 | - requireComponent($path."/".$i, false, 0); |
|
15 | + if(isPhp($path."/".$i)) { |
|
16 | + requireComponent($path."/".$i, false, 0); |
|
17 | + } |
|
16 | 18 | } |
17 | - } else |
|
18 | - requireError($_path); |
|
19 | + } else { |
|
20 | + requireError($_path); |
|
21 | + } |
|
19 | 22 | } |
20 | 23 | function requireError( $_path ) { |
21 | 24 | global $DEBUG; |
22 | - if( $DEBUG == 1 ) |
|
23 | - echo "Error load ($_path)<br>"; |
|
25 | + if( $DEBUG == 1 ) { |
|
26 | + echo "Error load ($_path)<br>"; |
|
27 | + } |
|
24 | 28 | } |
25 | 29 | function isPhp ( $_file ) { |
26 | - if(!is_file($_file)) return false; |
|
30 | + if(!is_file($_file)) { |
|
31 | + return false; |
|
32 | + } |
|
27 | 33 | $info = pathinfo($_file); |
28 | 34 | return ($info["extension"] == "php") || ($info["extension"] == "PHP"); |
29 | 35 | } |
@@ -43,8 +49,9 @@ discard block |
||
43 | 49 | $stackInfo = $_stack; |
44 | 50 | $folder = dirname($stackInfo[0]["file"]); |
45 | 51 | $file = "$folder/$_path"; |
46 | - } else |
|
47 | - $file = $_path; |
|
52 | + } else { |
|
53 | + $file = $_path; |
|
54 | + } |
|
48 | 55 | return $file; |
49 | 56 | } |
50 | 57 | ?> |
@@ -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,45 +6,45 @@ |
||
6 | 6 | public $pages; |
7 | 7 | public $server; |
8 | 8 | public function __construct() { |
9 | - $this->connection["enable"] = false; |
|
10 | - $this->connection["user"] = ""; |
|
9 | + $this->connection["enable"] = false; |
|
10 | + $this->connection["user"] = ""; |
|
11 | 11 | $this->connection["password"] = ""; |
12 | 12 | $this->connection["database"] = ""; |
13 | - $this->connection["server"] = ""; |
|
14 | - $this->all = ""; |
|
13 | + $this->connection["server"] = ""; |
|
14 | + $this->all = ""; |
|
15 | 15 | $this->DEBUG = 0; |
16 | 16 | $this->pages = []; |
17 | - $this->server = []; |
|
17 | + $this->server = []; |
|
18 | 18 | $this->server["HTTP_HOST"] = $_SERVER["HTTP_HOST"]; |
19 | - $this->server["REQUEST_URI"] = $_SERVER["REQUEST_URI"]; |
|
19 | + $this->server["REQUEST_URI"] = $_SERVER["REQUEST_URI"]; |
|
20 | 20 | $this->server["PHP_SELF"] = $_SERVER["PHP_SELF"]; |
21 | 21 | } |
22 | - public function import( $_path, $_type = "misc" ) { |
|
22 | + public function import($_path, $_type = "misc") { |
|
23 | 23 | $data = file_get_contents($_path); |
24 | 24 | $data = json_decode($data); |
25 | - if( $_type == "connection" ) |
|
25 | + if ($_type == "connection") |
|
26 | 26 | $this->overlayConnection($data); |
27 | 27 | else |
28 | 28 | $this->overlayMisc($data); |
29 | 29 | } |
30 | - protected function overlayConnection( $_data ) { |
|
30 | + protected function overlayConnection($_data) { |
|
31 | 31 | $this->connection = $this->obj2array($_data); |
32 | 32 | } |
33 | - protected function overlayMisc( $_data ) { |
|
33 | + protected function overlayMisc($_data) { |
|
34 | 34 | $this->importObject($_data); |
35 | 35 | } |
36 | - protected function obj2array ( &$_instance ) { |
|
37 | - $clone = (array) $_instance; |
|
36 | + protected function obj2array(&$_instance) { |
|
37 | + $clone = (array) $_instance; |
|
38 | 38 | $return = []; |
39 | 39 | $return['___SOURCE_KEYS_'] = $clone; |
40 | - while ( list ($key, $value) = each ($clone) ) { |
|
41 | - $temp = explode ("\0", $key); |
|
42 | - $newkey = $temp[count($temp)-1]; |
|
40 | + while (list ($key, $value) = each($clone)) { |
|
41 | + $temp = explode("\0", $key); |
|
42 | + $newkey = $temp[count($temp) - 1]; |
|
43 | 43 | $return[$newkey] = &$return['___SOURCE_KEYS_'][$key]; |
44 | 44 | } |
45 | 45 | return $return; |
46 | 46 | } |
47 | - protected function importObject( $_object ) { |
|
47 | + protected function importObject($_object) { |
|
48 | 48 | foreach (get_object_vars($_object) as $key => $value) |
49 | 49 | $this->$key = $value; |
50 | 50 | } |
@@ -1,15 +1,15 @@ |
||
1 | 1 | <?php |
2 | - function getGitLog( $_dir = "./" ) { |
|
3 | - if(!file_exists($_dir)) |
|
2 | + function getGitLog($_dir = "./") { |
|
3 | + if (!file_exists($_dir)) |
|
4 | 4 | return []; |
5 | 5 | $currentDir = getcwd(); |
6 | 6 | chdir($_dir); |
7 | 7 | $gitHistory = []; |
8 | 8 | $gitLogs = []; |
9 | 9 | $gitPath = str_replace('\\', '/', exec("git rev-parse --show-toplevel")); |
10 | - $rootPath = str_replace('\\', '/', getcwd ()); |
|
10 | + $rootPath = str_replace('\\', '/', getcwd()); |
|
11 | 11 | $lastHash = null; |
12 | - if( $gitPath != $rootPath ) { |
|
12 | + if ($gitPath != $rootPath) { |
|
13 | 13 | chdir($currentDir); |
14 | 14 | return []; |
15 | 15 | } |
@@ -1,7 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | function getGitLog( $_dir = "./" ) { |
3 | - if(!file_exists($_dir)) |
|
4 | - return []; |
|
3 | + if(!file_exists($_dir)) { |
|
4 | + return []; |
|
5 | + } |
|
5 | 6 | $currentDir = getcwd(); |
6 | 7 | chdir($_dir); |
7 | 8 | $gitHistory = []; |
@@ -35,19 +36,17 @@ discard block |
||
35 | 36 | $tag = trim($tag[0]); |
36 | 37 | $gitHistory[$lastHash]['tag'] = $tag; |
37 | 38 | } |
38 | - } |
|
39 | - else if (strpos($line, 'Author') === 0) { |
|
39 | + } else if (strpos($line, 'Author') === 0) { |
|
40 | 40 | $author = explode(':', $line); |
41 | 41 | $author = trim(end($author)); |
42 | 42 | $gitHistory[$lastHash]['author'] = $author; |
43 | - } |
|
44 | - else if (strpos($line, 'Date') === 0) { |
|
43 | + } else if (strpos($line, 'Date') === 0) { |
|
45 | 44 | $date = explode(':', $line, 2); |
46 | 45 | $date = trim(end($date)); |
47 | 46 | $gitHistory[$lastHash]['date'] = date('d/m/Y H:i:s A', strtotime($date)); |
47 | + } else { |
|
48 | + $gitHistory[$lastHash]['message'] .= "$line<br>"; |
|
48 | 49 | } |
49 | - else |
|
50 | - $gitHistory[$lastHash]['message'] .= "$line<br>"; |
|
51 | 50 | } |
52 | 51 | } |
53 | 52 | chdir($currentDir); |
@@ -26,17 +26,20 @@ |
||
26 | 26 | $this->tags["js"] = array_unique($this->tags["js"]); |
27 | 27 | $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
28 | 28 | $tempStr = ""; |
29 | - foreach ($this->tags["css"] as $i) |
|
30 | - $tempStr .= "<link rel='stylesheet' href='$i'>"; |
|
29 | + foreach ($this->tags["css"] as $i) { |
|
30 | + $tempStr .= "<link rel='stylesheet' href='$i'>"; |
|
31 | + } |
|
31 | 32 | $this->tags["css"] = $tempStr; |
32 | 33 | $tempStr = ""; |
33 | - foreach ($this->tags["js"] as $i) |
|
34 | - $tempStr .= "<script src='$i'></script>"; |
|
34 | + foreach ($this->tags["js"] as $i) { |
|
35 | + $tempStr .= "<script src='$i'></script>"; |
|
36 | + } |
|
35 | 37 | $this->tags["js"] = $tempStr; |
36 | 38 | $tempStr = ""; |
37 | 39 | $tempStr .= "<script type='text/javascript'>"; |
38 | - foreach ($this->tags["jsVariables"] as $i) |
|
39 | - $tempStr .= " $i[0] = $i[1];\n"; |
|
40 | + foreach ($this->tags["jsVariables"] as $i) { |
|
41 | + $tempStr .= " $i[0] = $i[1];\n"; |
|
42 | + } |
|
40 | 43 | $tempStr .= "</script>"; |
41 | 44 | $this->tags["jsVariables"] = $tempStr; |
42 | 45 | } |
@@ -1,32 +1,32 @@ |
||
1 | 1 | <?php |
2 | 2 | requireComponent("../Query/Query.php"); |
3 | 3 | class Html extends Query { |
4 | - public function __construct( $_parameters = [ "app" => null, "page" => null] ) { |
|
4 | + public function __construct($_parameters = ["app" => null, "page" => null]) { |
|
5 | 5 | parent::__construct(); |
6 | 6 | $this->data["template"] = ""; |
7 | 7 | $this->tags["brand"] = ""; |
8 | 8 | $this->tags["brandImg"] = ""; |
9 | 9 | $this->tags["menu"] = ""; |
10 | 10 | $this->tags["title"] = ""; |
11 | - $this->tags["subtitle"] = ""; |
|
11 | + $this->tags["subtitle"] = ""; |
|
12 | 12 | $this->tags["content"] = ""; |
13 | - $this->tags["outContent"] = ""; |
|
13 | + $this->tags["outContent"] = ""; |
|
14 | 14 | $this->tags["footer"] = ""; |
15 | 15 | $this->tags["pagePath"] = []; |
16 | - $this->tags["css"] = []; |
|
17 | - $this->tags["js"] = []; |
|
16 | + $this->tags["css"] = []; |
|
17 | + $this->tags["js"] = []; |
|
18 | 18 | $this->tags["jsVariables"] = []; |
19 | - $this->tags["metaDescription"] = []; |
|
20 | - $this->tags["metaKeywords"] = []; |
|
19 | + $this->tags["metaDescription"] = []; |
|
20 | + $this->tags["metaKeywords"] = []; |
|
21 | 21 | $this->tags["metaAuthor"] = []; |
22 | - $this->parameters = $_parameters; |
|
23 | - $this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/"; |
|
22 | + $this->parameters = $_parameters; |
|
23 | + $this->tags["base"] = $_parameters["app"]->server["RELATIVE"]."/"; |
|
24 | 24 | } |
25 | 25 | public function uniforma() { |
26 | 26 | $this->addDipendences(); |
27 | 27 | $this->tags["css"] = array_unique($this->tags["css"]); |
28 | 28 | $this->tags["js"] = array_unique($this->tags["js"]); |
29 | - $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
|
29 | + $this->tags["pagePath"] = json_encode($this->tags["pagePath"]); |
|
30 | 30 | $tempStr = ""; |
31 | 31 | foreach ($this->tags["css"] as $i) |
32 | 32 | $tempStr .= "<link rel='stylesheet' href='$i'>"; |