HuasoFoundries /
phpPgAdmin6
| 1 | <?php |
||
| 2 | /* |
||
|
0 ignored issues
–
show
Coding Style
introduced
by
Loading history...
|
|||
| 3 | * PHPPgAdmin v6.0.0-beta.30 |
||
| 4 | */ |
||
| 5 | namespace PHPPgAdmin; |
||
| 6 | |||
| 7 | /** |
||
| 8 | * Released under both BSD license and Lesser GPL library license. Whenever |
||
| 9 | * there is any discrepancy between the two licenses, the BSD license will take |
||
| 10 | * precedence. |
||
| 11 | * Set tabs to 4 for best viewing. |
||
| 12 | * Latest version is available at http://php.weblogs.com |
||
| 13 | * Exception-handling code using PHP5 exceptions (try-catch-throw). |
||
| 14 | * |
||
| 15 | * @package PHPPgAdmin |
||
| 16 | * @author John Lim |
||
|
1 ignored issue
–
show
Content of the @author tag must be in the form "Display Name <[email protected]>"
Loading history...
|
|||
| 17 | * @copyright 2000-2013 John Lim <[email protected]> |
||
| 18 | * @copyright 2014 Damien Regad, Mark Newnham and the ADOdb community |
||
| 19 | * @license MIT |
||
|
1 ignored issue
–
show
|
|||
| 20 | * @version Release: 5.20.9 |
||
| 21 | */ |
||
|
2 ignored issues
–
show
|
|||
| 22 | class ADOdbException extends \Exception |
||
| 23 | { |
||
| 24 | public $dbms; |
||
| 25 | public $fn; |
||
| 26 | public $sql = ''; |
||
| 27 | public $params = ''; |
||
| 28 | public $host = ''; |
||
| 29 | public $database = ''; |
||
| 30 | |||
| 31 | public function __construct($dbms, $fn, $errno, $errmsg, $p1, $p2, $thisConnection) |
||
| 32 | { |
||
| 33 | switch ($fn) { |
||
| 34 | case 'EXECUTE': |
||
| 35 | $this->sql = is_array($p1) ? $p1[0] : $p1; |
||
| 36 | $this->params = $p2; |
||
| 37 | $s = "$dbms error: [$errno: $errmsg] in $fn(\"$this->sql\")"; |
||
| 38 | break; |
||
| 39 | |||
| 40 | case 'PCONNECT': |
||
| 41 | case 'CONNECT': |
||
| 42 | $user = $thisConnection->user; |
||
| 43 | $s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)"; |
||
| 44 | break; |
||
| 45 | default: |
||
| 46 | $s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)"; |
||
| 47 | break; |
||
| 48 | } |
||
| 49 | |||
| 50 | $this->dbms = $dbms; |
||
| 51 | if ($thisConnection) { |
||
| 52 | $this->host = $thisConnection->host; |
||
| 53 | $this->database = $thisConnection->database; |
||
| 54 | } |
||
| 55 | $this->fn = $fn; |
||
| 56 | $this->msg = $errmsg; |
||
| 57 | |||
| 58 | if (!is_numeric($errno)) { |
||
| 59 | $errno = -1; |
||
| 60 | } |
||
| 61 | |||
| 62 | parent::__construct($s, $errno); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |