@@ -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 | } |
@@ -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 ) { |
@@ -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 | - array_shift(self::$stack); |
|
| 48 | + if(count(self::$stack)>0) { |
|
| 49 | + array_shift(self::$stack); |
|
| 50 | + } |
|
| 49 | 51 | } |
| 50 | 52 | public static function emptyStack() { |
| 51 | 53 | self::$stack = []; |
@@ -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 | ?> |
@@ -1,36 +1,43 @@ 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 | - foreach ($files as $i) |
|
| 14 | - if(isPhp("$path/$i")) |
|
| 14 | + foreach ($files as $i) { |
|
| 15 | + if(isPhp("$path/$i")) |
|
| 15 | 16 | requireComponent($path."/".$i, false); |
| 16 | - } else |
|
| 17 | - requireError($_path); |
|
| 17 | + } |
|
| 18 | + } else { |
|
| 19 | + requireError($_path); |
|
| 20 | + } |
|
| 18 | 21 | } |
| 19 | 22 | function requireError( $_path ) { |
| 20 | 23 | global $DEBUG; |
| 21 | - if( $DEBUG == 1 ) |
|
| 22 | - echo "Error load ($_path)<br>"; |
|
| 24 | + if( $DEBUG == 1 ) { |
|
| 25 | + echo "Error load ($_path)<br>"; |
|
| 26 | + } |
|
| 23 | 27 | } |
| 24 | 28 | function isPhp ( $_file ) { |
| 25 | - if(!is_file($_file)) return false; |
|
| 29 | + if(!is_file($_file)) { |
|
| 30 | + return false; |
|
| 31 | + } |
|
| 26 | 32 | $info = pathinfo($_file); |
| 27 | 33 | return ($info["extension"] == "php") || ($info["extension"] == "PHP"); |
| 28 | 34 | } |
| 29 | 35 | function requireModules( $_path, $_local = true ) { |
| 30 | 36 | $path = getJFolder($_path, $_local, debug_backtrace()); |
| 31 | 37 | $subFolders = subFolderDir($path); |
| 32 | - foreach ($subFolders as $i) |
|
| 33 | - requireComponents("$path/$i", false); |
|
| 38 | + foreach ($subFolders as $i) { |
|
| 39 | + requireComponents("$path/$i", false); |
|
| 40 | + } |
|
| 34 | 41 | } |
| 35 | 42 | function jRequire( $_path, $_local = true ) { |
| 36 | 43 | $path = getJFolder($_path, $_local, debug_backtrace()); |
@@ -41,21 +48,24 @@ discard block |
||
| 41 | 48 | $stackInfo = $_stack; |
| 42 | 49 | $folder = dirname($stackInfo[0]["file"]); |
| 43 | 50 | $file = "$folder/$_path"; |
| 44 | - } else |
|
| 45 | - $file = $_path; |
|
| 51 | + } else { |
|
| 52 | + $file = $_path; |
|
| 53 | + } |
|
| 46 | 54 | return $file; |
| 47 | 55 | } |
| 48 | 56 | function requireModulesList( $_path ) { |
| 49 | - if(!file_exists($_path)) |
|
| 50 | - return; |
|
| 57 | + if(!file_exists($_path)) { |
|
| 58 | + return; |
|
| 59 | + } |
|
| 51 | 60 | $data = file_get_contents($_path); |
| 52 | 61 | $data = json_decode($data); |
| 53 | - if($data === NULL) |
|
| 54 | - throw new Exception("Error in the file format [$_path]", 1); |
|
| 62 | + if($data === NULL) { |
|
| 63 | + throw new Exception("Error in the file format [$_path]", 1); |
|
| 64 | + } |
|
| 55 | 65 | foreach ($data as $item) { |
| 56 | - if(substr($item, -1) == "*") |
|
| 57 | - requireModules(substr($item, 0, -2), false); |
|
| 58 | - else { |
|
| 66 | + if(substr($item, -1) == "*") { |
|
| 67 | + requireModules(substr($item, 0, -2), false); |
|
| 68 | + } else { |
|
| 59 | 69 | $path = getJFolder($item, false, debug_backtrace()); |
| 60 | 70 | requireComponents("$path", false); |
| 61 | 71 | } |