Author: ralfbecker
New Revision: 55188
URL: http://svn.stylite.de/viewvc/egroupware?rev=55188&view=rev
Log:
fix namespaces in Db exceptions
Modified:
trunk/egroupware/api/src/Db.php
— trunk/egroupware/api/src/Db.php (original)
+++ trunk/egroupware/api/src/Db.php Mon Feb 29 14:39:35 2016
@@ -166,7 +166,7 @@
/**
* Callback to check if selected node is healty / should be used
*
-
-
@var callback throwing Api\Db\Exception\Connection, if connected node should NOT be used
-
-
@var callback throwing Db\Exception\Connection, if connected node should NOT be used
*/
static $health_check;
@@ -295,7 +295,7 @@
* @param string $User name of database user (optional)
* @param string $Password password for database user (optional)
* @param string $Type type of database (optional)
-
-
@throws Api\Db\Exception\Connection
-
-
@throws Db\Exception\Connection
-
@return ADOConnection
*/
function connect($Database = NULL, $Host = NULL, $Port = NULL, $User = NULL, $Password = NULL,$Type = NULL)
@@ -346,7 +346,7 @@
//error_log(METHOD."() host=$host, new_connection=$new_connection, this->Type=$this->Type, this->Host=$this->Host, wsrep_local_state=".array2string($state));
return $this->Link_ID;
}
@@ -355,7 +355,7 @@
}
if (!isset($e))
{
-
-
@throws Api\Db\Exception\Connection if node should NOT be used
-
-
@throws Db\Exception\Connection if node should NOT be used
*/
static function galera_cluster_health(Db $db)
{
@@ -385,7 +385,7 @@
$state[‘wsrep_local_state_comment’] == ‘Donor/Desynced’ &&
$state[‘wsrep_cluster_size’] == 2) return;
@@ -422,7 +422,7 @@
*
* @param string $Host host to connect to
* @return ADOConnection
-
-
@throws Api\Db\Exception\Connection
-
-
@throws Db\Exception\Connection
*/
protected function _connect($Host)
{
@@ -499,7 +499,7 @@
{
if (!check_load_extension($php_extension))
{
@@ -512,7 +512,7 @@
$this->Link_ID = ADONewConnection($Type);
if (!$this->Link_ID)
{
@@ -528,7 +528,7 @@
if (!$Ok)
{
$Host = preg_replace(’/password=[^ ]+/’,‘password=$Password’,$Host); // eg. postgres dsn contains password
-
throw new Api\Db\Exception\Connection("ADOdb::$connect($Host, $User, \$Password, $Database) failed.");
-
throw new Db\Exception\Connection("ADOdb::$connect($Host, $User, \$Password, $Database) failed.");
}
if ($this->Debug)
{
@@ -559,7 +559,7 @@
if (!$this->Link_ID->isConnected() && !$this->Link_ID->Connect())
{
$Host = preg_replace(’/password=[^ ]+/’,‘password=$Password’,$Host); // eg. postgres dsn contains password
-
throw new Api\Db\Exception\Connection("ADOdb::$connect($Host, $User, \$Password, $Database) reconnect failed.");
-
throw new Db\Exception\Connection("ADOdb::$connect($Host, $User, \$Password, $Database) reconnect failed.");
}
// fix due to caching and reusing of connection not correctly set $this->Type == 'mysql'
if ($this->Type == 'mysqli')
@@ -720,7 +720,7 @@
* @param int $fetchmode =self::FETCH_BOTH self::FETCH_BOTH (default), self::FETCH_ASSOC or self::FETCH_NUM
* @param boolean $reconnect =true true: try reconnecting if server closes connection, false: dont (mysql only!)
* @return ADORecordSet or false, if the query fails
-
-
@throws Api\Db\Exception\InvalidSql with $this->Link_ID->ErrorNo() as code
-
-
@throws Db\Exception\InvalidSql with $this->Link_ID->ErrorNo() as code
*/
function query($Query_String, $line = ‘’, $file = ‘’, $offset=0, $num_rows=-1, $inputarr=false, $fetchmode=self::FETCH_BOTH, $reconnect=true)
{
@@ -777,7 +777,7 @@
$this->disconnect();
return $this->query($Query_String, $line, $file, $offset, $num_rows, $inputarr, $fetchmode, false);
}
-
throw new Db\Exception\InvalidSql("Invalid SQL: ".(is_array($Query_String)?$Query_String[0]:$Query_String).
"\n$this->Error ($this->Errno)".
($inputarr ? "\nParameters: '".implode("','",$inputarr)."'":''), $this->Errno);
}
@@ -1469,7 +1469,7 @@
if (strpos($key, ‘.’) !== false) list(, $col) = explode(’.’, $key);
if (!isset($column_definitions[$col]))
{
-
throw new Api\Db\Exception\InvalidSql("db::column_data_implode('$glue',".print_r($array,True).",'$use_key',".print_r($only,True).",<pre>".print_r($column_definitions,True)."</pre><b>nothing known about column '$key'!</b>");
-
throw new Db\Exception\InvalidSql("db::column_data_implode('$glue',".print_r($array,True).",'$use_key',".print_r($only,True).",<pre>".print_r($column_definitions,True)."</pre><b>nothing known about column '$key'!</b>");
}
}
$column_type = is_array($column_definitions) ? @$column_definitions[$col]['type'] : False;
@@ -1865,7 +1865,7 @@
{
$ret = $this->Link_ID->UpdateBlob($table,$col,$val,$where_str,$table_def[‘fd’][$col][‘type’] == ‘blob’ ? ‘BLOB’ : ‘CLOB’);
if ($this->Debug) echo “
adodb::UpdateBlob(’$table’,’$col’,’$val’,’$where_str’) = ‘$ret’
\n”;
-
if (!$ret) throw new Api\Db\Exception\InvalidSql("Error in UpdateBlob($table,$col,\$val,$where_str)",$line,$file);
-
if (!$ret) throw new Db\Exception\InvalidSql("Error in UpdateBlob($table,$col,\$val,$where_str)",$line,$file);
}
}
return $ret;
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
eGroupWare-cvs mailing list
eGroupWare-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs