| @@ -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 | } | 
| @@ -109,7 +109,8 @@ | ||
| 109 | 109 | |
| 110 | 110 | return array_pop( $this->connections[$name] ); | 
| 111 | 111 | } | 
| 112 | -		catch( \Exception $e ) { | |
| 112 | + catch( \Exception $e ) | |
| 113 | +		{ | |
| 113 | 114 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode() ); | 
| 114 | 115 | } | 
| 115 | 116 | } | 
| @@ -109,7 +109,8 @@ discard block | ||
| 109 | 109 | |
| 110 | 110 | return array_pop( $this->connections[$name] ); | 
| 111 | 111 | } | 
| 112 | -		catch( \PDOException $e ) { | |
| 112 | + catch( \PDOException $e ) | |
| 113 | +		{ | |
| 113 | 114 | throw new \Aimeos\Base\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); | 
| 114 | 115 | } | 
| 115 | 116 | } | 
| @@ -159,14 +160,12 @@ discard block | ||
| 159 | 160 |  			{ | 
| 160 | 161 | $dsn .= 'Database=' . $dbase; | 
| 161 | 162 | $dsn .= isset( $host ) ? ';Server=' . $host . ( isset( $port ) ? ',' . $port : '' ) : ''; | 
| 162 | - } | |
| 163 | - elseif( $sock == null ) | |
| 163 | + } elseif( $sock == null ) | |
| 164 | 164 |  			{ | 
| 165 | 165 | $dsn .= 'dbname=' . $dbase; | 
| 166 | 166 | $dsn .= isset( $host ) ? ';host=' . $host : ''; | 
| 167 | 167 | $dsn .= isset( $port ) ? ';port=' . $port : ''; | 
| 168 | - } | |
| 169 | - else | |
| 168 | + } else | |
| 170 | 169 |  			{ | 
| 171 | 170 | $dsn .= 'dbname=' . $dbase . ';unix_socket=' . $sock; | 
| 172 | 171 | } |