Test Failed
Push — master ( a33193...53306a )
by Federico
02:00
created
dist/jate/modules/Connection/Adapters/ConnectionPostgresqlAdapter.php 1 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.
dist/jate/modules/Connection/Adapters/ConnectionMysqliAdapter.php 1 patch
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("ConnectionInterface.php");
3 3
   class ConnectionMysqliAdapter implements ConnectionAdapterInterface {
4
-      public $connection;
5
-      public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
-        try {
7
-          $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db );
8
-        } catch( Exception $error ) {
9
-          Debug::fatal($error->getMessage());
10
-          exit();
11
-        }
12
-      }
13
-      public function query( $_query ) {
14
-        $this->stdQuery($_query);
15
-        return true;
16
-      }
17
-      public function queryInsert( $_query ) {
18
-        $this->stdQuery($_query);
19
-        return $this->connection->insert_id;
20
-      }
21
-      public function queryFetch( $_query ) {
22
-        $result = $this->stdQuery($_query);
23
-        $rows = [];
24
-        while($row = $result->fetch_assoc())
25
-          $rows[] = $row;
26
-        return $rows;
27
-      }
28
-      public function queryArray( $_query ) {
29
-        $result = $this->stdQuery($_query);
30
-        $rows = [];
31
-        while($row = $result->fetch_array())
32
-          $rows[] = $row;
33
-        return $rows;
34
-      }
35
-      protected function stdQuery( $_query ) {
36
-        $database = $this->connection;
37
-        $result = $database->query($_query);
38
-        if(!$result) {
39
-          Debug::fatal([
40
-            "query" => $_query,
41
-            "error" => $database->error
42
-          ]);
43
-          exit();
44
-        }
45
-        return $result;
46
-      }
4
+	  public $connection;
5
+	  public function __construct( $_srv, $_db, $_usr, $_pass ) {
6
+		try {
7
+		  $this->connection = new mysqli( $_srv, $_usr, $_pass, $_db );
8
+		} catch( Exception $error ) {
9
+		  Debug::fatal($error->getMessage());
10
+		  exit();
11
+		}
12
+	  }
13
+	  public function query( $_query ) {
14
+		$this->stdQuery($_query);
15
+		return true;
16
+	  }
17
+	  public function queryInsert( $_query ) {
18
+		$this->stdQuery($_query);
19
+		return $this->connection->insert_id;
20
+	  }
21
+	  public function queryFetch( $_query ) {
22
+		$result = $this->stdQuery($_query);
23
+		$rows = [];
24
+		while($row = $result->fetch_assoc())
25
+		  $rows[] = $row;
26
+		return $rows;
27
+	  }
28
+	  public function queryArray( $_query ) {
29
+		$result = $this->stdQuery($_query);
30
+		$rows = [];
31
+		while($row = $result->fetch_array())
32
+		  $rows[] = $row;
33
+		return $rows;
34
+	  }
35
+	  protected function stdQuery( $_query ) {
36
+		$database = $this->connection;
37
+		$result = $database->query($_query);
38
+		if(!$result) {
39
+		  Debug::fatal([
40
+			"query" => $_query,
41
+			"error" => $database->error
42
+		  ]);
43
+		  exit();
44
+		}
45
+		return $result;
46
+	  }
47 47
   }
48 48
 ?>
Please login to merge, or discard this patch.
dist/jate/modules/Connection/Adapters/ConnectionPdoAdapter.php 1 patch
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.