@@ -66,7 +66,7 @@ |
||
66 | 66 | $method = NET_SFTP_STRING; break; |
67 | 67 | } |
68 | 68 | |
69 | - if ( $this->sftp->put( $target, $payload, $method ) === false ) |
|
69 | + if( $this->sftp->put( $target, $payload, $method ) === false ) |
|
70 | 70 | { |
71 | 71 | $msg = sprintf( 'Could not upload payload to "%1$s:%2$s"', $this->config['host'], $target ); |
72 | 72 | throw new \Aimeos\MW\Communication\Exception( $msg ); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @return \Aimeos\MW\DB\Statement\Iface \PDO statement object |
43 | 43 | * @throws \Aimeos\MW\DB\Exception if type is invalid or the DBAL object throws an exception |
44 | 44 | */ |
45 | - public function create( $sql, $type = \Aimeos\MW\DB\Connection\Base::TYPE_SIMPLE ) |
|
45 | + public function create( $sql, $type = \Aimeos\MW\DB\Connection\Base::TYPE_SIMPLE ) |
|
46 | 46 | { |
47 | 47 | try |
48 | 48 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | throw new \Aimeos\MW\DB\Exception( sprintf( 'Invalid value "%1$d" for statement type', $type ) ); |
57 | 57 | } |
58 | 58 | } |
59 | - catch( \Exception $e) |
|
59 | + catch( \Exception $e ) |
|
60 | 60 | { |
61 | 61 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
62 | 62 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | throw new \Aimeos\MW\DB\Exception( sprintf( 'Invalid value "%1$d" for statement type', $type ) ); |
57 | 57 | } |
58 | 58 | } catch( \PDOException $e ) { |
59 | - throw new \Aimeos\MW\DB\Exception($e->getMessage(), $e->getCode(), $e->errorInfo ); |
|
59 | + throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 |
@@ -45,7 +45,8 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function create( $sql, $type = \Aimeos\MW\DB\Connection\Base::TYPE_SIMPLE ) |
47 | 47 | { |
48 | - try { |
|
48 | + try |
|
49 | + { |
|
49 | 50 | switch( $type ) |
50 | 51 | { |
51 | 52 | case \Aimeos\MW\DB\Connection\Base::TYPE_SIMPLE: |
@@ -55,7 +56,9 @@ discard block |
||
55 | 56 | default: |
56 | 57 | throw new \Aimeos\MW\DB\Exception( sprintf( 'Invalid value "%1$d" for statement type', $type ) ); |
57 | 58 | } |
58 | - } catch( \PDOException $e ) { |
|
59 | + } |
|
60 | + catch( \PDOException $e ) |
|
61 | + { |
|
59 | 62 | throw new \Aimeos\MW\DB\Exception($e->getMessage(), $e->getCode(), $e->errorInfo ); |
60 | 63 | } |
61 | 64 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @param integer $type Type of given value defined in \Aimeos\MW\DB\Stmt\Base as constant |
29 | 29 | * @return void |
30 | 30 | */ |
31 | - public function bind( $position, $value, $type = \Aimeos\MW\DB\Statement\Base::PARAM_STR); |
|
31 | + public function bind( $position, $value, $type = \Aimeos\MW\DB\Statement\Base::PARAM_STR ); |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * Executes the statement. |
@@ -88,9 +88,12 @@ |
||
88 | 88 | |
89 | 89 | $sql = $this->buildSQL( $this->parts, $this->binds ); |
90 | 90 | |
91 | - try { |
|
91 | + try |
|
92 | + { |
|
92 | 93 | return new \Aimeos\MW\DB\Result\PDO( $this->conn->query( $sql ) ); |
93 | - } catch ( \PDOException $pe ) { |
|
94 | + } |
|
95 | + catch ( \PDOException $pe ) |
|
96 | + { |
|
94 | 97 | throw new \Aimeos\MW\DB\Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ) . $pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
95 | 98 | } |
96 | 99 | } |
@@ -86,8 +86,8 @@ |
||
86 | 86 | |
87 | 87 | try { |
88 | 88 | return new \Aimeos\MW\DB\Result\PDO( $this->conn->query( $sql ) ); |
89 | - } catch ( \PDOException $pe ) { |
|
90 | - throw new \Aimeos\MW\DB\Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ) . $pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
|
89 | + } catch( \PDOException $pe ) { |
|
90 | + throw new \Aimeos\MW\DB\Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ).$pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | { |
47 | 47 | try { |
48 | 48 | $this->stmt->bindValue( $position, $value, $this->getPdoType( $type, $value ) ); |
49 | - } catch ( \PDOException $pe ) { |
|
49 | + } catch( \PDOException $pe ) { |
|
50 | 50 | throw new \Aimeos\MW\DB\Exception( $pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
51 | 51 | } |
52 | 52 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | { |
63 | 63 | try { |
64 | 64 | $this->stmt->execute(); |
65 | - } catch ( \PDOException $pe ) { |
|
65 | + } catch( \PDOException $pe ) { |
|
66 | 66 | throw new \Aimeos\MW\DB\Exception( $pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
67 | 67 | } |
68 | 68 |
@@ -44,9 +44,12 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function bind( $position, $value, $type = \Aimeos\MW\DB\Statement\Base::PARAM_STR ) |
46 | 46 | { |
47 | - try { |
|
47 | + try |
|
48 | + { |
|
48 | 49 | $this->stmt->bindValue( $position, $value, $this->getPdoType( $type, $value ) ); |
49 | - } catch ( \PDOException $pe ) { |
|
50 | + } |
|
51 | + catch ( \PDOException $pe ) |
|
52 | + { |
|
50 | 53 | throw new \Aimeos\MW\DB\Exception( $pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
51 | 54 | } |
52 | 55 | } |
@@ -60,9 +63,12 @@ discard block |
||
60 | 63 | */ |
61 | 64 | public function execute() |
62 | 65 | { |
63 | - try { |
|
66 | + try |
|
67 | + { |
|
64 | 68 | $this->stmt->execute(); |
65 | - } catch ( \PDOException $pe ) { |
|
69 | + } |
|
70 | + catch ( \PDOException $pe ) |
|
71 | + { |
|
66 | 72 | throw new \Aimeos\MW\DB\Exception( $pe->getMessage(), $pe->getCode(), $pe->errorInfo ); |
67 | 73 | } |
68 | 74 |
@@ -86,8 +86,8 @@ |
||
86 | 86 | |
87 | 87 | try { |
88 | 88 | return new \Aimeos\MW\DB\Result\DBAL( $this->conn->query( $sql ) ); |
89 | - } catch ( \Doctrine\DBAL\DBALException $p ) { |
|
90 | - throw new \Aimeos\MW\DB\Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ) . $p->getMessage(), $p->getCode() ); |
|
89 | + } catch( \Doctrine\DBAL\DBALException $p ) { |
|
90 | + throw new \Aimeos\MW\DB\Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ).$p->getMessage(), $p->getCode() ); |
|
91 | 91 | } |
92 | 92 | } |
93 | 93 |
@@ -84,9 +84,12 @@ |
||
84 | 84 | |
85 | 85 | $sql = $this->buildSQL( $this->parts, $this->binds ); |
86 | 86 | |
87 | - try { |
|
87 | + try |
|
88 | + { |
|
88 | 89 | return new \Aimeos\MW\DB\Result\DBAL( $this->conn->query( $sql ) ); |
89 | - } catch ( \Doctrine\DBAL\DBALException $p ) { |
|
90 | + } |
|
91 | + catch ( \Doctrine\DBAL\DBALException $p ) |
|
92 | + { |
|
90 | 93 | throw new \Aimeos\MW\DB\Exception( sprintf( 'Executing statement "%1$s" failed: ', $sql ) . $p->getMessage(), $p->getCode() ); |
91 | 94 | } |
92 | 95 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | { |
46 | 46 | try { |
47 | 47 | $this->stmt->bindValue( $position, $value, $this->getPdoType( $type, $value ) ); |
48 | - } catch ( \Doctrine\DBAL\DBALException $e ) { |
|
48 | + } catch( \Doctrine\DBAL\DBALException $e ) { |
|
49 | 49 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
50 | 50 | } |
51 | 51 | } |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | { |
62 | 62 | try { |
63 | 63 | $this->stmt->execute(); |
64 | - } catch ( \Doctrine\DBAL\DBALException $e ) { |
|
64 | + } catch( \Doctrine\DBAL\DBALException $e ) { |
|
65 | 65 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
66 | 66 | } |
67 | 67 |
@@ -43,9 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function bind( $position, $value, $type = \Aimeos\MW\DB\Statement\Base::PARAM_STR ) |
45 | 45 | { |
46 | - try { |
|
46 | + try |
|
47 | + { |
|
47 | 48 | $this->stmt->bindValue( $position, $value, $this->getPdoType( $type, $value ) ); |
48 | - } catch ( \Doctrine\DBAL\DBALException $e ) { |
|
49 | + } |
|
50 | + catch ( \Doctrine\DBAL\DBALException $e ) |
|
51 | + { |
|
49 | 52 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
50 | 53 | } |
51 | 54 | } |
@@ -59,9 +62,12 @@ discard block |
||
59 | 62 | */ |
60 | 63 | public function execute() |
61 | 64 | { |
62 | - try { |
|
65 | + try |
|
66 | + { |
|
63 | 67 | $this->stmt->execute(); |
64 | - } catch ( \Doctrine\DBAL\DBALException $e ) { |
|
68 | + } |
|
69 | + catch ( \Doctrine\DBAL\DBALException $e ) |
|
70 | + { |
|
65 | 71 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
66 | 72 | } |
67 | 73 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | { |
49 | 49 | try { |
50 | 50 | return $this->statement->rowCount(); |
51 | - } catch ( \PDOException $e ) { |
|
51 | + } catch( \PDOException $e ) { |
|
52 | 52 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
53 | 53 | } |
54 | 54 | } |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | { |
66 | 66 | try { |
67 | 67 | return $this->statement->fetch( $this->style[$style] ); |
68 | - } catch ( \PDOException $e ) { |
|
68 | + } catch( \PDOException $e ) { |
|
69 | 69 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
70 | 70 | } |
71 | 71 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | { |
81 | 81 | try { |
82 | 82 | $this->statement->closeCursor(); |
83 | - } catch ( \PDOException $e ) { |
|
83 | + } catch( \PDOException $e ) { |
|
84 | 84 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
85 | 85 | } |
86 | 86 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | { |
96 | 96 | try { |
97 | 97 | return $this->statement->nextRowset(); |
98 | - } catch ( \PDOException $e ) { |
|
98 | + } catch( \PDOException $e ) { |
|
99 | 99 | return false; |
100 | 100 | } |
101 | 101 | } |
@@ -46,9 +46,12 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function affectedRows() |
48 | 48 | { |
49 | - try { |
|
49 | + try |
|
50 | + { |
|
50 | 51 | return $this->statement->rowCount(); |
51 | - } catch ( \PDOException $e ) { |
|
52 | + } |
|
53 | + catch ( \PDOException $e ) |
|
54 | + { |
|
52 | 55 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
53 | 56 | } |
54 | 57 | } |
@@ -63,9 +66,12 @@ discard block |
||
63 | 66 | */ |
64 | 67 | public function fetch( $style = \Aimeos\MW\DB\Result\Base::FETCH_ASSOC ) |
65 | 68 | { |
66 | - try { |
|
69 | + try |
|
70 | + { |
|
67 | 71 | return $this->statement->fetch( $this->style[$style] ); |
68 | - } catch ( \PDOException $e ) { |
|
72 | + } |
|
73 | + catch ( \PDOException $e ) |
|
74 | + { |
|
69 | 75 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
70 | 76 | } |
71 | 77 | } |
@@ -78,9 +84,12 @@ discard block |
||
78 | 84 | */ |
79 | 85 | public function finish() |
80 | 86 | { |
81 | - try { |
|
87 | + try |
|
88 | + { |
|
82 | 89 | $this->statement->closeCursor(); |
83 | - } catch ( \PDOException $e ) { |
|
90 | + } |
|
91 | + catch ( \PDOException $e ) |
|
92 | + { |
|
84 | 93 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
85 | 94 | } |
86 | 95 | } |
@@ -93,9 +102,12 @@ discard block |
||
93 | 102 | */ |
94 | 103 | public function nextResult() |
95 | 104 | { |
96 | - try { |
|
105 | + try |
|
106 | + { |
|
97 | 107 | return $this->statement->nextRowset(); |
98 | - } catch ( \PDOException $e ) { |
|
108 | + } |
|
109 | + catch ( \PDOException $e ) |
|
110 | + { |
|
99 | 111 | return false; |
100 | 112 | } |
101 | 113 | } |