@@ -32,9 +32,12 @@ discard block |
||
32 | 32 | { |
33 | 33 | parent::__construct( $config ); |
34 | 34 | |
35 | - try { |
|
35 | + try |
|
36 | + { |
|
36 | 37 | $this->conn = $this->createConnection(); |
37 | - } catch( \Aimeos\MW\DB\Exception $e ) { |
|
38 | + } |
|
39 | + catch( \Aimeos\MW\DB\Exception $e ) |
|
40 | + { |
|
38 | 41 | throw new \Aimeos\MW\MQueue\Exception( $e->getMessage() ); |
39 | 42 | } |
40 | 43 | } |
@@ -85,8 +88,7 @@ discard block |
||
85 | 88 | { |
86 | 89 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
87 | 90 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
88 | - } |
|
89 | - else |
|
91 | + } else |
|
90 | 92 | { |
91 | 93 | $dsn .= ';unix_socket=' . $sock; |
92 | 94 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | return array( |
10 | 10 | 'table' => array( |
11 | - 'madmin_queue' => function ( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
11 | + 'madmin_queue' => function( \Doctrine\DBAL\Schema\Schema $schema ) { |
|
12 | 12 | |
13 | 13 | $table = $schema->createTable( 'madmin_queue' ); |
14 | 14 |
@@ -109,7 +109,7 @@ |
||
109 | 109 | |
110 | 110 | $lcList = array( |
111 | 111 | 0 => array( |
112 | - 'am', 'ar','bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv','mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
112 | + 'am', 'ar', 'bh', 'fil', 'fr', 'gun', 'hi', 'ln', 'lv', 'mg', 'nso', 'xbr', 'ti', 'wa', 'pt_BR' |
|
113 | 113 | ), |
114 | 114 | 1 => array( |
115 | 115 | 'af', 'az', 'bn', 'bg', 'ca', 'da', 'de', 'el', 'en', 'eo', 'es', |
@@ -201,8 +201,7 @@ discard block |
||
201 | 201 | if( $level === \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ) { |
202 | 202 | return $node; |
203 | 203 | } |
204 | - } |
|
205 | - else |
|
204 | + } else |
|
206 | 205 | { |
207 | 206 | $node = $this->getNodeById( $id ); |
208 | 207 | |
@@ -276,15 +275,13 @@ discard block |
||
276 | 275 | $node->left = $refNode->left; |
277 | 276 | $node->right = $refNode->left + 1; |
278 | 277 | $node->level = $refNode->level; |
279 | - } |
|
280 | - else if( $parentId !== null ) |
|
278 | + } else if( $parentId !== null ) |
|
281 | 279 | { |
282 | 280 | $parentNode = $this->getNode( $parentId, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
283 | 281 | $node->left = $parentNode->right; |
284 | 282 | $node->right = $parentNode->right + 1; |
285 | 283 | $node->level = $parentNode->level + 1; |
286 | - } |
|
287 | - else |
|
284 | + } else |
|
288 | 285 | { |
289 | 286 | $node->left = 1; |
290 | 287 | $node->right = 2; |
@@ -375,8 +372,7 @@ discard block |
||
375 | 372 | $moveNodeRightBegin = $node->left + $diff + 1; |
376 | 373 | $moveNodeRightEnd = $node->right + $diff; |
377 | 374 | $movesize = $refNode->left - $node->left - $diff; |
378 | - } |
|
379 | - else |
|
375 | + } else |
|
380 | 376 | { |
381 | 377 | $moveNodeLeftBegin = $node->left; |
382 | 378 | $moveNodeLeftEnd = $node->right - 1; |
@@ -387,8 +383,7 @@ discard block |
||
387 | 383 | |
388 | 384 | $closeNodeLeftBegin = $node->left + $diff; |
389 | 385 | $closeNodeRightBegin = $node->left + $diff; |
390 | - } |
|
391 | - else |
|
386 | + } else |
|
392 | 387 | { |
393 | 388 | $refNode = $this->getNode( $newParentId, \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE ); |
394 | 389 | |
@@ -414,8 +409,7 @@ discard block |
||
414 | 409 | $moveNodeRightBegin = $node->left + $diff + 1; |
415 | 410 | $moveNodeRightEnd = $node->right + $diff; |
416 | 411 | $movesize = $refNode->right - $node->left - $diff; |
417 | - } |
|
418 | - else |
|
412 | + } else |
|
419 | 413 | { |
420 | 414 | $moveNodeLeftBegin = $node->left; |
421 | 415 | $moveNodeLeftEnd = $node->right - 1; |
@@ -88,7 +88,8 @@ |
||
88 | 88 | return array_pop( $this->connections[$name] ); |
89 | 89 | |
90 | 90 | } |
91 | - catch( \Exception $e ) { |
|
91 | + catch( \Exception $e ) |
|
92 | + { |
|
92 | 93 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode() ); |
93 | 94 | } |
94 | 95 | } |
@@ -88,7 +88,8 @@ discard block |
||
88 | 88 | return array_pop( $this->connections[$name] ); |
89 | 89 | |
90 | 90 | } |
91 | - catch( \PDOException $e ) { |
|
91 | + catch( \PDOException $e ) |
|
92 | + { |
|
92 | 93 | throw new \Aimeos\MW\DB\Exception( $e->getMessage(), $e->getCode(), $e->errorInfo ); |
93 | 94 | } |
94 | 95 | } |
@@ -131,8 +132,7 @@ discard block |
||
131 | 132 | { |
132 | 133 | $dsn .= isset( $host ) ? ';host=' . $host : ''; |
133 | 134 | $dsn .= isset( $port ) ? ';port=' . $port : ''; |
134 | - } |
|
135 | - else |
|
135 | + } else |
|
136 | 136 | { |
137 | 137 | $dsn .= ';unix_socket=' . $sock; |
138 | 138 | } |
@@ -14,7 +14,7 @@ |
||
14 | 14 | |
15 | 15 | /** |
16 | 16 | * Log messages to a database table. |
17 | - * |
|
17 | + * |
|
18 | 18 | * @package MW |
19 | 19 | * @subpackage Logger |
20 | 20 | */ |
@@ -45,7 +45,7 @@ |
||
45 | 45 | $this->facilities = $facilities; |
46 | 46 | |
47 | 47 | if( $requestid === null ) { |
48 | - $requestid = md5( php_uname('n') . getmypid() . date( 'Y-m-d H:i:s' ) ); |
|
48 | + $requestid = md5( php_uname( 'n' ) . getmypid() . date( 'Y-m-d H:i:s' ) ); |
|
49 | 49 | } |
50 | 50 | $this->requestid = $requestid; |
51 | 51 | } |
@@ -100,10 +100,14 @@ |
||
100 | 100 | $type->setLabel( $dataset['label'] ); |
101 | 101 | $type->setStatus( $dataset['status'] ); |
102 | 102 | |
103 | - try { |
|
103 | + try |
|
104 | + { |
|
104 | 105 | $domainManager->saveItem( $type ); |
105 | 106 | $num++; |
106 | - } catch( \Exception $e ) { ; } // if type was already available |
|
107 | + } |
|
108 | + catch( \Exception $e ) |
|
109 | + { |
|
110 | +; } // if type was already available |
|
107 | 111 | } |
108 | 112 | |
109 | 113 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -100,7 +100,7 @@ |
||
100 | 100 | try { |
101 | 101 | $domainManager->saveItem( $type ); |
102 | 102 | $num++; |
103 | - } catch( \Exception $e ) { ; } // if type was already available |
|
103 | + } catch( \Exception $e ) {; } // if type was already available |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | $this->status( $num > 0 ? $num . '/' . $total : 'OK' ); |
@@ -72,8 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $this->execute( $stmt ); |
74 | 74 | $this->status( 'done' ); |
75 | - } |
|
76 | - else |
|
75 | + } else |
|
77 | 76 | { |
78 | 77 | $this->status( 'OK' ); |
79 | 78 | } |
@@ -86,8 +85,7 @@ discard block |
||
86 | 85 | { |
87 | 86 | $this->executeList( $this->updates ); |
88 | 87 | $this->status( 'done' ); |
89 | - } |
|
90 | - else |
|
88 | + } else |
|
91 | 89 | { |
92 | 90 | $this->status( 'OK' ); |
93 | 91 | } |
@@ -101,8 +99,7 @@ discard block |
||
101 | 99 | { |
102 | 100 | $this->execute( $stmt ); |
103 | 101 | $this->status( 'done' ); |
104 | - } |
|
105 | - else |
|
102 | + } else |
|
106 | 103 | { |
107 | 104 | $this->status( 'OK' ); |
108 | 105 | } |
@@ -114,8 +111,7 @@ discard block |
||
114 | 111 | { |
115 | 112 | $this->execute( $this->column ); |
116 | 113 | $this->status( 'done' ); |
117 | - } |
|
118 | - else |
|
114 | + } else |
|
119 | 115 | { |
120 | 116 | $this->status( 'OK' ); |
121 | 117 | } |