@@ -74,8 +74,7 @@ |
||
74 | 74 | SELECT * FROM mw_mqueue_test WHERE queue = ? AND cname = ? AND rtime = ? |
75 | 75 | ORDER BY id LIMIT 1 |
76 | 76 | '; |
77 | - } |
|
78 | - else |
|
77 | + } else |
|
79 | 78 | { |
80 | 79 | $config['sql']['reserve'] = ' |
81 | 80 | UPDATE mw_mqueue_test SET cname = ?, rtime = ? WHERE id IN ( |
@@ -110,9 +110,12 @@ |
||
110 | 110 | throw new Exception( 'Unable to fork new process: ' . pcntl_strerror( pcntl_get_last_error() ) ); |
111 | 111 | } |
112 | 112 | |
113 | - if( $pid === 0 ) // child process |
|
113 | + if( $pid === 0 ) { |
|
114 | + // child process |
|
114 | 115 | { |
115 | - $this->list = []; // use own child process list |
|
116 | + $this->list = []; |
|
117 | + } |
|
118 | + // use own child process list |
|
116 | 119 | exit( $this->exec( $fcn, $data ) ); |
117 | 120 | } |
118 | 121 |
@@ -69,9 +69,12 @@ |
||
69 | 69 | */ |
70 | 70 | public function execute() : \Aimeos\Base\DB\Result\Iface |
71 | 71 | { |
72 | - try { |
|
72 | + try |
|
73 | + { |
|
73 | 74 | $result = $this->exec(); |
74 | - } catch( \PDOException $e ) { |
|
75 | + } |
|
76 | + catch( \PDOException $e ) |
|
77 | + { |
|
75 | 78 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
76 | 79 | } |
77 | 80 |
@@ -71,9 +71,12 @@ |
||
71 | 71 | */ |
72 | 72 | public function execute() : \Aimeos\Base\DB\Result\Iface |
73 | 73 | { |
74 | - try { |
|
74 | + try |
|
75 | + { |
|
75 | 76 | $stmt = $this->exec(); |
76 | - } catch( \PDOException $e ) { |
|
77 | + } |
|
78 | + catch( \PDOException $e ) |
|
79 | + { |
|
77 | 80 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . json_encode( array_column( $this->binds, 0 ) ), $e->getCode(), $e->errorInfo ); |
78 | 81 | } |
79 | 82 |
@@ -69,9 +69,12 @@ |
||
69 | 69 | */ |
70 | 70 | public function execute() : \Aimeos\Base\DB\Result\Iface |
71 | 71 | { |
72 | - try { |
|
72 | + try |
|
73 | + { |
|
73 | 74 | $result = $this->getConnection()->getRawObject()->getWrappedConnection()->query( $this->sql ); |
74 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
75 | + } |
|
76 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
77 | + { |
|
75 | 78 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql, $e->getCode() ); |
76 | 79 | } |
77 | 80 |
@@ -71,9 +71,12 @@ |
||
71 | 71 | */ |
72 | 72 | public function execute() : \Aimeos\Base\DB\Result\Iface |
73 | 73 | { |
74 | - try { |
|
74 | + try |
|
75 | + { |
|
75 | 76 | $result = $this->exec(); |
76 | - } catch( \Doctrine\DBAL\Driver\Exception $e ) { |
|
77 | + } |
|
78 | + catch( \Doctrine\DBAL\Driver\Exception $e ) |
|
79 | + { |
|
77 | 80 | throw new \Aimeos\Base\DB\Exception( $e->getMessage() . ': ' . $this->sql . json_encode( array_column( $this->binds, 0 ) ), $e->getCode() ); |
78 | 81 | } |
79 | 82 |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | switch( $type ) |
118 | 118 | { |
119 | 119 | case \Aimeos\Base\DB\Statement\Base::PARAM_NULL: |
120 | - $dbaltype = \Doctrine\DBAL\ParameterType::NULL; break; |
|
120 | + $dbaltype = \Doctrine\DBAL\ParameterType::null; break; |
|
121 | 121 | case \Aimeos\Base\DB\Statement\Base::PARAM_BOOL: |
122 | 122 | $dbaltype = \Doctrine\DBAL\ParameterType::BOOLEAN; break; |
123 | 123 | case \Aimeos\Base\DB\Statement\Base::PARAM_INT: |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | |
135 | 135 | if( is_null( $value ) ) { |
136 | - $dbaltype = \Doctrine\DBAL\ParameterType::NULL; |
|
136 | + $dbaltype = \Doctrine\DBAL\ParameterType::null; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | return $dbaltype; |
@@ -50,9 +50,12 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function affectedRows() : int |
52 | 52 | { |
53 | - try { |
|
53 | + try |
|
54 | + { |
|
54 | 55 | return $this->statement->rowCount(); |
55 | - } catch( \PDOException $e ) { |
|
56 | + } |
|
57 | + catch( \PDOException $e ) |
|
58 | + { |
|
56 | 59 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
57 | 60 | } |
58 | 61 | } |
@@ -67,9 +70,12 @@ discard block |
||
67 | 70 | */ |
68 | 71 | public function fetch( int $style = \Aimeos\Base\DB\Result\Base::FETCH_ASSOC ) : ?array |
69 | 72 | { |
70 | - try { |
|
73 | + try |
|
74 | + { |
|
71 | 75 | return $this->statement->fetch( $style ? \PDO::FETCH_ASSOC : \PDO::FETCH_NUM ) ?: null; |
72 | - } catch( \PDOException $e ) { |
|
76 | + } |
|
77 | + catch( \PDOException $e ) |
|
78 | + { |
|
73 | 79 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
74 | 80 | } |
75 | 81 | } |
@@ -83,9 +89,12 @@ discard block |
||
83 | 89 | */ |
84 | 90 | public function finish() : Iface |
85 | 91 | { |
86 | - try { |
|
92 | + try |
|
93 | + { |
|
87 | 94 | $this->statement->closeCursor(); |
88 | - } catch( \PDOException $e ) { |
|
95 | + } |
|
96 | + catch( \PDOException $e ) |
|
97 | + { |
|
89 | 98 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
90 | 99 | } |
91 | 100 | |
@@ -100,9 +109,12 @@ discard block |
||
100 | 109 | */ |
101 | 110 | public function nextResult() : bool |
102 | 111 | { |
103 | - try { |
|
112 | + try |
|
113 | + { |
|
104 | 114 | return $this->statement->nextRowset(); |
105 | - } catch( \PDOException $e ) { |
|
115 | + } |
|
116 | + catch( \PDOException $e ) |
|
117 | + { |
|
106 | 118 | return false; |
107 | 119 | } |
108 | 120 | } |
@@ -102,8 +102,7 @@ |
||
102 | 102 | { |
103 | 103 | $this->cache[$name] = $value; |
104 | 104 | unset( $this->negCache[$name] ); |
105 | - } |
|
106 | - else |
|
105 | + } else |
|
107 | 106 | { |
108 | 107 | $this->negCache[$name] = true; |
109 | 108 | } |
@@ -241,9 +241,12 @@ |
||
241 | 241 | { |
242 | 242 | if( self::$node === null ) |
243 | 243 | { |
244 | - try { |
|
244 | + try |
|
245 | + { |
|
245 | 246 | self::$node = random_bytes( 6 ); |
246 | - } catch( \Throwable $t ) { |
|
247 | + } |
|
248 | + catch( \Throwable $t ) |
|
249 | + { |
|
247 | 250 | if( function_exists( 'openssl_random_pseudo_bytes' ) ) { |
248 | 251 | self::$node = openssl_random_pseudo_bytes( 6 ); |
249 | 252 | } else { |