renommage de PEAR en DOLIPEAR

This commit is contained in:
Regis Houssin 2007-08-17 09:04:26 +00:00
parent 4ebb2bc445
commit 1c5df696a7
25 changed files with 402 additions and 402 deletions

View File

@ -952,7 +952,7 @@ class MDB2
* @category Database
* @author Stig Bakken <ssb@fast.no>
*/
class MDB2_Error extends PEAR_Error
class MDB2_Error extends DOLIPEAR_Error
{
// {{{ constructor: function MDB2_Error($code = MDB2_ERROR, $mode = PEAR_ERROR_RETURN, $level = E_USER_NOTICE, $debuginfo = null)
@ -970,7 +970,7 @@ class MDB2_Error extends PEAR_Error
if (is_null($code)) {
$code = MDB2_ERROR;
}
$this->PEAR_Error('MDB2 Error: '.MDB2::errorMessage($code), $code,
$this->DOLIPEAR_Error('MDB2 Error: '.MDB2::errorMessage($code), $code,
$mode, $level, $debuginfo);
}
@ -987,7 +987,7 @@ class MDB2_Error extends PEAR_Error
* @category Database
* @author Lukas Smith <smith@pooteeweet.org>
*/
class MDB2_Driver_Common extends PEAR
class MDB2_Driver_Common extends DOLIPEAR
{
// {{{ Variables (Properties)

View File

@ -99,7 +99,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
{
$types = $this->valid_default_values;
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (!empty($db->options['datatype_map'])) {
@ -144,7 +144,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
foreach ($types as $key => $type) {
if (!isset($this->valid_default_values[$type])) {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (empty($db->options['datatype_map'][$type])) {
@ -208,7 +208,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -234,7 +234,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
return null;
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (!empty($db->options['datatype_map'][$type])) {
@ -267,7 +267,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
continue;
}
$value = $this->convertResult($row[$key], $types[$key], $rtrim);
if (PEAR::isError($value)) {
if (DOLIPEAR::isError($value)) {
return $value;
}
$row[$key] = $value;
@ -337,7 +337,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function getDeclaration($type, $name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -386,7 +386,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function getTypeDeclaration($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -452,13 +452,13 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function _getDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$name = $db->quoteIdentifier($name, true);
$declaration_options = $db->datatype->_getDeclarationOptions($field);
if (PEAR::isError($declaration_options)) {
if (DOLIPEAR::isError($declaration_options)) {
return $declaration_options;
}
return $name.' '.$this->getTypeDeclaration($field).$declaration_options;
@ -499,7 +499,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
if (array_key_exists('default', $field)) {
if ($field['default'] === '') {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (empty($field['notnull'])) {
@ -588,7 +588,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
{
if (!empty($field['unsigned'])) {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -656,7 +656,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function _getCLOBDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -692,7 +692,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function _getBLOBDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -880,7 +880,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
if (!method_exists($this, "_compare{$type}Definition")) {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (!empty($db->options['datatype_map_callback'][$type])) {
@ -1119,7 +1119,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function quote($value, $type = null, $quote = true, $escape_wildcards = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -1223,12 +1223,12 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$value = $db->escape($value, $escape_wildcards);
if (PEAR::isError($value)) {
if (DOLIPEAR::isError($value)) {
return $value;
}
return "'".$value."'";
@ -1259,7 +1259,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
if (is_resource($value)) {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -1293,7 +1293,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function _quoteLOB($value, $quote, $escape_wildcards)
{
$value = $this->_readFile($value);
if (PEAR::isError($value)) {
if (DOLIPEAR::isError($value)) {
return $value;
}
return $this->_quoteText($value, $quote, $escape_wildcards);
@ -1374,7 +1374,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
{
if ($value === 'CURRENT_DATE') {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
@ -1403,7 +1403,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
{
if ($value === 'CURRENT_TIMESTAMP') {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
@ -1432,7 +1432,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
{
if ($value === 'CURRENT_TIME') {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
if (isset($db->function) && is_a($db->function, 'MDB2_Driver_Function_Common')) {
@ -1522,7 +1522,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function writeLOBToFile($lob, $file)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -1691,7 +1691,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function matchPattern($pattern, $operator = null, $field = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -1726,7 +1726,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
$value = strtolower($value);
}
$escaped = $db->escape($value);
if (PEAR::isError($escaped)) {
if (DOLIPEAR::isError($escaped)) {
return $escaped;
}
$match.= $db->escapePattern($escaped);
@ -1770,7 +1770,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function mapNativeDatatype($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -1799,7 +1799,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function _mapNativeDatatype($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -1820,7 +1820,7 @@ class MDB2_Driver_Datatype_Common extends MDB2_Module_Common
function mapPrepareDatatype($type)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -120,7 +120,7 @@ class MDB2_Driver_Datatype_mssql extends MDB2_Driver_Datatype_Common
function getTypeDeclaration($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -203,7 +203,7 @@ class MDB2_Driver_Datatype_mssql extends MDB2_Driver_Datatype_Common
if (array_key_exists('default', $field)) {
if ($field['default'] === '') {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$field['default'] = empty($field['notnull'])
@ -261,7 +261,7 @@ class MDB2_Driver_Datatype_mssql extends MDB2_Driver_Datatype_Common
function _getIntegerDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -315,7 +315,7 @@ class MDB2_Driver_Datatype_mssql extends MDB2_Driver_Datatype_Common
function _getCLOBDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -351,7 +351,7 @@ class MDB2_Driver_Datatype_mssql extends MDB2_Driver_Datatype_Common
function _getBLOBDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -458,7 +458,7 @@ class MDB2_Driver_Datatype_mssql extends MDB2_Driver_Datatype_Common
break;
default:
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,

View File

@ -118,7 +118,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
function getTypeDeclaration($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -221,7 +221,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
function _getIntegerDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -266,7 +266,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
function matchPattern($pattern, $operator = null, $field = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -451,7 +451,7 @@ class MDB2_Driver_Datatype_mysql extends MDB2_Driver_Datatype_Common
break;
default:
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -118,7 +118,7 @@ class MDB2_Driver_Datatype_mysqli extends MDB2_Driver_Datatype_Common
function getTypeDeclaration($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -221,7 +221,7 @@ class MDB2_Driver_Datatype_mysqli extends MDB2_Driver_Datatype_Common
function _getIntegerDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -266,7 +266,7 @@ class MDB2_Driver_Datatype_mysqli extends MDB2_Driver_Datatype_Common
function matchPattern($pattern, $operator = null, $field = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -451,7 +451,7 @@ class MDB2_Driver_Datatype_mysqli extends MDB2_Driver_Datatype_Common
break;
default:
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -479,7 +479,7 @@ class MDB2_Driver_Datatype_mysqli extends MDB2_Driver_Datatype_Common
function mapPrepareDatatype($type)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -119,7 +119,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
function getTypeDeclaration($field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -201,7 +201,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
function _getIntegerDeclaration($name, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -267,11 +267,11 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
}
if (version_compare(PHP_VERSION, '5.2.0RC6', '>=')) {
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$connection = $db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$value = @pg_escape_bytea($connection, $value);
@ -327,7 +327,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
function matchPattern($pattern, $operator = null, $field = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -376,7 +376,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
function patternEscapeString()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
return ' ESCAPE '.$this->quote($db->string_quoting['escape_pattern']);
@ -499,7 +499,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
break;
default:
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
return $db->raiseError(MDB2_ERROR_UNSUPPORTED, null, null,
@ -526,7 +526,7 @@ class MDB2_Driver_Datatype_pgsql extends MDB2_Driver_Datatype_Common
function mapPrepareDatatype($type)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -77,7 +77,7 @@ class MDB2_Driver_Function_Common extends MDB2_Module_Common
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -217,7 +217,7 @@ class MDB2_Driver_Function_Common extends MDB2_Module_Common
function guid()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -76,7 +76,7 @@ class MDB2_Driver_Function_mssql extends MDB2_Driver_Function_Common
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -75,7 +75,7 @@ class MDB2_Driver_Function_mysql extends MDB2_Driver_Function_Common
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -75,7 +75,7 @@ class MDB2_Driver_Function_mysqli extends MDB2_Driver_Function_Common
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -73,7 +73,7 @@ class MDB2_Driver_Function_pgsql extends MDB2_Driver_Function_Common
function &executeStoredProc($name, $params = null, $types = null, $result_class = true, $result_wrap_class = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -84,7 +84,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function getFieldDeclarationList($fields)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -94,7 +94,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
}
foreach ($fields as $field_name => $field) {
$query = $db->getDeclaration($field['type'], $field_name, $field);
if (PEAR::isError($query)) {
if (DOLIPEAR::isError($query)) {
return $query;
}
$query_fields[] = $query;
@ -116,7 +116,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function _fixSequenceName($sqn, $check = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -144,7 +144,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function _fixIndexName($idx)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -169,7 +169,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function createDatabase($database)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -190,7 +190,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function dropDatabase($database)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -212,7 +212,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function _getCreateTableQuery($name, $fields, $options = array())
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -225,7 +225,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
'no fields specified for table "'.$name.'"', __FUNCTION__);
}
$query_fields = $this->getFieldDeclarationList($fields);
if (PEAR::isError($query_fields)) {
if (DOLIPEAR::isError($query_fields)) {
return $query_fields;
}
if (!empty($options['primary'])) {
@ -301,11 +301,11 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function createTable($name, $fields, $options = array())
{
$query = $this->_getCreateTableQuery($name, $fields, $options);
if (PEAR::isError($query)) {
if (DOLIPEAR::isError($query)) {
return $query;
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
return $db->exec($query);
@ -324,7 +324,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function dropTable($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -428,7 +428,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function alterTable($name, $changes, $check)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -448,7 +448,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listDatabases()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -468,7 +468,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listUsers()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -491,7 +491,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listViews($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -512,7 +512,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listTableViews($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -533,7 +533,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listTableTriggers($table = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -553,7 +553,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listFunctions()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -576,7 +576,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listTables($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -597,7 +597,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listTableFields($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -643,7 +643,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function createIndex($table, $name, $definition)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -672,7 +672,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function dropIndex($table, $name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -693,7 +693,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listTableIndexes($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -729,7 +729,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function createConstraint($table, $name, $definition)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$table = $db->quoteIdentifier($table, true);
@ -763,7 +763,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function dropConstraint($table, $name, $primary = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -785,7 +785,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listTableConstraints($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -807,7 +807,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function createSequence($seq_name, $start = 1)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -828,7 +828,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function dropSequence($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -851,7 +851,7 @@ class MDB2_Driver_Manager_Common extends MDB2_Module_Common
function listSequences($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -74,7 +74,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function createDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -101,7 +101,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function dropDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -265,7 +265,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function alterTable($name, $changes, $check)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -331,13 +331,13 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$query = 'EXEC sp_tables @table_type = "\'TABLE\'"';
$table_names = $db->queryCol($query, null, 2);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}
$result = array();
@ -366,19 +366,19 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listTableFields($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$table = $db->quoteIdentifier($table, true);
$db->setLimit(1);
$result2 = $db->query("SELECT * FROM $table");
if (PEAR::isError($result2)) {
if (DOLIPEAR::isError($result2)) {
return $result2;
}
$result = $result2->getColumnNames();
$result2->free();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return array_flip($result);
@ -397,7 +397,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listTableIndexes($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -415,7 +415,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
$table = $db->quote($table, 'text');
$query = "EXEC sp_statistics @table_name=$table";
$indexes = $db->queryCol($query, 'text', $key_name);
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
return $indexes;
}
$query = "EXEC sp_pkeys @table_name=$table";
@ -445,12 +445,12 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listDatabases()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->queryCol('SELECT name FROM sys.databases');
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -471,12 +471,12 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listUsers()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->queryCol('SELECT DISTINCT loginame FROM master..sysprocesses');
if (PEAR::isError($result) || empty($result)) {
if (DOLIPEAR::isError($result) || empty($result)) {
return $result;
}
foreach (array_keys($result) as $k) {
@ -497,7 +497,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listFunctions()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -512,7 +512,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
WHERE ROUTINE_TYPE = 'FUNCTION'
*/
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -537,7 +537,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listTableTriggers($table = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -551,7 +551,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
}
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -577,7 +577,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listViews()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -592,7 +592,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
*/
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -619,7 +619,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function dropIndex($table, $name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -641,7 +641,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listTableConstraints($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$table = $db->quoteIdentifier($table, true);
@ -651,7 +651,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
WHERE c.constraint_catalog = DB_NAME()
AND c.table_name = '$table'";
$constraints = $db->queryCol($query);
if (PEAR::isError($constraints)) {
if (DOLIPEAR::isError($constraints)) {
return $constraints;
}
@ -683,7 +683,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function createSequence($seq_name, $start = 1)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -693,7 +693,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
"INT PRIMARY KEY CLUSTERED IDENTITY($start,1) NOT NULL)";
$res = $db->exec($query);
if (PEAR::isError($res)) {
if (DOLIPEAR::isError($res)) {
return $res;
}
@ -701,12 +701,12 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
"INSERT INTO $sequence_name ($seqcol_name) VALUES ($start)";
$res = $db->exec($query);
if (!PEAR::isError($res)) {
if (!DOLIPEAR::isError($res)) {
return MDB2_OK;
}
$result = $db->exec("DROP TABLE $sequence_name");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $db->raiseError($result, null, null,
'could not drop inconsistent sequence table', __FUNCTION__);
}
@ -728,7 +728,7 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function dropSequence($seq_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -748,13 +748,13 @@ class MDB2_Driver_Manager_mssql extends MDB2_Driver_Manager_Common
function listSequences()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$query = "SELECT name FROM sysobjects WHERE xtype = 'U'";
$table_names = $db->queryCol($query);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}
$result = array();

View File

@ -71,14 +71,14 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function createDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$name = $db->quoteIdentifier($name, true);
$query = "CREATE DATABASE $name";
$result = $db->exec($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return MDB2_OK;
@ -97,14 +97,14 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function dropDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$name = $db->quoteIdentifier($name, true);
$query = "DROP DATABASE $name";
$result = $db->exec($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return MDB2_OK;
@ -151,12 +151,12 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function createTable($name, $fields, $options = array())
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$query = $this->_getCreateTableQuery($name, $fields, $options);
if (PEAR::isError($query)) {
if (DOLIPEAR::isError($query)) {
return $query;
}
@ -285,7 +285,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function alterTable($name, $changes, $check)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -386,12 +386,12 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listDatabases()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->queryCol('SHOW DATABASES');
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -412,7 +412,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listUsers()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -431,7 +431,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listFunctions()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -442,7 +442,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
WHERE ROUTINE_TYPE = 'FUNCTION'
*/
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -464,7 +464,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listTableTriggers($table = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -474,7 +474,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$query .= " LIKE $table";
}
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -496,7 +496,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listTables($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -507,7 +507,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$query.= "/*!50002 WHERE Table_type = 'BASE TABLE'*/";
$table_names = $db->queryAll($query, null, MDB2_FETCHMODE_ORDERED);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}
@ -536,7 +536,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listViews($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -547,7 +547,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$query.= " WHERE Table_type = 'VIEW'";
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -570,13 +570,13 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listTableFields($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$table = $db->quoteIdentifier($table, true);
$result = $db->queryCol("SHOW COLUMNS FROM $table");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -625,7 +625,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function createIndex($table, $name, $definition)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -658,7 +658,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function dropIndex($table, $name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -680,7 +680,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listTableIndexes($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -699,7 +699,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$table = $db->quoteIdentifier($table, true);
$query = "SHOW INDEX FROM $table";
$indexes = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
return $indexes;
}
@ -744,7 +744,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function createConstraint($table, $name, $definition)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -786,7 +786,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function dropConstraint($table, $name, $primary = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -813,7 +813,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listTableConstraints($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -832,7 +832,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$table = $db->quoteIdentifier($table, true);
$query = "SHOW INDEX FROM $table";
$indexes = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
return $indexes;
}
@ -877,7 +877,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function createSequence($seq_name, $start = 1, $options = array())
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -913,7 +913,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
}
$res = $db->exec($query);
if (PEAR::isError($res)) {
if (DOLIPEAR::isError($res)) {
return $res;
}
@ -923,13 +923,13 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$query = "INSERT INTO $sequence_name ($seqcol_name) VALUES (".($start-1).')';
$res = $db->exec($query);
if (!PEAR::isError($res)) {
if (!DOLIPEAR::isError($res)) {
return MDB2_OK;
}
// Handle error
$result = $db->exec("DROP TABLE $sequence_name");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $db->raiseError($result, null, null,
'could not drop inconsistent sequence table', __FUNCTION__);
}
@ -951,7 +951,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function dropSequence($seq_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -972,7 +972,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
function listSequences($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -981,7 +981,7 @@ class MDB2_Driver_Manager_mysql extends MDB2_Driver_Manager_Common
$query .= " FROM $database";
}
$table_names = $db->queryCol($query);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}

View File

@ -71,14 +71,14 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function createDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$name = $db->quoteIdentifier($name, true);
$query = "CREATE DATABASE $name";
$result = $db->exec($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return MDB2_OK;
@ -97,14 +97,14 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function dropDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$name = $db->quoteIdentifier($name, true);
$query = "DROP DATABASE $name";
$result = $db->exec($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return MDB2_OK;
@ -151,12 +151,12 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function createTable($name, $fields, $options = array())
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$query = $this->_getCreateTableQuery($name, $fields, $options);
if (PEAR::isError($query)) {
if (DOLIPEAR::isError($query)) {
return $query;
}
@ -285,7 +285,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function alterTable($name, $changes, $check)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -386,12 +386,12 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listDatabases()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->queryCol('SHOW DATABASES');
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -412,7 +412,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listUsers()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -431,7 +431,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listFunctions()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -442,7 +442,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
WHERE ROUTINE_TYPE = 'FUNCTION'
*/
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -464,7 +464,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listTableTriggers($table = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -474,7 +474,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$query .= " LIKE $table";
}
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -496,7 +496,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listTables($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -507,7 +507,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$query.= "/*!50002 WHERE Table_type = 'BASE TABLE'*/";
$table_names = $db->queryAll($query, null, MDB2_FETCHMODE_ORDERED);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}
@ -536,7 +536,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listViews($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -547,7 +547,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$query.= " WHERE Table_type = 'VIEW'";
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -570,13 +570,13 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listTableFields($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$table = $db->quoteIdentifier($table, true);
$result = $db->queryCol("SHOW COLUMNS FROM $table");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -625,7 +625,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function createIndex($table, $name, $definition)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -658,7 +658,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function dropIndex($table, $name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -680,7 +680,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listTableIndexes($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -699,7 +699,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$table = $db->quoteIdentifier($table, true);
$query = "SHOW INDEX FROM $table";
$indexes = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
return $indexes;
}
@ -744,7 +744,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function createConstraint($table, $name, $definition)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -786,7 +786,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function dropConstraint($table, $name, $primary = false)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -813,7 +813,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listTableConstraints($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -832,7 +832,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$table = $db->quoteIdentifier($table, true);
$query = "SHOW INDEX FROM $table";
$indexes = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
return $indexes;
}
@ -877,7 +877,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function createSequence($seq_name, $start = 1, $options = array())
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -916,7 +916,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$query .= ' '.implode(' ', $options_strings);
}
$res = $db->exec($query);
if (PEAR::isError($res)) {
if (DOLIPEAR::isError($res)) {
return $res;
}
@ -926,13 +926,13 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$query = "INSERT INTO $sequence_name ($seqcol_name) VALUES (".($start-1).')';
$res = $db->exec($query);
if (!PEAR::isError($res)) {
if (!DOLIPEAR::isError($res)) {
return MDB2_OK;
}
// Handle error
$result = $db->exec("DROP TABLE $sequence_name");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $db->raiseError($result, null, null,
'could not drop inconsistent sequence table', __FUNCTION__);
}
@ -954,7 +954,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function dropSequence($seq_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -975,7 +975,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
function listSequences($database = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -984,7 +984,7 @@ class MDB2_Driver_Manager_mysqli extends MDB2_Driver_Manager_Common
$query .= " FROM $database";
}
$table_names = $db->queryCol($query);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}

View File

@ -68,7 +68,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function createDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -89,7 +89,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function dropDatabase($name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -193,7 +193,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function alterTable($name, $changes, $check)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -219,7 +219,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
foreach ($changes['add'] as $field_name => $field) {
$query = 'ADD ' . $db->getDeclaration($field['type'], $field_name, $field);
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -230,7 +230,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$field_name = $db->quoteIdentifier($field_name, true);
$query = 'DROP ' . $field_name;
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -241,7 +241,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$field_name = $db->quoteIdentifier($field_name, true);
if (!empty($field['type'])) {
$server_info = $db->getServerVersion();
if (PEAR::isError($server_info)) {
if (DOLIPEAR::isError($server_info)) {
return $server_info;
}
if (is_array($server_info) && $server_info['major'] < 8) {
@ -251,21 +251,21 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$db->loadModule('Datatype', null, true);
$query = "ALTER $field_name TYPE ".$db->datatype->getTypeDeclaration($field['definition']);
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
if (array_key_exists('default', $field)) {
$query = "ALTER $field_name SET DEFAULT ".$db->quote($field['definition']['default'], $field['definition']['type']);
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
if (!empty($field['notnull'])) {
$query = "ALTER $field_name ".($field['definition']['notnull'] ? "SET" : "DROP").' NOT NULL';
$result = $db->exec("ALTER TABLE $name $query");
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -276,7 +276,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
foreach ($changes['rename'] as $field_name => $field) {
$field_name = $db->quoteIdentifier($field_name, true);
$result = $db->exec("ALTER TABLE $name RENAME COLUMN $field_name TO ".$db->quoteIdentifier($field['name'], true));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -286,7 +286,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
if (!empty($changes['name'])) {
$change_name = $db->quoteIdentifier($changes['name'], true);
$result = $db->exec("ALTER TABLE $name RENAME TO ".$change_name);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -306,7 +306,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listDatabases()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -318,7 +318,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$result = $result2->fetchCol();
$result2->free();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -339,7 +339,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listUsers()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -366,7 +366,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listViews()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -375,7 +375,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
WHERE schemaname NOT IN ('pg_catalog', 'information_schema')
AND viewname !~ '^pg_'";
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -397,14 +397,14 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listTableViews($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$query = 'SELECT viewname FROM pg_views NATURAL JOIN pg_tables';
$query.= ' WHERE tablename ='.$db->quote($table, 'text');
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -425,7 +425,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listFunctions()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -442,7 +442,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
AND pr.pronamespace IN
(SELECT oid FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema')";
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -464,7 +464,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listTableTriggers($table = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -477,7 +477,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$query .= " AND tbl.relname = $table";
}
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -498,7 +498,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listTables()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -523,7 +523,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
. ' WHERE usesysid = c.relowner)'
. " AND c.relname !~ '^pg_'";
$result = $db->queryCol($query);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {
@ -545,19 +545,19 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listTableFields($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$table = $db->quoteIdentifier($table, true);
$db->setLimit(1);
$result2 = $db->query("SELECT * FROM $table");
if (PEAR::isError($result2)) {
if (DOLIPEAR::isError($result2)) {
return $result2;
}
$result = $result2->getColumnNames();
$result2->free();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return array_flip($result);
@ -576,7 +576,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listTableIndexes($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -585,7 +585,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$subquery.= " WHERE pg_class.relname=$table AND pg_class.oid=pg_index.indrelid AND indisunique != 't' AND indisprimary != 't'";
$query = "SELECT relname FROM pg_class WHERE oid IN ($subquery)";
$indexes = $db->queryCol($query, 'text');
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
return $indexes;
}
@ -616,7 +616,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listTableConstraints($table)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -625,7 +625,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
$subquery.= " WHERE pg_class.relname=$table AND pg_class.oid=pg_index.indrelid AND (indisunique = 't' OR indisprimary = 't')";
$query = "SELECT relname FROM pg_class WHERE oid IN ($subquery)";
$constraints = $db->queryCol($query);
if (PEAR::isError($constraints)) {
if (DOLIPEAR::isError($constraints)) {
return $constraints;
}
@ -659,7 +659,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function createSequence($seq_name, $start = 1)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -681,7 +681,7 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function dropSequence($seq_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -701,14 +701,14 @@ class MDB2_Driver_Manager_pgsql extends MDB2_Driver_Manager_Common
function listSequences()
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$query = "SELECT relname FROM pg_class WHERE relkind = 'S' AND relnamespace IN";
$query.= "(SELECT oid FROM pg_namespace WHERE nspname NOT LIKE 'pg_%' AND nspname != 'information_schema')";
$table_names = $db->queryCol($query);
if (PEAR::isError($table_names)) {
if (DOLIPEAR::isError($table_names)) {
return $table_names;
}
$result = array();

View File

@ -86,7 +86,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
function getTableFieldDefinition($table, $field)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -120,7 +120,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
function getTableIndexDefinition($table, $index)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -155,7 +155,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
function getTableConstraintDefinition($table, $index)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -182,12 +182,12 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
function getSequenceDefinition($sequence)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$start = $db->currId($sequence);
if (PEAR::isError($start)) {
if (DOLIPEAR::isError($start)) {
return $start;
}
if ($db->supports('current_id')) {
@ -235,7 +235,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
function getTriggerDefinition($trigger)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -369,7 +369,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
function tableInfo($result, $mode = null)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -380,7 +380,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
$db->loadModule('Manager', null, true);
$fields = $db->manager->listTableFields($result);
if (PEAR::isError($fields)) {
if (DOLIPEAR::isError($fields)) {
return $fields;
}
@ -390,14 +390,14 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
$db->setOption('idxname_format', '%s');
$indexes = $db->manager->listTableIndexes($result);
if (PEAR::isError($indexes)) {
if (DOLIPEAR::isError($indexes)) {
$db->setOption('idxname_format', $idxname_format);
return $indexes;
}
foreach ($indexes as $index) {
$definition = $this->getTableIndexDefinition($result, $index);
if (PEAR::isError($definition)) {
if (DOLIPEAR::isError($definition)) {
$db->setOption('idxname_format', $idxname_format);
return $definition;
}
@ -409,13 +409,13 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
}
$constraints = $db->manager->listTableConstraints($result);
if (PEAR::isError($constraints)) {
if (DOLIPEAR::isError($constraints)) {
return $constraints;
}
foreach ($constraints as $constraint) {
$definition = $this->getTableConstraintDefinition($result, $constraint);
if (PEAR::isError($definition)) {
if (DOLIPEAR::isError($definition)) {
$db->setOption('idxname_format', $idxname_format);
return $definition;
}
@ -437,7 +437,7 @@ class MDB2_Driver_Reverse_Common extends MDB2_Module_Common
foreach ($fields as $i => $field) {
$definition = $this->getTableFieldDefinition($result, $field);
if (PEAR::isError($definition)) {
if (DOLIPEAR::isError($definition)) {
$db->setOption('idxname_format', $idxname_format);
return $definition;
}

View File

@ -72,12 +72,12 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
function getTableFieldDefinition($table, $field_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->loadModule('Datatype', null, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$table = $db->quoteIdentifier($table, true);
@ -100,7 +100,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
AND c.column_name = '$fldname'
ORDER BY t.table_name";
$column = $db->queryRow($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($column)) {
if (DOLIPEAR::isError($column)) {
return $column;
}
if (empty($column)) {
@ -118,7 +118,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
$column = array_change_key_case($column, $db->options['field_case']);
}
$mapped_datatype = $db->datatype->mapNativeDatatype($column);
if (PEAR::IsError($mapped_datatype)) {
if (DOLIPEAR::IsError($mapped_datatype)) {
return $mapped_datatype;
}
list($types, $length, $unsigned, $fixed) = $mapped_datatype;
@ -183,7 +183,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
function getTableIndexDefinition($table, $index_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -211,13 +211,13 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
$index_name_mdb2 = $db->getIndexName($index_name);
$result = $db->queryRow(sprintf($query, $index_name_mdb2));
if (!PEAR::isError($result) && !is_null($result)) {
if (!DOLIPEAR::isError($result) && !is_null($result)) {
// apply 'idxname_format' only if the query succeeded, otherwise
// fallback to the given $index_name, without transformation
$index_name = $index_name_mdb2;
}
$result = $db->query(sprintf($query, $index_name));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -261,7 +261,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
function getTableConstraintDefinition($table, $constraint_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -286,13 +286,13 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
$constraint_name_mdb2 = $db->getIndexName($constraint_name);
$result = $db->queryRow(sprintf($query, $constraint_name_mdb2));
if (!PEAR::isError($result) && !is_null($result)) {
if (!DOLIPEAR::isError($result) && !is_null($result)) {
// apply 'idxname_format' only if the query succeeded, otherwise
// fallback to the given $index_name, without transformation
$constraint_name = $constraint_name_mdb2;
}
$result = $db->query(sprintf($query, $constraint_name));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -346,7 +346,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
function getTriggerDefinition($trigger)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -388,11 +388,11 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
);
$def = $db->queryRow($query, $types, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($def)) {
if (DOLIPEAR::isError($def)) {
return $def;
}
$trg_body = $db->queryCol('EXEC sp_helptext '. $db->quote($trigger, 'text'), 'text');
if (!PEAR::isError($trg_body)) {
if (!DOLIPEAR::isError($trg_body)) {
$def['trigger_body'] = implode('', $trg_body);
}
return $def;
@ -426,7 +426,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -463,7 +463,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
'flags' => '',
);
$mdb2type_info = $db->datatype->mapNativeDatatype($res[$i]);
if (PEAR::isError($mdb2type_info)) {
if (DOLIPEAR::isError($mdb2type_info)) {
return $mdb2type_info;
}
$res[$i]['mdb2type'] = $mdb2type_info[0][0];
@ -504,7 +504,7 @@ class MDB2_Driver_Reverse_mssql extends MDB2_Driver_Reverse_Common
function _mssql_field_flags($table, $column)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}

View File

@ -71,18 +71,18 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
function getTableFieldDefinition($table, $field_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->loadModule('Datatype', null, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$table = $db->quoteIdentifier($table, true);
$query = "SHOW COLUMNS FROM $table LIKE ".$db->quote($field_name);
$columns = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($columns)) {
if (DOLIPEAR::isError($columns)) {
return $columns;
}
foreach ($columns as $column) {
@ -100,7 +100,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
}
if ($field_name == $column['name']) {
$mapped_datatype = $db->datatype->mapNativeDatatype($column);
if (PEAR::IsError($mapped_datatype)) {
if (DOLIPEAR::IsError($mapped_datatype)) {
return $mapped_datatype;
}
list($types, $length, $unsigned, $fixed) = $mapped_datatype;
@ -169,7 +169,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
function getTableIndexDefinition($table, $constraint_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -177,13 +177,13 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
$query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = %s */";
$constraint_name_mdb2 = $db->getIndexName($constraint_name);
$result = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2)));
if (!PEAR::isError($result) && !is_null($result)) {
if (!DOLIPEAR::isError($result) && !is_null($result)) {
// apply 'idxname_format' only if the query succeeded, otherwise
// fallback to the given $index_name, without transformation
$constraint_name = $constraint_name_mdb2;
}
$result = $db->query(sprintf($query, $db->quote($constraint_name)));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$colpos = 1;
@ -242,7 +242,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
function getTableConstraintDefinition($table, $index_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -251,14 +251,14 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
if (strtolower($index_name) != 'primary') {
$index_name_mdb2 = $db->getIndexName($index_name);
$result = $db->queryRow(sprintf($query, $db->quote($index_name_mdb2)));
if (!PEAR::isError($result) && !is_null($result)) {
if (!DOLIPEAR::isError($result) && !is_null($result)) {
// apply 'idxname_format' only if the query succeeded, otherwise
// fallback to the given $index_name, without transformation
$index_name = $index_name_mdb2;
}
}
$result = $db->query(sprintf($query, $db->quote($index_name)));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$colpos = 1;
@ -326,7 +326,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
function getTriggerDefinition($trigger)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -345,7 +345,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
'trigger_event' => 'text',
);
$def = $db->queryRow($query, $types, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($def)) {
if (DOLIPEAR::isError($def)) {
return $def;
}
$def['trigger_comment'] = '';
@ -378,7 +378,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -420,7 +420,7 @@ class MDB2_Driver_Reverse_mysql extends MDB2_Driver_Reverse_Common
$res[$i]['type'] = 'decimal';
}
$mdb2type_info = $db->datatype->mapNativeDatatype($res[$i]);
if (PEAR::isError($mdb2type_info)) {
if (DOLIPEAR::isError($mdb2type_info)) {
return $mdb2type_info;
}
$res[$i]['mdb2type'] = $mdb2type_info[0][0];

View File

@ -125,18 +125,18 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
function getTableFieldDefinition($table, $field_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->loadModule('Datatype', null, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$table = $db->quoteIdentifier($table, true);
$query = "SHOW COLUMNS FROM $table LIKE ".$db->quote($field_name);
$columns = $db->queryAll($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($columns)) {
if (DOLIPEAR::isError($columns)) {
return $columns;
}
foreach ($columns as $column) {
@ -154,7 +154,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
}
if ($field_name == $column['name']) {
$mapped_datatype = $db->datatype->mapNativeDatatype($column);
if (PEAR::IsError($mapped_datatype)) {
if (DOLIPEAR::IsError($mapped_datatype)) {
return $mapped_datatype;
}
list($types, $length, $unsigned, $fixed) = $mapped_datatype;
@ -223,7 +223,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
function getTableIndexDefinition($table, $index_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -231,13 +231,13 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
$query = "SHOW INDEX FROM $table /*!50002 WHERE Key_name = %s */";
$index_name_mdb2 = $db->getIndexName($index_name);
$result = $db->queryRow(sprintf($query, $db->quote($index_name_mdb2)));
if (!PEAR::isError($result) && !is_null($result)) {
if (!DOLIPEAR::isError($result) && !is_null($result)) {
// apply 'idxname_format' only if the query succeeded, otherwise
// fallback to the given $index_name, without transformation
$index_name = $index_name_mdb2;
}
$result = $db->query(sprintf($query, $db->quote($index_name)));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$colpos = 1;
@ -296,7 +296,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
function getTableConstraintDefinition($table, $constraint_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -305,14 +305,14 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
if (strtolower($constraint_name) != 'primary') {
$constraint_name_mdb2 = $db->getIndexName($constraint_name);
$result = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2)));
if (!PEAR::isError($result) && !is_null($result)) {
if (!DOLIPEAR::isError($result) && !is_null($result)) {
// apply 'idxname_format' only if the query succeeded, otherwise
// fallback to the given $index_name, without transformation
$constraint_name = $constraint_name_mdb2;
}
}
$result = $db->query(sprintf($query, $db->quote($constraint_name)));
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$colpos = 1;
@ -380,7 +380,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
function getTriggerDefinition($trigger)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -399,7 +399,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
'trigger_event' => 'text',
);
$def = $db->queryRow($query, $types, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($def)) {
if (DOLIPEAR::isError($def)) {
return $def;
}
$def['trigger_comment'] = '';
@ -432,7 +432,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -483,7 +483,7 @@ class MDB2_Driver_Reverse_mysqli extends MDB2_Driver_Reverse_Common
'flags' => $flags,
);
$mdb2type_info = $db->datatype->mapNativeDatatype($res[$i]);
if (PEAR::isError($mdb2type_info)) {
if (DOLIPEAR::isError($mdb2type_info)) {
return $mdb2type_info;
}
$res[$i]['mdb2type'] = $mdb2type_info[0][0];

View File

@ -70,12 +70,12 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
function getTableFieldDefinition($table, $field_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
$result = $db->loadModule('Datatype', null, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -120,7 +120,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
AND a.attname = ".$db->quote($field_name, 'text')."
ORDER BY a.attnum";
$column = $db->queryRow($query, null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($column)) {
if (DOLIPEAR::isError($column)) {
return $column;
}
@ -131,7 +131,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
$column = array_change_key_case($column, CASE_LOWER);
$mapped_datatype = $db->datatype->mapNativeDatatype($column);
if (PEAR::IsError($mapped_datatype)) {
if (DOLIPEAR::IsError($mapped_datatype)) {
return $mapped_datatype;
}
list($types, $length, $unsigned, $fixed) = $mapped_datatype;
@ -192,7 +192,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
function getTableIndexDefinition($table, $index_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -202,11 +202,11 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
$query.= ' AND pg_class.relname = %s';
$index_name_mdb2 = $db->getIndexName($index_name);
$row = $db->queryRow(sprintf($query, $db->quote($index_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($row) || empty($row)) {
if (DOLIPEAR::isError($row) || empty($row)) {
// fallback to the given $index_name, without transformation
$row = $db->queryRow(sprintf($query, $db->quote($index_name, 'text')), null, MDB2_FETCHMODE_ASSOC);
}
if (PEAR::isError($row)) {
if (DOLIPEAR::isError($row)) {
return $row;
}
@ -247,7 +247,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
function getTableConstraintDefinition($table, $constraint_name)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -257,11 +257,11 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
$query.= ' AND pg_class.relname = %s';
$constraint_name_mdb2 = $db->getIndexName($constraint_name);
$row = $db->queryRow(sprintf($query, $db->quote($constraint_name_mdb2, 'text')), null, MDB2_FETCHMODE_ASSOC);
if (PEAR::isError($row) || empty($row)) {
if (DOLIPEAR::isError($row) || empty($row)) {
// fallback to the given $index_name, without transformation
$row = $db->queryRow(sprintf($query, $db->quote($constraint_name, 'text')), null, MDB2_FETCHMODE_ASSOC);
}
if (PEAR::isError($row)) {
if (DOLIPEAR::isError($row)) {
return $row;
}
@ -314,7 +314,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
function getTriggerDefinition($trigger)
{
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -385,7 +385,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
}
$db =& $this->getDBInstance();
if (PEAR::isError($db)) {
if (DOLIPEAR::isError($db)) {
return $db;
}
@ -422,7 +422,7 @@ class MDB2_Driver_Reverse_pgsql extends MDB2_Driver_Reverse_Common
'flags' => '',
);
$mdb2type_info = $db->datatype->mapNativeDatatype($res[$i]);
if (PEAR::isError($mdb2type_info)) {
if (DOLIPEAR::isError($mdb2type_info)) {
return $mdb2type_info;
}
$res[$i]['mdb2type'] = $mdb2type_info[0][0];

View File

@ -218,7 +218,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
register_shutdown_function('MDB2_closeOpenTransactions');
}
$result =& $this->_doQuery('BEGIN TRANSACTION', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = true;
@ -251,7 +251,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
}
$result =& $this->_doQuery('COMMIT TRANSACTION', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = false;
@ -285,7 +285,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
}
$result =& $this->_doQuery('ROLLBACK TRANSACTION', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = false;
@ -311,7 +311,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
$this->disconnect(false);
}
if (!PEAR::loadExtension($this->phptype)) {
if (!DOLIPEAR::loadExtension($this->phptype)) {
return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'extension '.$this->phptype.' is not compiled into PHP', __FUNCTION__);
}
@ -335,7 +335,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
if (!empty($this->dsn['charset'])) {
$result = $this->setCharset($this->dsn['charset'], $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -420,7 +420,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
$this->last_query = $query;
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -432,7 +432,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -477,7 +477,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -525,13 +525,13 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
} else {
$query = 'SELECT @@VERSION';
$server_info = $this->queryOne($query, 'text');
if (PEAR::isError($server_info)) {
if (DOLIPEAR::isError($server_info)) {
return $server_info;
}
}
// cache server_info
$this->connected_server_info = $server_info;
if (!$native && !PEAR::isError($server_info)) {
if (!$native && !DOLIPEAR::isError($server_info)) {
if (preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)/', $server_info, $tmp)) {
$server_info = array(
'major' => $tmp[1],
@ -566,7 +566,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
{
$query = "SELECT * FROM $seq_name";
$tableExists =& $this->_doQuery($query, true);
if (PEAR::isError($tableExists)) {
if (DOLIPEAR::isError($tableExists)) {
if ($tableExists->getCode() == MDB2_ERROR_NOSUCHTABLE) {
return false;
}
@ -606,11 +606,11 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
}
$result =& $this->_doQuery($query, true);
$this->popExpect();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
if ($ondemand && !$this->_checkSequence($sequence_name)) {
$this->loadModule('Manager', null, true);
$result = $this->manager->createSequence($seq_name);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $this->raiseError($result, null, null,
'on demand sequence '.$seq_name.' could not be created', __FUNCTION__);
} else {
@ -623,7 +623,7 @@ class MDB2_Driver_mssql extends MDB2_Driver_Common
if (is_numeric($value)) {
$query = "DELETE FROM $sequence_name WHERE $seqcol_name < $value";
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
$this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
}
}
@ -714,7 +714,7 @@ class MDB2_Result_mssql extends MDB2_Result_Common
}
if (!is_null($rownum)) {
$seek = $this->seek($rownum);
if (PEAR::isError($seek)) {
if (DOLIPEAR::isError($seek)) {
return $seek;
}
}
@ -778,7 +778,7 @@ class MDB2_Result_mssql extends MDB2_Result_Common
{
$columns = array();
$numcols = $this->numCols();
if (PEAR::isError($numcols)) {
if (DOLIPEAR::isError($numcols)) {
return $numcols;
}
for ($column = 0; $column < $numcols; $column++) {
@ -906,7 +906,7 @@ class MDB2_BufferedResult_mssql extends MDB2_Result_mssql
function valid()
{
$numrows = $this->numRows();
if (PEAR::isError($numrows)) {
if (DOLIPEAR::isError($numrows)) {
return $numrows;
}
return $this->rownum < ($numrows - 1);

View File

@ -193,7 +193,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
$text = $this->escapePattern($text);
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$text = @mysql_real_escape_string($text, $connection);
@ -235,7 +235,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
}
$query = $this->start_transaction ? 'START TRANSACTION' : 'SET AUTOCOMMIT = 1';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = true;
@ -282,13 +282,13 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
}
$result =& $this->_doQuery('COMMIT', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if (!$this->start_transaction) {
$query = 'SET AUTOCOMMIT = 0';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -328,13 +328,13 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
$query = 'ROLLBACK';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if (!$this->start_transaction) {
$query = 'SET AUTOCOMMIT = 0';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -400,7 +400,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
$this->disconnect(false);
}
if (!PEAR::loadExtension($this->phptype)) {
if (!DOLIPEAR::loadExtension($this->phptype)) {
return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'extension '.$this->phptype.' is not compiled into PHP', __FUNCTION__);
}
@ -445,7 +445,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
if (!empty($this->dsn['charset'])) {
$result = $this->setCharset($this->dsn['charset'], $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -508,7 +508,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -568,7 +568,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
$this->last_query = $query;
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -580,7 +580,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -627,7 +627,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -701,7 +701,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
function getServerVersion($native = false)
{
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
if ($this->connected_server_info) {
@ -846,7 +846,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
$query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
$result = $this->debug($query, __FUNCTION__, array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -873,7 +873,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
}
$new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
if (PEAR::isError($new_pos)) {
if (DOLIPEAR::isError($new_pos)) {
return $new_pos;
}
if ($new_pos != $position) {
@ -910,13 +910,13 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
}
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$statement_name = sprintf($this->options['statement_format'], $this->phptype, md5(time() + rand()));
$query = "PREPARE $statement_name FROM ".$this->quote($query, 'text');
$statement =& $this->_doQuery($query, true, $connection);
if (PEAR::isError($statement)) {
if (DOLIPEAR::isError($statement)) {
return $statement;
}
@ -1026,13 +1026,13 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$query = "REPLACE INTO $table ($query) VALUES ($values)";
$result =& $this->_doQuery($query, true, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return $this->_affectedRows($connection, $result);
@ -1060,11 +1060,11 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
$this->expectError(MDB2_ERROR_NOSUCHTABLE);
$result =& $this->_doQuery($query, true);
$this->popExpect();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) {
$this->loadModule('Manager', null, true);
$result = $this->manager->createSequence($seq_name);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $this->raiseError($result, null, null,
'on demand sequence '.$seq_name.' could not be created', __FUNCTION__);
} else {
@ -1077,7 +1077,7 @@ class MDB2_Driver_mysql extends MDB2_Driver_Common
if (is_numeric($value)) {
$query = "DELETE FROM $sequence_name WHERE $seqcol_name < $value";
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
$this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
}
}
@ -1145,7 +1145,7 @@ class MDB2_Result_mysql extends MDB2_Result_Common
{
if (!is_null($rownum)) {
$seek = $this->seek($rownum);
if (PEAR::isError($seek)) {
if (DOLIPEAR::isError($seek)) {
return $seek;
}
}
@ -1210,7 +1210,7 @@ class MDB2_Result_mysql extends MDB2_Result_Common
{
$columns = array();
$numcols = $this->numCols();
if (PEAR::isError($numcols)) {
if (DOLIPEAR::isError($numcols)) {
return $numcols;
}
for ($column = 0; $column < $numcols; $column++) {
@ -1319,7 +1319,7 @@ class MDB2_BufferedResult_mysql extends MDB2_Result_mysql
function valid()
{
$numrows = $this->numRows();
if (PEAR::isError($numrows)) {
if (DOLIPEAR::isError($numrows)) {
return $numrows;
}
return $this->rownum < ($numrows - 1);
@ -1384,7 +1384,7 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
}
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -1418,12 +1418,12 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
}
}
$quoted = $this->db->quote($value, $type);
if (PEAR::isError($quoted)) {
if (DOLIPEAR::isError($quoted)) {
return $quoted;
}
$param_query = 'SET @'.$parameter.' = '.$quoted;
$result = $this->db->_doQuery($param_query, true, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -1431,7 +1431,7 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
}
$result = $this->db->_doQuery($query, $this->is_manip, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -1465,7 +1465,7 @@ class MDB2_Statement_mysql extends MDB2_Statement_Common
if (!is_null($this->statement)) {
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$query = 'DEALLOCATE PREPARE '.$this->statement;

View File

@ -194,7 +194,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$text = $this->escapePattern($text);
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$text = @mysqli_real_escape_string($connection, $text);
@ -232,7 +232,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
}
$query = $this->start_transaction ? 'START TRANSACTION' : 'SET AUTOCOMMIT = 1';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = true;
@ -279,13 +279,13 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
}
$result =& $this->_doQuery('COMMIT', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if (!$this->start_transaction) {
$query = 'SET AUTOCOMMIT = 0';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -325,13 +325,13 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$query = 'ROLLBACK';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
if (!$this->start_transaction) {
$query = 'SET AUTOCOMMIT = 0';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -394,7 +394,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$this->connection = 0;
}
if (!PEAR::loadExtension($this->phptype)) {
if (!DOLIPEAR::loadExtension($this->phptype)) {
return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'extension '.$this->phptype.' is not compiled into PHP', __FUNCTION__);
}
@ -443,7 +443,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
if (!empty($this->dsn['charset'])) {
$result = $this->setCharset($this->dsn['charset'], $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -494,7 +494,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -554,7 +554,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$this->last_query = $query;
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -566,7 +566,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -631,7 +631,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -705,7 +705,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
function getServerVersion($native = false)
{
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
if ($this->connected_server_info) {
@ -850,7 +850,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$query = $this->_modifyQuery($query, $is_manip, $limit, $offset);
$result = $this->debug($query, __FUNCTION__, array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -877,7 +877,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
}
$new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
if (PEAR::isError($new_pos)) {
if (DOLIPEAR::isError($new_pos)) {
return $new_pos;
}
if ($new_pos != $position) {
@ -914,7 +914,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
}
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -923,7 +923,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$query = "PREPARE $statement_name FROM ".$this->quote($query, 'text');
$statement =& $this->_doQuery($query, true, $connection);
if (PEAR::isError($statement)) {
if (DOLIPEAR::isError($statement)) {
return $statement;
}
$statement = $statement_name;
@ -1042,13 +1042,13 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$query = "REPLACE INTO $table ($query) VALUES ($values)";
$result =& $this->_doQuery($query, true, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
return $this->_affectedRows($connection, $result);
@ -1076,11 +1076,11 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
$this->expectError(MDB2_ERROR_NOSUCHTABLE);
$result =& $this->_doQuery($query, true);
$this->popExpect();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) {
$this->loadModule('Manager', null, true);
$result = $this->manager->createSequence($seq_name);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $this->raiseError($result, null, null,
'on demand sequence '.$seq_name.' could not be created', __FUNCTION__);
} else {
@ -1093,7 +1093,7 @@ class MDB2_Driver_mysqli extends MDB2_Driver_Common
if (is_numeric($value)) {
$query = "DELETE FROM $sequence_name WHERE $seqcol_name < $value";
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
$this->warnings[] = 'nextID: could not delete previous sequence table values from '.$seq_name;
}
}
@ -1161,7 +1161,7 @@ class MDB2_Result_mysqli extends MDB2_Result_Common
{
if (!is_null($rownum)) {
$seek = $this->seek($rownum);
if (PEAR::isError($seek)) {
if (DOLIPEAR::isError($seek)) {
return $seek;
}
}
@ -1226,7 +1226,7 @@ class MDB2_Result_mysqli extends MDB2_Result_Common
{
$columns = array();
$numcols = $this->numCols();
if (PEAR::isError($numcols)) {
if (DOLIPEAR::isError($numcols)) {
return $numcols;
}
for ($column = 0; $column < $numcols; $column++) {
@ -1277,7 +1277,7 @@ class MDB2_Result_mysqli extends MDB2_Result_Common
function nextResult()
{
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -1363,7 +1363,7 @@ class MDB2_BufferedResult_mysqli extends MDB2_Result_mysqli
function valid()
{
$numrows = $this->numRows();
if (PEAR::isError($numrows)) {
if (DOLIPEAR::isError($numrows)) {
return $numrows;
}
return $this->rownum < ($numrows - 1);
@ -1407,7 +1407,7 @@ class MDB2_BufferedResult_mysqli extends MDB2_Result_mysqli
function nextResult()
{
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -1457,7 +1457,7 @@ class MDB2_Statement_mysqli extends MDB2_Statement_Common
}
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -1496,12 +1496,12 @@ class MDB2_Statement_mysqli extends MDB2_Statement_Common
}
}
$quoted = $this->db->quote($value, $type);
if (PEAR::isError($quoted)) {
if (DOLIPEAR::isError($quoted)) {
return $quoted;
}
$param_query = 'SET @'.$parameter.' = '.$quoted;
$result = $this->db->_doQuery($param_query, true, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
} else {
@ -1557,7 +1557,7 @@ class MDB2_Statement_mysqli extends MDB2_Statement_Common
if (!is_object($this->statement)) {
$result = $this->db->_doQuery($query, $this->is_manip, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -1616,7 +1616,7 @@ class MDB2_Statement_mysqli extends MDB2_Statement_Common
}
} elseif (!is_null($this->statement)) {
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}

View File

@ -198,7 +198,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$text = $this->escapePattern($text);
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
if (version_compare(PHP_VERSION, '5.2.0RC5', '>=')) {
@ -238,7 +238,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
register_shutdown_function('MDB2_closeOpenTransactions');
}
$result =& $this->_doQuery('BEGIN', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = true;
@ -272,7 +272,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
}
$result =& $this->_doQuery('COMMIT', true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = false;
@ -307,7 +307,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$query = 'ROLLBACK';
$result =& $this->_doQuery($query, true);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$this->in_transaction = false;
@ -432,7 +432,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
if (!empty($this->dsn['charset'])) {
$result = $this->setCharset($this->dsn['charset'], $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -461,14 +461,14 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$this->disconnect(false);
}
if (!PEAR::loadExtension($this->phptype)) {
if (!DOLIPEAR::loadExtension($this->phptype)) {
return $this->raiseError(MDB2_ERROR_NOT_FOUND, null, null,
'extension '.$this->phptype.' is not compiled into PHP', __FUNCTION__);
}
if ($this->database_name) {
$connection = $this->_doConnect($this->database_name, $this->options['persistent']);
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$this->connection = $connection;
@ -495,7 +495,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -559,7 +559,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
function &standaloneQuery($query, $types = null, $is_manip = false)
{
$connection = $this->_doConnect('template1', false);
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
$err =& $this->raiseError(MDB2_ERROR_CONNECT_FAILED, null, null,
'Cannot connect to template1', __FUNCTION__);
return $err;
@ -572,7 +572,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$result =& $this->_doQuery($query, $is_manip, $connection, false);
@pg_close($connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
@ -601,7 +601,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$this->last_query = $query;
$result = $this->debug($query, 'query', array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -613,7 +613,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -651,7 +651,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
{
if (is_null($connection)) {
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
}
@ -737,13 +737,13 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$server_info = $this->connected_server_info;
} else {
$server_info = $this->queryOne($query, 'text');
if (PEAR::isError($server_info)) {
if (DOLIPEAR::isError($server_info)) {
return $server_info;
}
}
// cache server_info
$this->connected_server_info = $server_info;
if (!$native && !PEAR::isError($server_info)) {
if (!$native && !DOLIPEAR::isError($server_info)) {
$tmp = explode('.', $server_info, 3);
if (empty($tmp[2])
&& isset($tmp[1])
@ -804,7 +804,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$this->offset = $this->limit = 0;
$result = $this->debug($query, __FUNCTION__, array('is_manip' => $is_manip, 'when' => 'pre'));
if ($result) {
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
$query = $result;
@ -836,7 +836,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
}
$new_pos = $this->_skipDelimitedStrings($query, $position, $p_position);
if (PEAR::isError($new_pos)) {
if (DOLIPEAR::isError($new_pos)) {
return $new_pos;
}
if ($new_pos != $position) {
@ -896,7 +896,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
}
}
$connection = $this->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -916,7 +916,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
}
$query = 'PREPARE '.$statement_name.$types_string.' AS '.$query;
$statement =& $this->_doQuery($query, true, $connection);
if (PEAR::isError($statement)) {
if (DOLIPEAR::isError($statement)) {
return $statement;
}
}
@ -961,7 +961,7 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
AND pg_get_expr(d.adbin, d.adrelid) LIKE 'nextval%'
ORDER BY a.attnum";
$seqname = $this->queryOne($query);
if (!PEAR::isError($seqname) && !empty($seqname) && is_string($seqname)) {
if (!DOLIPEAR::isError($seqname) && !empty($seqname) && is_string($seqname)) {
return $seqname;
}
@ -989,11 +989,11 @@ class MDB2_Driver_pgsql extends MDB2_Driver_Common
$this->expectError(MDB2_ERROR_NOSUCHTABLE);
$result = $this->queryOne($query, 'integer');
$this->popExpect();
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
if ($ondemand && $result->getCode() == MDB2_ERROR_NOSUCHTABLE) {
$this->loadModule('Manager', null, true);
$result = $this->manager->createSequence($seq_name);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $this->raiseError($result, null, null,
'on demand sequence could not be created', __FUNCTION__);
}
@ -1066,7 +1066,7 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
{
if (!is_null($rownum)) {
$seek = $this->seek($rownum);
if (PEAR::isError($seek)) {
if (DOLIPEAR::isError($seek)) {
return $seek;
}
}
@ -1138,7 +1138,7 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
{
$columns = array();
$numcols = $this->numCols();
if (PEAR::isError($numcols)) {
if (DOLIPEAR::isError($numcols)) {
return $numcols;
}
for ($column = 0; $column < $numcols; $column++) {
@ -1189,7 +1189,7 @@ class MDB2_Result_pgsql extends MDB2_Result_Common
function nextResult()
{
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -1268,7 +1268,7 @@ class MDB2_BufferedResult_pgsql extends MDB2_Result_pgsql
function valid()
{
$numrows = $this->numRows();
if (PEAR::isError($numrows)) {
if (DOLIPEAR::isError($numrows)) {
return $numrows;
}
return $this->rownum < ($numrows - 1);
@ -1333,7 +1333,7 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
}
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
@ -1386,7 +1386,7 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
}
} else {
$result = $this->db->_doQuery($query, $this->is_manip, $connection);
if (PEAR::isError($result)) {
if (DOLIPEAR::isError($result)) {
return $result;
}
}
@ -1421,7 +1421,7 @@ class MDB2_Statement_pgsql extends MDB2_Statement_Common
if (!is_null($this->statement)) {
$connection = $this->db->getConnection();
if (PEAR::isError($connection)) {
if (DOLIPEAR::isError($connection)) {
return $connection;
}
$query = 'DEALLOCATE PREPARE '.$this->statement;