@@ -164,8 +164,7 @@ |
||
| 164 | 164 | return $handler->createNewInstance(); |
| 165 | 165 | else |
| 166 | 166 | return $registry->createInstanceOf($this->getClass()); |
| 167 | - } |
|
| 168 | - catch (TSqlMapException $e) |
|
| 167 | + } catch (TSqlMapException $e) |
|
| 169 | 168 | { |
| 170 | 169 | throw new TSqlMapException( |
| 171 | 170 | 'sqlmap_unable_to_create_new_instance', |
@@ -146,8 +146,7 @@ |
||
| 146 | 146 | { |
| 147 | 147 | $info['NumericPrecision'] = intval($ps[0]); |
| 148 | 148 | $info['NumericScale'] = intval($ps[1]); |
| 149 | - } |
|
| 150 | - else |
|
| 149 | + } else |
|
| 151 | 150 | $info['ColumnSize']=intval($match[1]); |
| 152 | 151 | $info['DbType'] = substr($type,0,$pos); |
| 153 | 152 | } |
@@ -225,8 +225,7 @@ discard block |
||
| 225 | 225 | $year = "{$date['year']}"; |
| 226 | 226 | $month = $date['mon']; |
| 227 | 227 | $day = $date['mday']; |
| 228 | - } |
|
| 229 | - else |
|
| 228 | + } else |
|
| 230 | 229 | { |
| 231 | 230 | $year = null; |
| 232 | 231 | $month = null; |
@@ -262,8 +261,7 @@ discard block |
||
| 262 | 261 | $year = $iYear + 2000; |
| 263 | 262 | } |
| 264 | 263 | $year = (int)$year; |
| 265 | - } |
|
| 266 | - elseif($token=='MM' || $token=='M') |
|
| 264 | + } elseif($token=='MM' || $token=='M') |
|
| 267 | 265 | { |
| 268 | 266 | $month=$this->getInteger($value,$i_val, |
| 269 | 267 | $this->length($token),2); |
@@ -273,8 +271,7 @@ discard block |
||
| 273 | 271 | //throw new TInvalidDataValueException('Invalid month', $value); |
| 274 | 272 | $i_val += strlen($month); |
| 275 | 273 | $month = $iMonth; |
| 276 | - } |
|
| 277 | - elseif ($token=='dd' || $token=='d') |
|
| 274 | + } elseif ($token=='dd' || $token=='d') |
|
| 278 | 275 | { |
| 279 | 276 | $day = $this->getInteger($value,$i_val, |
| 280 | 277 | $this->length($token), 2); |
@@ -284,8 +281,7 @@ discard block |
||
| 284 | 281 | //throw new TInvalidDataValueException('Invalid day', $value); |
| 285 | 282 | $i_val += strlen($day); |
| 286 | 283 | $day = $iDay; |
| 287 | - } |
|
| 288 | - else |
|
| 284 | + } else |
|
| 289 | 285 | { |
| 290 | 286 | if($this->substring($value, $i_val, $this->length($token)) != $token) |
| 291 | 287 | return null; |
@@ -179,8 +179,7 @@ |
||
| 179 | 179 | $server['Weight'],$server['Timeout'],$server['RetryInterval'])===false) |
| 180 | 180 | throw new TConfigurationException('memcache_connection_failed',$server['Host'],$server['Port']); |
| 181 | 181 | } |
| 182 | - } |
|
| 183 | - else |
|
| 182 | + } else |
|
| 184 | 183 | { |
| 185 | 184 | Prado::trace('Adding server '.$this->_host, 'System.Caching.TMemCache'); |
| 186 | 185 | if($this->_cache->addServer($this->_host,$this->_port)===false) |
@@ -199,8 +199,7 @@ discard block |
||
| 199 | 199 | $this -> _createCheck = true; |
| 200 | 200 | $this -> getApplication() -> setGlobalState($key, time()); |
| 201 | 201 | } |
| 202 | - } |
|
| 203 | - catch(Exception $e) |
|
| 202 | + } catch(Exception $e) |
|
| 204 | 203 | { |
| 205 | 204 | // DB table not exists |
| 206 | 205 | if($this->_autoCreate) |
@@ -223,8 +222,7 @@ discard block |
||
| 223 | 222 | |
| 224 | 223 | $this -> _createCheck = true; |
| 225 | 224 | $this -> getApplication() -> setGlobalState($key, time()); |
| 226 | - } |
|
| 227 | - else |
|
| 225 | + } else |
|
| 228 | 226 | throw new TConfigurationException('db_cachetable_inexistent',$this->_cacheTable); |
| 229 | 227 | } |
| 230 | 228 | $this->_cacheInitialized = true; |
@@ -293,8 +291,7 @@ discard block |
||
| 293 | 291 | return $config->getDbConnection(); |
| 294 | 292 | else |
| 295 | 293 | throw new TConfigurationException('dbcache_connectionid_invalid',$this->_connID); |
| 296 | - } |
|
| 297 | - else |
|
| 294 | + } else |
|
| 298 | 295 | { |
| 299 | 296 | $db=new TDbConnection; |
| 300 | 297 | if($this->_connectionString!=='') |
@@ -304,8 +301,7 @@ discard block |
||
| 304 | 301 | $db->setUsername($this->_username); |
| 305 | 302 | if($this->_password!=='') |
| 306 | 303 | $db->setPassword($this->_password); |
| 307 | - } |
|
| 308 | - else |
|
| 304 | + } else |
|
| 309 | 305 | { |
| 310 | 306 | // default to SQLite3 database |
| 311 | 307 | $dbFile=$this->getApplication()->getRuntimePath().'/sqlite3.cache'; |
@@ -462,8 +458,7 @@ discard block |
||
| 462 | 458 | $sql='SELECT value FROM '.$this->_cacheTable.' WHERE itemkey=\''.$key.'\' AND (expire=0 OR expire>'.time().') ORDER BY expire DESC'; |
| 463 | 459 | $command=$this->getDbConnection()->createCommand($sql); |
| 464 | 460 | return unserialize($command->queryScalar()); |
| 465 | - } |
|
| 466 | - catch(Exception $e) |
|
| 461 | + } catch(Exception $e) |
|
| 467 | 462 | { |
| 468 | 463 | $this->initializeCache(true); |
| 469 | 464 | return unserialize($command->queryScalar()); |
@@ -506,16 +501,14 @@ discard block |
||
| 506 | 501 | $command->bindValue(':value',serialize($value),PDO::PARAM_LOB); |
| 507 | 502 | $command->execute(); |
| 508 | 503 | return true; |
| 509 | - } |
|
| 510 | - catch(Exception $e) |
|
| 504 | + } catch(Exception $e) |
|
| 511 | 505 | { |
| 512 | 506 | try |
| 513 | 507 | { |
| 514 | 508 | $this->initializeCache(true); |
| 515 | 509 | $command->execute(); |
| 516 | 510 | return true; |
| 517 | - } |
|
| 518 | - catch(Exception $e) |
|
| 511 | + } catch(Exception $e) |
|
| 519 | 512 | { |
| 520 | 513 | return false; |
| 521 | 514 | } |
@@ -537,8 +530,7 @@ discard block |
||
| 537 | 530 | $command->bindValue(':key',$key,PDO::PARAM_STR); |
| 538 | 531 | $command->execute(); |
| 539 | 532 | return true; |
| 540 | - } |
|
| 541 | - catch(Exception $e) |
|
| 533 | + } catch(Exception $e) |
|
| 542 | 534 | { |
| 543 | 535 | $this->initializeCache(true); |
| 544 | 536 | $command->execute(); |
@@ -557,16 +549,14 @@ discard block |
||
| 557 | 549 | { |
| 558 | 550 | $command = $this->getDbConnection()->createCommand("DELETE FROM {$this->_cacheTable}"); |
| 559 | 551 | $command->execute(); |
| 560 | - } |
|
| 561 | - catch(Exception $e) |
|
| 552 | + } catch(Exception $e) |
|
| 562 | 553 | { |
| 563 | 554 | try |
| 564 | 555 | { |
| 565 | 556 | $this->initializeCache(true); |
| 566 | 557 | $command->execute(); |
| 567 | 558 | return true; |
| 568 | - } |
|
| 569 | - catch(Exception $e) |
|
| 559 | + } catch(Exception $e) |
|
| 570 | 560 | { |
| 571 | 561 | return false; |
| 572 | 562 | } |
@@ -219,8 +219,7 @@ discard block |
||
| 219 | 219 | echo "<body><h1>Recursive Error</h1>\n"; |
| 220 | 220 | echo "<pre>".$exception->__toString()."</pre>\n"; |
| 221 | 221 | echo "</body></html>"; |
| 222 | - } |
|
| 223 | - else |
|
| 222 | + } else |
|
| 224 | 223 | { |
| 225 | 224 | error_log("Error happened while processing an existing error:\n".$exception->__toString()); |
| 226 | 225 | header('HTTP/1.0 500 Internal Error'); |
@@ -251,15 +250,13 @@ discard block |
||
| 251 | 250 | if($fileName==='') |
| 252 | 251 | $fileName='---embedded template---'; |
| 253 | 252 | $errorLine=$exception->getLineNumber(); |
| 254 | - } |
|
| 255 | - else |
|
| 253 | + } else |
|
| 256 | 254 | { |
| 257 | 255 | if(($trace=$this->getExactTrace($exception))!==null) |
| 258 | 256 | { |
| 259 | 257 | $fileName=$trace['file']; |
| 260 | 258 | $errorLine=$trace['line']; |
| 261 | - } |
|
| 262 | - else |
|
| 259 | + } else |
|
| 263 | 260 | { |
| 264 | 261 | $fileName=$exception->getFile(); |
| 265 | 262 | $errorLine=$exception->getLine(); |
@@ -350,8 +347,7 @@ discard block |
||
| 350 | 347 | $result=$trace[0]; |
| 351 | 348 | elseif(isset($trace[1])) |
| 352 | 349 | $result=$trace[1]; |
| 353 | - } |
|
| 354 | - else if($exception instanceof TInvalidOperationException) |
|
| 350 | + } else if($exception instanceof TInvalidOperationException) |
|
| 355 | 351 | { |
| 356 | 352 | // in case of getter or setter error, find out the exact file and row |
| 357 | 353 | if(($result=$this->getPropertyAccessTrace($trace,'__get'))===null) |
@@ -388,8 +384,7 @@ discard block |
||
| 388 | 384 | { |
| 389 | 385 | $line=htmlspecialchars(sprintf("%04d: %s",$i+1,str_replace("\t",' ',$lines[$i]))); |
| 390 | 386 | $source.="<div class=\"error\">".$line."</div>"; |
| 391 | - } |
|
| 392 | - else |
|
| 387 | + } else |
|
| 393 | 388 | $source.=htmlspecialchars(sprintf("%04d: %s",$i+1,str_replace("\t",' ',$lines[$i]))); |
| 394 | 389 | } |
| 395 | 390 | return $source; |
@@ -94,8 +94,7 @@ discard block |
||
| 94 | 94 | { |
| 95 | 95 | $this->_everyone=true; |
| 96 | 96 | break; |
| 97 | - } |
|
| 98 | - else if($user==='?') |
|
| 97 | + } else if($user==='?') |
|
| 99 | 98 | $this->_guest=true; |
| 100 | 99 | else if($user==='@') |
| 101 | 100 | $this->_authenticated=true; |
@@ -269,8 +268,7 @@ discard block |
||
| 269 | 268 | return ($decision>0); |
| 270 | 269 | } |
| 271 | 270 | return true; |
| 272 | - } |
|
| 273 | - else |
|
| 271 | + } else |
|
| 274 | 272 | return false; |
| 275 | 273 | } |
| 276 | 274 | |
@@ -113,8 +113,7 @@ discard block |
||
| 113 | 113 | { |
| 114 | 114 | $userFile = include $this->_userFile; |
| 115 | 115 | $this->loadUserDataFromPhp($userFile); |
| 116 | - } |
|
| 117 | - else |
|
| 116 | + } else |
|
| 118 | 117 | { |
| 119 | 118 | $dom=new TXmlDocument; |
| 120 | 119 | $dom->loadFromFile($this->_userFile); |
@@ -310,8 +309,7 @@ discard block |
||
| 310 | 309 | $user=new TUser($this); |
| 311 | 310 | $user->setIsGuest(true); |
| 312 | 311 | return $user; |
| 313 | - } |
|
| 314 | - else |
|
| 312 | + } else |
|
| 315 | 313 | { |
| 316 | 314 | $username=strtolower($username); |
| 317 | 315 | if(isset($this->_users[$username])) |
@@ -322,8 +320,7 @@ discard block |
||
| 322 | 320 | if(isset($this->_roles[$username])) |
| 323 | 321 | $user->setRoles($this->_roles[$username]); |
| 324 | 322 | return $user; |
| 325 | - } |
|
| 326 | - else |
|
| 323 | + } else |
|
| 327 | 324 | return null; |
| 328 | 325 | } |
| 329 | 326 | } |
@@ -123,8 +123,7 @@ discard block |
||
| 123 | 123 | $user=Prado::createComponent($this->_userClass,$this); |
| 124 | 124 | $user->setIsGuest(true); |
| 125 | 125 | return $user; |
| 126 | - } |
|
| 127 | - else |
|
| 126 | + } else |
|
| 128 | 127 | return $this->_userFactory->createUser($username); |
| 129 | 128 | } |
| 130 | 129 | |
@@ -175,8 +174,7 @@ discard block |
||
| 175 | 174 | return $conn->getDbConnection(); |
| 176 | 175 | else |
| 177 | 176 | throw new TConfigurationException('dbusermanager_connectionid_invalid',$connectionID); |
| 178 | - } |
|
| 179 | - else |
|
| 177 | + } else |
|
| 180 | 178 | throw new TConfigurationException('dbusermanager_connectionid_required'); |
| 181 | 179 | } |
| 182 | 180 | |