Test Failed
Push — master ( a33193...53306a )
by Federico
02:00
created
dist/jate/modules/Connection/Adapters/ConnectionPostgresqlAdapter.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,16 +17,18 @@
 block discarded – undo
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
       }
Please login to merge, or discard this patch.
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,51 +1,51 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPostgresqlAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8
-            or die('Could not connect: '.pg_last_error());
9
-        } catch( Exception $error ) {
10
-          Debug::fatal($error->getMessage());
11
-          exit();
12
-        }
13
-      }
14
-      public function query( $_query ) {
15
-        $this->stdQuery($_query);
16
-        return true;
17
-      }
18
-      public function queryInsert( $_query ) {
19
-        $this->stdQuery($_query);
20
-        return $this->stdQuery("SELECT lastval()");
21
-      }
22
-      public function queryFetch( $_query ) {
23
-        $result = $this->stdQuery($_query);
24
-        $rows = [];
25
-        while($row = pg_fetch_assoc($result))
26
-          $rows[] = $row;
27
-        pg_free_result($result);
28
-        return $rows;
29
-      }
30
-      public function queryArray( $_query ) {
31
-        $result = $this->stdQuery($_query);
32
-        $rows = [];
33
-        while($row = pg_fetch_array($result))
34
-          $rows[] = $row;
35
-        pg_free_result($result);
36
-        return $rows;
37
-      }
38
-      protected function stdQuery( $_query ) {
39
-        $database = $this->connection;
40
-        $result = pg_query($database, $_query);
41
-        if(!$result) {
42
-          Debug::fatal([
43
-            "query" => $_query,
44
-            "error" => pg_last_error()
45
-          ]);
46
-          exit();
47
-        }
48
-        return $result;
49
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8
+			or die('Could not connect: '.pg_last_error());
9
+		} catch( Exception $error ) {
10
+		  Debug::fatal($error->getMessage());
11
+		  exit();
12
+		}
13
+	  }
14
+	  public function query( $_query ) {
15
+		$this->stdQuery($_query);
16
+		return true;
17
+	  }
18
+	  public function queryInsert( $_query ) {
19
+		$this->stdQuery($_query);
20
+		return $this->stdQuery("SELECT lastval()");
21
+	  }
22
+	  public function queryFetch( $_query ) {
23
+		$result = $this->stdQuery($_query);
24
+		$rows = [];
25
+		while($row = pg_fetch_assoc($result))
26
+		  $rows[] = $row;
27
+		pg_free_result($result);
28
+		return $rows;
29
+	  }
30
+	  public function queryArray( $_query ) {
31
+		$result = $this->stdQuery($_query);
32
+		$rows = [];
33
+		while($row = pg_fetch_array($result))
34
+		  $rows[] = $row;
35
+		pg_free_result($result);
36
+		return $rows;
37
+	  }
38
+	  protected function stdQuery( $_query ) {
39
+		$database = $this->connection;
40
+		$result = pg_query($database, $_query);
41
+		if(!$result) {
42
+		  Debug::fatal([
43
+			"query" => $_query,
44
+			"error" => pg_last_error()
45
+		  ]);
46
+		  exit();
47
+		}
48
+		return $result;
49
+	  }
50 50
   }
51 51
 ?>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -2,43 +2,43 @@
 block discarded – undo
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPostgresqlAdapter implements ConnectionAdapterInterface {
4 4
       public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
5
+      public function __construct($_srv, $_db, $_usr, $_pass) {
6 6
         try {
7 7
           $this->connection = pg_connect("host=$_srv dbname=$_db user=$_usr password=$_pass")
8 8
             or die('Could not connect: '.pg_last_error());
9
-        } catch( Exception $error ) {
9
+        } catch (Exception $error) {
10 10
           Debug::fatal($error->getMessage());
11 11
           exit();
12 12
         }
13 13
       }
14
-      public function query( $_query ) {
14
+      public function query($_query) {
15 15
         $this->stdQuery($_query);
16 16
         return true;
17 17
       }
18
-      public function queryInsert( $_query ) {
18
+      public function queryInsert($_query) {
19 19
         $this->stdQuery($_query);
20 20
         return $this->stdQuery("SELECT lastval()");
21 21
       }
22
-      public function queryFetch( $_query ) {
22
+      public function queryFetch($_query) {
23 23
         $result = $this->stdQuery($_query);
24 24
         $rows = [];
25
-        while($row = pg_fetch_assoc($result))
25
+        while ($row = pg_fetch_assoc($result))
26 26
           $rows[] = $row;
27 27
         pg_free_result($result);
28 28
         return $rows;
29 29
       }
30
-      public function queryArray( $_query ) {
30
+      public function queryArray($_query) {
31 31
         $result = $this->stdQuery($_query);
32 32
         $rows = [];
33
-        while($row = pg_fetch_array($result))
33
+        while ($row = pg_fetch_array($result))
34 34
           $rows[] = $row;
35 35
         pg_free_result($result);
36 36
         return $rows;
37 37
       }
38
-      protected function stdQuery( $_query ) {
38
+      protected function stdQuery($_query) {
39 39
         $database = $this->connection;
40 40
         $result = pg_query($database, $_query);
41
-        if(!$result) {
41
+        if (!$result) {
42 42
           Debug::fatal([
43 43
             "query" => $_query,
44 44
             "error" => pg_last_error()
Please login to merge, or discard this patch.
dist/jate/modules/Query/Query.php 3 patches
Indentation   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -1,48 +1,48 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("../Module/Module.php");
3 3
   class Query extends Module {
4
-    public $connection;
5
-    public $currentConnection;
6
-    public function __construct() {
7
-      parent::__construct();
8
-      $this->connection = [];
9
-      $this->currentConnection = null;
10
-    }
11
-    public function addConnection( $_name, $_connection ) {
12
-      Debug::push();
13
-      $this->connection["$_name"] = $_connection;
14
-      $this->currentConnection = $_connection;
15
-      foreach ($this->modules as &$module)
16
-        if(isset($module->currentConnection))
17
-          $module->addConnection($_name, $_connection);
18
-      Debug::pop();
19
-    }
20
-    public function setConnection( $_name ) {
21
-      $this->currentConnection = $this->connection["$_name"];
22
-    }
23
-    public function query( $_query ) {
24
-      Debug::push();
25
-      $temp = $this->currentConnection->database->query($_query);
26
-      Debug::pop();
27
-      return $temp;
28
-    }
29
-    public function queryInsert( $_query ) {
30
-      Debug::push();
31
-      $temp = $this->currentConnection->database->queryInsert($_query);
32
-      Debug::pop();
33
-      return $temp;
34
-    }
35
-    public function queryFetch( $_query ) {
36
-      Debug::push();
37
-      $temp = $this->currentConnection->database->queryFetch($_query);
38
-      Debug::pop();
39
-      return $temp;
40
-    }
41
-    public function queryArray( $_query ) {
42
-      Debug::push();
43
-      $temp = $this->currentConnection->database->queryArray($_query);
44
-      Debug::pop();
45
-      return $temp;
46
-    }
4
+	public $connection;
5
+	public $currentConnection;
6
+	public function __construct() {
7
+	  parent::__construct();
8
+	  $this->connection = [];
9
+	  $this->currentConnection = null;
10
+	}
11
+	public function addConnection( $_name, $_connection ) {
12
+	  Debug::push();
13
+	  $this->connection["$_name"] = $_connection;
14
+	  $this->currentConnection = $_connection;
15
+	  foreach ($this->modules as &$module)
16
+		if(isset($module->currentConnection))
17
+		  $module->addConnection($_name, $_connection);
18
+	  Debug::pop();
19
+	}
20
+	public function setConnection( $_name ) {
21
+	  $this->currentConnection = $this->connection["$_name"];
22
+	}
23
+	public function query( $_query ) {
24
+	  Debug::push();
25
+	  $temp = $this->currentConnection->database->query($_query);
26
+	  Debug::pop();
27
+	  return $temp;
28
+	}
29
+	public function queryInsert( $_query ) {
30
+	  Debug::push();
31
+	  $temp = $this->currentConnection->database->queryInsert($_query);
32
+	  Debug::pop();
33
+	  return $temp;
34
+	}
35
+	public function queryFetch( $_query ) {
36
+	  Debug::push();
37
+	  $temp = $this->currentConnection->database->queryFetch($_query);
38
+	  Debug::pop();
39
+	  return $temp;
40
+	}
41
+	public function queryArray( $_query ) {
42
+	  Debug::push();
43
+	  $temp = $this->currentConnection->database->queryArray($_query);
44
+	  Debug::pop();
45
+	  return $temp;
46
+	}
47 47
   }
48 48
 ?>
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -8,37 +8,37 @@
 block discarded – undo
8 8
       $this->connection = [];
9 9
       $this->currentConnection = null;
10 10
     }
11
-    public function addConnection( $_name, $_connection ) {
11
+    public function addConnection($_name, $_connection) {
12 12
       Debug::push();
13 13
       $this->connection["$_name"] = $_connection;
14 14
       $this->currentConnection = $_connection;
15 15
       foreach ($this->modules as &$module)
16
-        if(isset($module->currentConnection))
16
+        if (isset($module->currentConnection))
17 17
           $module->addConnection($_name, $_connection);
18 18
       Debug::pop();
19 19
     }
20
-    public function setConnection( $_name ) {
20
+    public function setConnection($_name) {
21 21
       $this->currentConnection = $this->connection["$_name"];
22 22
     }
23
-    public function query( $_query ) {
23
+    public function query($_query) {
24 24
       Debug::push();
25 25
       $temp = $this->currentConnection->database->query($_query);
26 26
       Debug::pop();
27 27
       return $temp;
28 28
     }
29
-    public function queryInsert( $_query ) {
29
+    public function queryInsert($_query) {
30 30
       Debug::push();
31 31
       $temp = $this->currentConnection->database->queryInsert($_query);
32 32
       Debug::pop();
33 33
       return $temp;
34 34
     }
35
-    public function queryFetch( $_query ) {
35
+    public function queryFetch($_query) {
36 36
       Debug::push();
37 37
       $temp = $this->currentConnection->database->queryFetch($_query);
38 38
       Debug::pop();
39 39
       return $temp;
40 40
     }
41
-    public function queryArray( $_query ) {
41
+    public function queryArray($_query) {
42 42
       Debug::push();
43 43
       $temp = $this->currentConnection->database->queryArray($_query);
44 44
       Debug::pop();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,10 @@
 block discarded – undo
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 ) {
Please login to merge, or discard this patch.
dist/jate/modules/Debug/Debug.php 3 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -5,8 +5,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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 = [];
Please login to merge, or discard this patch.
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -1,60 +1,60 @@
 block discarded – undo
1 1
 <?php
2 2
   class Debug {
3
-    public static $stack;
4
-    private static $initialized = false;
5
-    private function __construct() {}
6
-    private static function initialize() {
7
-      if (self::$initialized)
8
-        return;
9
-      self::$stack = [];
10
-      self::$initialized = true;
11
-    }
12
-    private static function out( $_object ) {
13
-      if(is_object($_object)) {
14
-        echo "isObject";
15
-      } else if(is_array($_object)) {
16
-        arrayDump($_object, "Debug");
17
-      } else {
18
-        echo $_object;
19
-      }
20
-    }
21
-    public static function error( $_object ) {
22
-      self::out(["Error" => $_object]);
23
-    }
24
-    public static function warning( $_object ) {
25
-      self::out(["Warning" => $_object]);
26
-    }
27
-    public static function fatal( $_object ) {
28
-      self::out(["Fatal error" => $_object]);
29
-      exit(1);
30
-    }
31
-    public static function logln( $_object ) {
32
-      self::log($_object);
33
-      self::out("<br>");
34
-    }
35
-    public static function logStack( $_object ) {
36
-      self::out([
37
-        "position" => self::$stack,
38
-        "error" => $_object
39
-      ]);
40
-      self::out("<br>");
41
-    }
42
-    public static function push() {
43
-      $debugInfo = debug_backtrace();
44
-      $debugInfo = [
45
-        "file" => $debugInfo[1]["file"],
46
-        "line" => $debugInfo[1]["line"],
47
-        "function" => $debugInfo[1]["function"],
48
-        "class" => $debugInfo[1]["class"]
49
-      ];
50
-      self::$stack[] = $debugInfo;
51
-    }
52
-    public static function pop() {
53
-      if(count(self::$stack)>0)
54
-        array_shift(self::$stack);
55
-    }
56
-    public static function emptyStack() {
57
-      self::$stack = [];
58
-    }
3
+	public static $stack;
4
+	private static $initialized = false;
5
+	private function __construct() {}
6
+	private static function initialize() {
7
+	  if (self::$initialized)
8
+		return;
9
+	  self::$stack = [];
10
+	  self::$initialized = true;
11
+	}
12
+	private static function out( $_object ) {
13
+	  if(is_object($_object)) {
14
+		echo "isObject";
15
+	  } else if(is_array($_object)) {
16
+		arrayDump($_object, "Debug");
17
+	  } else {
18
+		echo $_object;
19
+	  }
20
+	}
21
+	public static function error( $_object ) {
22
+	  self::out(["Error" => $_object]);
23
+	}
24
+	public static function warning( $_object ) {
25
+	  self::out(["Warning" => $_object]);
26
+	}
27
+	public static function fatal( $_object ) {
28
+	  self::out(["Fatal error" => $_object]);
29
+	  exit(1);
30
+	}
31
+	public static function logln( $_object ) {
32
+	  self::log($_object);
33
+	  self::out("<br>");
34
+	}
35
+	public static function logStack( $_object ) {
36
+	  self::out([
37
+		"position" => self::$stack,
38
+		"error" => $_object
39
+	  ]);
40
+	  self::out("<br>");
41
+	}
42
+	public static function push() {
43
+	  $debugInfo = debug_backtrace();
44
+	  $debugInfo = [
45
+		"file" => $debugInfo[1]["file"],
46
+		"line" => $debugInfo[1]["line"],
47
+		"function" => $debugInfo[1]["function"],
48
+		"class" => $debugInfo[1]["class"]
49
+	  ];
50
+	  self::$stack[] = $debugInfo;
51
+	}
52
+	public static function pop() {
53
+	  if(count(self::$stack)>0)
54
+		array_shift(self::$stack);
55
+	}
56
+	public static function emptyStack() {
57
+	  self::$stack = [];
58
+	}
59 59
   }
60 60
 ?>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -9,30 +9,30 @@  discard block
 block discarded – undo
9 9
       self::$stack = [];
10 10
       self::$initialized = true;
11 11
     }
12
-    private static function out( $_object ) {
13
-      if(is_object($_object)) {
12
+    private static function out($_object) {
13
+      if (is_object($_object)) {
14 14
         echo "isObject";
15
-      } else if(is_array($_object)) {
15
+      } else if (is_array($_object)) {
16 16
         arrayDump($_object, "Debug");
17 17
       } else {
18 18
         echo $_object;
19 19
       }
20 20
     }
21
-    public static function error( $_object ) {
21
+    public static function error($_object) {
22 22
       self::out(["Error" => $_object]);
23 23
     }
24
-    public static function warning( $_object ) {
24
+    public static function warning($_object) {
25 25
       self::out(["Warning" => $_object]);
26 26
     }
27
-    public static function fatal( $_object ) {
27
+    public static function fatal($_object) {
28 28
       self::out(["Fatal error" => $_object]);
29 29
       exit(1);
30 30
     }
31
-    public static function logln( $_object ) {
31
+    public static function logln($_object) {
32 32
       self::log($_object);
33 33
       self::out("<br>");
34 34
     }
35
-    public static function logStack( $_object ) {
35
+    public static function logStack($_object) {
36 36
       self::out([
37 37
         "position" => self::$stack,
38 38
         "error" => $_object
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
       self::$stack[] = $debugInfo;
51 51
     }
52 52
     public static function pop() {
53
-      if(count(self::$stack)>0)
53
+      if (count(self::$stack) > 0)
54 54
         array_shift(self::$stack);
55 55
     }
56 56
     public static function emptyStack() {
Please login to merge, or discard this patch.
dist/jate/functions/block.php 4 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -17,6 +17,9 @@
 block discarded – undo
17 17
     return jBlockFileMan($_path, $extension, $_parameters);
18 18
   }
19 19
 
20
+  /**
21
+   * @param string $_type
22
+   */
20 23
   function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
21 24
     if(!file_exists($_path))
22 25
       Debug::fatal("File [$_path] not found.");
Please login to merge, or discard this patch.
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -3,59 +3,59 @@
 block discarded – undo
3 3
   jRequire("../modules/Parsedown/Parsedown.php");
4 4
   jRequire("../modules/Debug/Debug.php");
5 5
   function jBlock() {
6
-    return ob_start();
6
+	return ob_start();
7 7
   }
8 8
 
9 9
   function jBlockClose( $_type = "html", $_parameters = [] ) {
10
-    return jBlockEnd($_type, $_parameters);
10
+	return jBlockEnd($_type, $_parameters);
11 11
   }
12 12
 
13 13
   function jBlockFile( $_path, $_parameters = [] ) {
14
-    $extension = explode(".", $_path);
15
-    $extension = $extension[count($extension)-1];
16
-    $extension = strtolower($extension);
17
-    return jBlockFileMan($_path, $extension, $_parameters);
14
+	$extension = explode(".", $_path);
15
+	$extension = $extension[count($extension)-1];
16
+	$extension = strtolower($extension);
17
+	return jBlockFileMan($_path, $extension, $_parameters);
18 18
   }
19 19
 
20 20
   function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
21
-    if(!file_exists($_path))
22
-      Debug::fatal("File [$_path] not found.");
23
-    $temp = file_get_contents($_path);
24
-    return jBlockParsing($_type, $temp, $_parameters);
21
+	if(!file_exists($_path))
22
+	  Debug::fatal("File [$_path] not found.");
23
+	$temp = file_get_contents($_path);
24
+	return jBlockParsing($_type, $temp, $_parameters);
25 25
   }
26 26
 
27 27
   function jBlockEnd( $_type = "html", $_parameters = [] ) {
28
-    $text = ob_get_clean();
29
-    return jBlockParsing($_type, $text, $_parameters);
28
+	$text = ob_get_clean();
29
+	return jBlockParsing($_type, $text, $_parameters);
30 30
   }
31 31
 
32 32
   function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) {
33
-    switch ($_type) {
34
-      case "pug":
35
-      case "jade":
36
-        $Pug = new Pug();
37
-        $_string = $Pug->drawText($_string, $_parameters);
38
-      break;
39
-      case "md":
40
-      case "markdown":
41
-      case "parsedown":
42
-        $Parsedown = new Parsedown();
43
-        $_string = $Parsedown->drawText($_string);
44
-      break;
45
-      case "twig":
46
-        $Twig = new Twig();
47
-        $_string = $Twig->drawText($_string, $_parameters);
48
-      break;
49
-      default: break;
50
-    }
51
-    return $_string;
33
+	switch ($_type) {
34
+	  case "pug":
35
+	  case "jade":
36
+		$Pug = new Pug();
37
+		$_string = $Pug->drawText($_string, $_parameters);
38
+	  break;
39
+	  case "md":
40
+	  case "markdown":
41
+	  case "parsedown":
42
+		$Parsedown = new Parsedown();
43
+		$_string = $Parsedown->drawText($_string);
44
+	  break;
45
+	  case "twig":
46
+		$Twig = new Twig();
47
+		$_string = $Twig->drawText($_string, $_parameters);
48
+	  break;
49
+	  default: break;
50
+	}
51
+	return $_string;
52 52
   }
53 53
 
54 54
   function minifyOutput($_buffer) {
55
-    $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
56
-    $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));
59
-    return utf8_encode($_buffer);
55
+	$search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
56
+	$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));
59
+	return utf8_encode($_buffer);
60 60
   }
61 61
 ?>
Please login to merge, or discard this patch.
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -6,30 +6,30 @@  discard block
 block discarded – undo
6 6
     return ob_start();
7 7
   }
8 8
 
9
-  function jBlockClose( $_type = "html", $_parameters = [] ) {
9
+  function jBlockClose($_type = "html", $_parameters = []) {
10 10
     return jBlockEnd($_type, $_parameters);
11 11
   }
12 12
 
13
-  function jBlockFile( $_path, $_parameters = [] ) {
13
+  function jBlockFile($_path, $_parameters = []) {
14 14
     $extension = explode(".", $_path);
15
-    $extension = $extension[count($extension)-1];
15
+    $extension = $extension[count($extension) - 1];
16 16
     $extension = strtolower($extension);
17 17
     return jBlockFileMan($_path, $extension, $_parameters);
18 18
   }
19 19
 
20
-  function jBlockFileMan( $_path, $_type, $_parameters = [] ) {
21
-    if(!file_exists($_path))
20
+  function jBlockFileMan($_path, $_type, $_parameters = []) {
21
+    if (!file_exists($_path))
22 22
       Debug::fatal("File [$_path] not found.");
23 23
     $temp = file_get_contents($_path);
24 24
     return jBlockParsing($_type, $temp, $_parameters);
25 25
   }
26 26
 
27
-  function jBlockEnd( $_type = "html", $_parameters = [] ) {
27
+  function jBlockEnd($_type = "html", $_parameters = []) {
28 28
     $text = ob_get_clean();
29 29
     return jBlockParsing($_type, $text, $_parameters);
30 30
   }
31 31
 
32
-  function jBlockParsing( $_type = "html", $_string = "", $_parameters = [] ) {
32
+  function jBlockParsing($_type = "html", $_string = "", $_parameters = []) {
33 33
     switch ($_type) {
34 34
       case "pug":
35 35
       case "jade":
@@ -52,9 +52,9 @@  discard block
 block discarded – undo
52 52
   }
53 53
 
54 54
   function minifyOutput($_buffer) {
55
-    $search = array ( '/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s' );
56
-    $replace = array ( '>', '<', '\\1' );
57
-    if (preg_match("/\<html/i",$_buffer) == 1 && preg_match("/\<\/html\>/i",$_buffer) == 1)
55
+    $search = array('/\>[^\S ]+/s', '/[^\S ]+\</s', '/(\s)+/s');
56
+    $replace = array('>', '<', '\\1');
57
+    if (preg_match("/\<html/i", $_buffer) == 1 && preg_match("/\<\/html\>/i", $_buffer) == 1)
58 58
       $_buffer = preg_replace($search, $replace, utf8_decode($_buffer));
59 59
     return utf8_encode($_buffer);
60 60
   }
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,8 +18,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/JConfig/JConfig.php 3 patches
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@
 block discarded – undo
1 1
 <?php
2 2
   class JConfig {
3
-    public $connection;
4
-    public $all;
5
-    public $DEBUG;
6
-    public $pages;
7
-    public $server;
8
-    public function __construct() {
9
-      $this->connection["enable"]    = false;
10
-      $this->connection["user"]      = "";
11
-      $this->connection["password"] = "";
12
-      $this->connection["database"] = "";
13
-      $this->connection["server"]    = "";
14
-      $this->all    = "";
15
-      $this->DEBUG  = 0;
16
-      $this->pages  = [];
17
-      $this->server  = [];
18
-      $this->server["HTTP_HOST"]    = $_SERVER["HTTP_HOST"];
19
-      $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20
-      $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21
-      $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22
-    }
23
-    public function import( $_path, $_type = "misc" ) {
24
-      if(!file_exists($_path))
25
-        Debug::fatal("File [$_path] not found.");
26
-      $data = file_get_contents($_path);
27
-      $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);
34
-    }
35
-    protected function overlayConnection( $_data ) {
36
-      $this->connection = $this->obj2array($_data);
37
-    }
38
-    protected function overlayMisc( $_data ) {
39
-      $this->importObject($_data);
40
-    }
41
-    protected function obj2array ( &$_instance ) {
42
-      $clone  = (array) $_instance;
43
-      $return  = [];
44
-      $return['___SOURCE_KEYS_'] = $clone;
45
-      while ( list ($key, $value) = each ($clone) ) {
46
-        $temp    = explode ("\0", $key);
47
-        $newkey  = $temp[count($temp)-1];
48
-        $return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
49
-      }
50
-      return $return;
51
-    }
52
-    protected function importObject( $_object ) {
53
-      foreach (get_object_vars($_object) as $key => $value)
54
-        $this->$key = $value;
55
-    }
3
+	public $connection;
4
+	public $all;
5
+	public $DEBUG;
6
+	public $pages;
7
+	public $server;
8
+	public function __construct() {
9
+	  $this->connection["enable"]    = false;
10
+	  $this->connection["user"]      = "";
11
+	  $this->connection["password"] = "";
12
+	  $this->connection["database"] = "";
13
+	  $this->connection["server"]    = "";
14
+	  $this->all    = "";
15
+	  $this->DEBUG  = 0;
16
+	  $this->pages  = [];
17
+	  $this->server  = [];
18
+	  $this->server["HTTP_HOST"]    = $_SERVER["HTTP_HOST"];
19
+	  $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20
+	  $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21
+	  $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22
+	}
23
+	public function import( $_path, $_type = "misc" ) {
24
+	  if(!file_exists($_path))
25
+		Debug::fatal("File [$_path] not found.");
26
+	  $data = file_get_contents($_path);
27
+	  $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);
34
+	}
35
+	protected function overlayConnection( $_data ) {
36
+	  $this->connection = $this->obj2array($_data);
37
+	}
38
+	protected function overlayMisc( $_data ) {
39
+	  $this->importObject($_data);
40
+	}
41
+	protected function obj2array ( &$_instance ) {
42
+	  $clone  = (array) $_instance;
43
+	  $return  = [];
44
+	  $return['___SOURCE_KEYS_'] = $clone;
45
+	  while ( list ($key, $value) = each ($clone) ) {
46
+		$temp    = explode ("\0", $key);
47
+		$newkey  = $temp[count($temp)-1];
48
+		$return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
49
+	  }
50
+	  return $return;
51
+	}
52
+	protected function importObject( $_object ) {
53
+	  foreach (get_object_vars($_object) as $key => $value)
54
+		$this->$key = $value;
55
+	}
56 56
   }
57 57
 ?>
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -14,42 +14,42 @@
 block discarded – undo
14 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 19
       $this->server["REQUEST_URI"]  = $_SERVER["REQUEST_URI"];
20 20
       $this->server["PHP_SELF"]      = $_SERVER["PHP_SELF"];
21 21
       $this->server["RELATIVE"]      = str_replace("/index.php", "", $_SERVER["PHP_SELF"]);
22 22
     }
23
-    public function import( $_path, $_type = "misc" ) {
24
-      if(!file_exists($_path))
23
+    public function import($_path, $_type = "misc") {
24
+      if (!file_exists($_path))
25 25
         Debug::fatal("File [$_path] not found.");
26 26
       $data = file_get_contents($_path);
27 27
       $data = json_decode($data);
28
-      if($data === NULL)
28
+      if ($data === NULL)
29 29
         Debug::fatal("Error processing [$_path]");
30
-      if( $_type == "connection" )
30
+      if ($_type == "connection")
31 31
         $this->overlayConnection($data);
32 32
       else
33 33
         $this->overlayMisc($data);
34 34
     }
35
-    protected function overlayConnection( $_data ) {
35
+    protected function overlayConnection($_data) {
36 36
       $this->connection = $this->obj2array($_data);
37 37
     }
38
-    protected function overlayMisc( $_data ) {
38
+    protected function overlayMisc($_data) {
39 39
       $this->importObject($_data);
40 40
     }
41
-    protected function obj2array ( &$_instance ) {
42
-      $clone  = (array) $_instance;
43
-      $return  = [];
41
+    protected function obj2array(&$_instance) {
42
+      $clone = (array) $_instance;
43
+      $return = [];
44 44
       $return['___SOURCE_KEYS_'] = $clone;
45
-      while ( list ($key, $value) = each ($clone) ) {
46
-        $temp    = explode ("\0", $key);
47
-        $newkey  = $temp[count($temp)-1];
45
+      while (list ($key, $value) = each($clone)) {
46
+        $temp    = explode("\0", $key);
47
+        $newkey  = $temp[count($temp) - 1];
48 48
         $return[$newkey] = &$return['___SOURCE_KEYS_'][$key];
49 49
       }
50 50
       return $return;
51 51
     }
52
-    protected function importObject( $_object ) {
52
+    protected function importObject($_object) {
53 53
       foreach (get_object_vars($_object) as $key => $value)
54 54
         $this->$key = $value;
55 55
     }
Please login to merge, or discard this patch.
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,16 +21,19 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 ?>
Please login to merge, or discard this patch.
dist/jate/functions/requirer.php 4 patches
Doc Comments   +11 added lines patch added patch discarded remove patch
@@ -1,4 +1,7 @@  discard block
 block discarded – undo
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))
@@ -26,6 +29,10 @@  discard block
 block discarded – undo
26 29
     $info = pathinfo($_file);
27 30
     return ($info["extension"] == "php") || ($info["extension"] == "PHP");
28 31
   }
32
+
33
+  /**
34
+   * @param string $_path
35
+   */
29 36
   function requireModules( $_path, $_local = true ) {
30 37
     $path = getJFolder($_path, $_local, debug_backtrace());
31 38
     $subFolders = subFolderDir($path);
@@ -36,6 +43,10 @@  discard block
 block discarded – undo
36 43
     $path = getJFolder($_path, $_local, debug_backtrace());
37 44
     require_once( $path );
38 45
   }
46
+
47
+  /**
48
+   * @param boolean $_local
49
+   */
39 50
   function getJFolder( $_path, $_local, $_stack ) {
40 51
     if($_local) {
41 52
       $stackInfo = $_stack;
Please login to merge, or discard this patch.
Indentation   +46 added lines, -46 removed lines patch added patch discarded remove patch
@@ -1,64 +1,64 @@
 block discarded – undo
1 1
 <?php
2 2
   function requireComponent( $_path, $_local = true ) {
3
-    $path = getJFolder($_path, $_local, debug_backtrace());
4
-    if(file_exists($path) && isPhp($path))
5
-      jRequire($path, false, 0);
6
-    else
7
-      requireError($_path);
3
+	$path = getJFolder($_path, $_local, debug_backtrace());
4
+	if(file_exists($path) && isPhp($path))
5
+	  jRequire($path, false, 0);
6
+	else
7
+	  requireError($_path);
8 8
   }
9 9
   function requireComponents( $_path, $_local = true ) {
10
-    $path = getJFolder($_path, $_local, debug_backtrace());
11
-    if(file_exists($path)) {
12
-      $files = subFolderFile($path);
13
-      foreach ($files as $i)
14
-        if(isPhp("$path/$i"))
15
-          requireComponent($path."/".$i, false);
16
-    } else
17
-      requireError($_path);
10
+	$path = getJFolder($_path, $_local, debug_backtrace());
11
+	if(file_exists($path)) {
12
+	  $files = subFolderFile($path);
13
+	  foreach ($files as $i)
14
+		if(isPhp("$path/$i"))
15
+		  requireComponent($path."/".$i, false);
16
+	} else
17
+	  requireError($_path);
18 18
   }
19 19
   function requireError( $_path ) {
20
-    global $DEBUG;
21
-    if( $DEBUG == 1 )
22
-      echo "Error load ($_path)<br>";
20
+	global $DEBUG;
21
+	if( $DEBUG == 1 )
22
+	  echo "Error load ($_path)<br>";
23 23
   }
24 24
   function isPhp ( $_file ) {
25
-    if(!is_file($_file)) return false;
26
-    $info = pathinfo($_file);
27
-    return ($info["extension"] == "php") || ($info["extension"] == "PHP");
25
+	if(!is_file($_file)) return false;
26
+	$info = pathinfo($_file);
27
+	return ($info["extension"] == "php") || ($info["extension"] == "PHP");
28 28
   }
29 29
   function requireModules( $_path, $_local = true ) {
30
-    $path = getJFolder($_path, $_local, debug_backtrace());
31
-    $subFolders = subFolderDir($path);
32
-    foreach ($subFolders as $i)
33
-      requireComponents("$path/$i", false);
30
+	$path = getJFolder($_path, $_local, debug_backtrace());
31
+	$subFolders = subFolderDir($path);
32
+	foreach ($subFolders as $i)
33
+	  requireComponents("$path/$i", false);
34 34
   }
35 35
   function jRequire( $_path, $_local = true ) {
36
-    $path = getJFolder($_path, $_local, debug_backtrace());
37
-    require_once( $path );
36
+	$path = getJFolder($_path, $_local, debug_backtrace());
37
+	require_once( $path );
38 38
   }
39 39
   function getJFolder( $_path, $_local, $_stack ) {
40
-    if($_local) {
41
-      $stackInfo = $_stack;
42
-      $folder = dirname($stackInfo[0]["file"]);
43
-      $file = "$folder/$_path";
44
-    } else
45
-      $file = $_path;
46
-    return $file;
40
+	if($_local) {
41
+	  $stackInfo = $_stack;
42
+	  $folder = dirname($stackInfo[0]["file"]);
43
+	  $file = "$folder/$_path";
44
+	} else
45
+	  $file = $_path;
46
+	return $file;
47 47
   }
48 48
   function requireModulesList( $_path ) {
49
-    if(!file_exists($_path))
50
-      return;
51
-    $data = file_get_contents($_path);
52
-    $data = json_decode($data);
53
-    if($data === NULL)
54
-      throw new Exception("Error in the file format [$_path]", 1);
55
-    foreach ($data as $item) {
56
-      if(substr($item, -1) == "*")
57
-        requireModules(substr($item, 0, -2), false);
58
-      else {
59
-        $path = getJFolder($item, false, debug_backtrace());
60
-        requireComponents("$path", false);
61
-      }
62
-    }
49
+	if(!file_exists($_path))
50
+	  return;
51
+	$data = file_get_contents($_path);
52
+	$data = json_decode($data);
53
+	if($data === NULL)
54
+	  throw new Exception("Error in the file format [$_path]", 1);
55
+	foreach ($data as $item) {
56
+	  if(substr($item, -1) == "*")
57
+		requireModules(substr($item, 0, -2), false);
58
+	  else {
59
+		$path = getJFolder($item, false, debug_backtrace());
60
+		requireComponents("$path", false);
61
+	  }
62
+	}
63 63
   }
64 64
 ?>
Please login to merge, or discard this patch.
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,43 +1,43 @@  discard block
 block discarded – undo
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);
16 16
     } else
17 17
       requireError($_path);
18 18
   }
19
-  function requireError( $_path ) {
19
+  function requireError($_path) {
20 20
     global $DEBUG;
21
-    if( $DEBUG == 1 )
21
+    if ($DEBUG == 1)
22 22
       echo "Error load ($_path)<br>";
23 23
   }
24
-  function isPhp ( $_file ) {
25
-    if(!is_file($_file)) return false;
24
+  function isPhp($_file) {
25
+    if (!is_file($_file)) return false;
26 26
     $info = pathinfo($_file);
27 27
     return ($info["extension"] == "php") || ($info["extension"] == "PHP");
28 28
   }
29
-  function requireModules( $_path, $_local = true ) {
29
+  function requireModules($_path, $_local = true) {
30 30
     $path = getJFolder($_path, $_local, debug_backtrace());
31 31
     $subFolders = subFolderDir($path);
32 32
     foreach ($subFolders as $i)
33 33
       requireComponents("$path/$i", false);
34 34
   }
35
-  function jRequire( $_path, $_local = true ) {
35
+  function jRequire($_path, $_local = true) {
36 36
     $path = getJFolder($_path, $_local, debug_backtrace());
37
-    require_once( $path );
37
+    require_once($path);
38 38
   }
39
-  function getJFolder( $_path, $_local, $_stack ) {
40
-    if($_local) {
39
+  function getJFolder($_path, $_local, $_stack) {
40
+    if ($_local) {
41 41
       $stackInfo = $_stack;
42 42
       $folder = dirname($stackInfo[0]["file"]);
43 43
       $file = "$folder/$_path";
@@ -45,15 +45,15 @@  discard block
 block discarded – undo
45 45
       $file = $_path;
46 46
     return $file;
47 47
   }
48
-  function requireModulesList( $_path ) {
49
-    if(!file_exists($_path))
48
+  function requireModulesList($_path) {
49
+    if (!file_exists($_path))
50 50
       return;
51 51
     $data = file_get_contents($_path);
52 52
     $data = json_decode($data);
53
-    if($data === NULL)
53
+    if ($data === NULL)
54 54
       throw new Exception("Error in the file format [$_path]", 1);
55 55
     foreach ($data as $item) {
56
-      if(substr($item, -1) == "*")
56
+      if (substr($item, -1) == "*")
57 57
         requireModules(substr($item, 0, -2), false);
58 58
       else {
59 59
         $path = getJFolder($item, false, debug_backtrace());
Please login to merge, or discard this patch.
Braces   +32 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,36 +1,43 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
       }
Please login to merge, or discard this patch.
dist/jate/coreEngine.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -4,13 +4,13 @@
 block discarded – undo
4 4
 
5 5
   //JATE SUFF
6 6
   require_once     (end($GLOBALS["JATEPath"])."jate/functions/requirer.php");
7
-  requireComponent ("functions/folder.php");
8
-  requireComponent ("modules/JConfig/JConfig.php");
7
+  requireComponent("functions/folder.php");
8
+  requireComponent("modules/JConfig/JConfig.php");
9 9
   requireComponents("functions");
10
-  requireModules   ("modules");
10
+  requireModules("modules");
11 11
 
12 12
   //USER STUFF
13 13
   requireModulesList("config/modules.json");
14
-  requireComponents ("bundles/models", false);
15
-  requireComponents ("bundles/controllers", false);
14
+  requireComponents("bundles/models", false);
15
+  requireComponents("bundles/controllers", false);
16 16
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPdoAdapter.php 2 patches
Indentation   +42 added lines, -42 removed lines patch added patch discarded remove patch
@@ -1,47 +1,47 @@
 block discarded – undo
1 1
 <?php
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPdoAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $connection = "mysql:host=$_srv;dbname=$_db";
8
-          $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
-        } catch( Exception $error ) {
10
-          Debug::fatal($error->getMessage());
11
-          exit();
12
-        }
13
-      }
14
-      public function query( $_query ) {
15
-        $this->stdQuery($_query);
16
-        return true;
17
-      }
18
-      public function queryInsert( $_query ) {
19
-        $this->stdQuery($_query);
20
-        return $this->connection->lastInsertId();
21
-      }
22
-      public function queryFetch( $_query ) {
23
-        $temp = $this->stdQuery($_query);
24
-        return $temp->fetchAll(PDO::FETCH_ASSOC);
25
-      }
26
-      public function queryArray( $_query ) {
27
-        $temp = $this->stdQuery($_query);
28
-        return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29
-      }
30
-      protected function stdQuery( $_query ) {
31
-        $database = $this->connection;
32
-        $query = $database->prepare($_query);
33
-        $result = $query->execute();
34
-        if(!$result) {
35
-          Debug::fatal([
36
-            "query" => $_query,
37
-            "error" => [
38
-              $query->errorInfo(),
39
-              $database->errorInfo()
40
-            ]
41
-          ]);
42
-          exit();
43
-        }
44
-        return $query;
45
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $connection = "mysql:host=$_srv;dbname=$_db";
8
+		  $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
+		} catch( Exception $error ) {
10
+		  Debug::fatal($error->getMessage());
11
+		  exit();
12
+		}
13
+	  }
14
+	  public function query( $_query ) {
15
+		$this->stdQuery($_query);
16
+		return true;
17
+	  }
18
+	  public function queryInsert( $_query ) {
19
+		$this->stdQuery($_query);
20
+		return $this->connection->lastInsertId();
21
+	  }
22
+	  public function queryFetch( $_query ) {
23
+		$temp = $this->stdQuery($_query);
24
+		return $temp->fetchAll(PDO::FETCH_ASSOC);
25
+	  }
26
+	  public function queryArray( $_query ) {
27
+		$temp = $this->stdQuery($_query);
28
+		return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29
+	  }
30
+	  protected function stdQuery( $_query ) {
31
+		$database = $this->connection;
32
+		$query = $database->prepare($_query);
33
+		$result = $query->execute();
34
+		if(!$result) {
35
+		  Debug::fatal([
36
+			"query" => $_query,
37
+			"error" => [
38
+			  $query->errorInfo(),
39
+			  $database->errorInfo()
40
+			]
41
+		  ]);
42
+		  exit();
43
+		}
44
+		return $query;
45
+	  }
46 46
   }
47 47
 ?>
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -2,36 +2,36 @@
 block discarded – undo
2 2
   jRequire("ConnectionInterface.php");
3 3
   class ConnectionPdoAdapter implements ConnectionAdapterInterface {
4 4
       public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
5
+      public function __construct($_srv, $_db, $_usr, $_pass) {
6 6
         try {
7 7
           $connection = "mysql:host=$_srv;dbname=$_db";
8
-          $this->connection = new PDO( $connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"] );
9
-        } catch( Exception $error ) {
8
+          $this->connection = new PDO($connection, $_usr, $_pass, [PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"]);
9
+        } catch (Exception $error) {
10 10
           Debug::fatal($error->getMessage());
11 11
           exit();
12 12
         }
13 13
       }
14
-      public function query( $_query ) {
14
+      public function query($_query) {
15 15
         $this->stdQuery($_query);
16 16
         return true;
17 17
       }
18
-      public function queryInsert( $_query ) {
18
+      public function queryInsert($_query) {
19 19
         $this->stdQuery($_query);
20 20
         return $this->connection->lastInsertId();
21 21
       }
22
-      public function queryFetch( $_query ) {
22
+      public function queryFetch($_query) {
23 23
         $temp = $this->stdQuery($_query);
24 24
         return $temp->fetchAll(PDO::FETCH_ASSOC);
25 25
       }
26
-      public function queryArray( $_query ) {
26
+      public function queryArray($_query) {
27 27
         $temp = $this->stdQuery($_query);
28 28
         return $temp->fetchAll(PDO::FETCH_COLUMN, 0);
29 29
       }
30
-      protected function stdQuery( $_query ) {
30
+      protected function stdQuery($_query) {
31 31
         $database = $this->connection;
32 32
         $query = $database->prepare($_query);
33 33
         $result = $query->execute();
34
-        if(!$result) {
34
+        if (!$result) {
35 35
           Debug::fatal([
36 36
             "query" => $_query,
37 37
             "error" => [
Please login to merge, or discard this patch.