@@ -21,10 +21,11 @@ discard block |
||
| 21 | 21 | $temp = []; |
| 22 | 22 | if (is_dir($_dir)) { |
| 23 | 23 | if ($dirOpened = opendir($_dir)) { |
| 24 | - while (($file = readdir($dirOpened)) !== false) |
|
| 25 | - if( ($file !='.')&&($file !='..') ) |
|
| 24 | + while (($file = readdir($dirOpened)) !== false) { |
|
| 25 | + if( ($file !='.')&&($file !='..') ) |
|
| 26 | 26 | if($_function($file)) |
| 27 | 27 | array_push($temp,$file); |
| 28 | + } |
|
| 28 | 29 | closedir($dirOpened); |
| 29 | 30 | } |
| 30 | 31 | } |
@@ -32,14 +33,16 @@ discard block |
||
| 32 | 33 | } |
| 33 | 34 | function requireSubfolder( $_dir = "./" ) { |
| 34 | 35 | $temp = subFolderFile($_dir); |
| 35 | - foreach ($temp as $i) |
|
| 36 | - jRequire($_dir."/".$i); |
|
| 36 | + foreach ($temp as $i) { |
|
| 37 | + jRequire($_dir."/".$i); |
|
| 38 | + } |
|
| 37 | 39 | } |
| 38 | 40 | function require_js( $_dir = "./" ) { |
| 39 | 41 | $tempArray = []; |
| 40 | 42 | $temp = subFolderFile($_dir); |
| 41 | - foreach ($temp as $i) |
|
| 42 | - array_push($tempArray, $_dir."/".$i); |
|
| 43 | + foreach ($temp as $i) { |
|
| 44 | + array_push($tempArray, $_dir."/".$i); |
|
| 45 | + } |
|
| 43 | 46 | return $tempArray; |
| 44 | 47 | } |
| 45 | 48 | ?> |
@@ -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); |
@@ -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,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | - if(!isset($GLOBALS["JATEPath"])) |
|
| 3 | - $GLOBALS["JATEPath"] = []; |
|
| 2 | + if(!isset($GLOBALS["JATEPath"])) { |
|
| 3 | + $GLOBALS["JATEPath"] = []; |
|
| 4 | + } |
|
| 4 | 5 | $commonLocations = [ |
| 5 | 6 | "bower_components/JATE/dist/" |
| 6 | 7 | , "vendor/xaberr/jate/dist/" |
@@ -9,13 +10,15 @@ discard block |
||
| 9 | 10 | , dirname(__FILE__)."/" |
| 10 | 11 | ]; |
| 11 | 12 | $jSuccess = false; |
| 12 | - foreach ($commonLocations as $path) |
|
| 13 | - if(file_exists("${path}jate/coreEngine.php")) { |
|
| 13 | + foreach ($commonLocations as $path) { |
|
| 14 | + if(file_exists("${path}jate/coreEngine.php")) { |
|
| 14 | 15 | array_push($GLOBALS["JATEPath"], $path); |
| 16 | + } |
|
| 15 | 17 | require_once("${path}jate/coreEngine.php"); |
| 16 | 18 | $jSuccess = true; |
| 17 | 19 | break; |
| 18 | 20 | } |
| 19 | - if( !$jSuccess ) |
|
| 20 | - throw new Exception("JATE can't find coreEngine.php."); |
|
| 21 | -?> |
|
| 21 | + if( !$jSuccess ) { |
|
| 22 | + throw new Exception("JATE can't find coreEngine.php."); |
|
| 23 | + } |
|
| 24 | + ?> |
|
@@ -17,16 +17,18 @@ |
||
| 17 | 17 | public function queryFetch( $_query ) { |
| 18 | 18 | $result = $this->stdQuery($_query); |
| 19 | 19 | $rows = []; |
| 20 | - while($row = pg_fetch_assoc($result)) |
|
| 21 | - $rows[] = $row; |
|
| 20 | + while($row = pg_fetch_assoc($result)) { |
|
| 21 | + $rows[] = $row; |
|
| 22 | + } |
|
| 22 | 23 | pg_free_result($result); |
| 23 | 24 | return $rows; |
| 24 | 25 | } |
| 25 | 26 | public function queryArray( $_query ) { |
| 26 | 27 | $result = $this->stdQuery($_query); |
| 27 | 28 | $rows = []; |
| 28 | - while($row = pg_fetch_array($result)) |
|
| 29 | - $rows[] = $row; |
|
| 29 | + while($row = pg_fetch_array($result)) { |
|
| 30 | + $rows[] = $row; |
|
| 31 | + } |
|
| 30 | 32 | pg_free_result($result); |
| 31 | 33 | return $rows; |
| 32 | 34 | } |
@@ -5,8 +5,9 @@ discard block |
||
| 5 | 5 | private static $initialized = false; |
| 6 | 6 | private function __construct() {} |
| 7 | 7 | private static function initialize() { |
| 8 | - if (self::$initialized) |
|
| 9 | - return; |
|
| 8 | + if (self::$initialized) { |
|
| 9 | + return; |
|
| 10 | + } |
|
| 10 | 11 | self::$stack = []; |
| 11 | 12 | self::$initialized = true; |
| 12 | 13 | } |
@@ -44,8 +45,9 @@ discard block |
||
| 44 | 45 | self::$stack[] = $debugInfo; |
| 45 | 46 | } |
| 46 | 47 | public static function pop() { |
| 47 | - if(count(self::$stack)>0) |
|
| 48 | - self::$stack = array_shift(self::$stack); |
|
| 48 | + if(count(self::$stack)>0) { |
|
| 49 | + self::$stack = array_shift(self::$stack); |
|
| 50 | + } |
|
| 49 | 51 | } |
| 50 | 52 | public static function emptyStack() { |
| 51 | 53 | self::$stack = []; |
@@ -23,12 +23,14 @@ discard block |
||
| 23 | 23 | public function import( $_path, $_type = "misc" ) { |
| 24 | 24 | $data = file_get_contents($_path); |
| 25 | 25 | $data = json_decode($data); |
| 26 | - if($data === NULL) |
|
| 27 | - Debug::log("Error processing [$_path]"); |
|
| 28 | - if( $_type == "connection" ) |
|
| 29 | - $this->overlayConnection($data); |
|
| 30 | - else |
|
| 31 | - $this->overlayMisc($data); |
|
| 26 | + if($data === NULL) { |
|
| 27 | + Debug::log("Error processing [$_path]"); |
|
| 28 | + } |
|
| 29 | + if( $_type == "connection" ) { |
|
| 30 | + $this->overlayConnection($data); |
|
| 31 | + } else { |
|
| 32 | + $this->overlayMisc($data); |
|
| 33 | + } |
|
| 32 | 34 | } |
| 33 | 35 | protected function overlayConnection( $_data ) { |
| 34 | 36 | $this->connection = $this->obj2array($_data); |
@@ -48,8 +50,9 @@ discard block |
||
| 48 | 50 | return $return; |
| 49 | 51 | } |
| 50 | 52 | protected function importObject( $_object ) { |
| 51 | - foreach (get_object_vars($_object) as $key => $value) |
|
| 52 | - $this->$key = $value; |
|
| 53 | + foreach (get_object_vars($_object) as $key => $value) { |
|
| 54 | + $this->$key = $value; |
|
| 55 | + } |
|
| 53 | 56 | } |
| 54 | 57 | } |
| 55 | 58 | ?> |
@@ -12,9 +12,10 @@ |
||
| 12 | 12 | Debug::push(); |
| 13 | 13 | $this->connection["$_name"] = $_connection; |
| 14 | 14 | $this->currentConnection = $_connection; |
| 15 | - foreach ($this->modules as &$module) |
|
| 16 | - if(isset($module->currentConnection)) |
|
| 15 | + foreach ($this->modules as &$module) { |
|
| 16 | + if(isset($module->currentConnection)) |
|
| 17 | 17 | $module->addConnection($_name, $_connection); |
| 18 | + } |
|
| 18 | 19 | Debug::pop(); |
| 19 | 20 | } |
| 20 | 21 | public function setConnection( $_name ) { |