renommage de PEAR en DOLIPEAR
This commit is contained in:
parent
1c5df696a7
commit
cb9b95f26d
@ -102,7 +102,7 @@ class Auth_Container_DB extends Auth_Container
|
|||||||
} else {
|
} else {
|
||||||
return DOLIPEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
|
return DOLIPEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
|
||||||
41,
|
41,
|
||||||
PEAR_ERROR_RETURN,
|
DOLIPEAR_ERROR_RETURN,
|
||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|||||||
@ -120,7 +120,7 @@ class Auth_Container_MDB2 extends Auth_Container
|
|||||||
} else {
|
} else {
|
||||||
return DOLIPEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
|
return DOLIPEAR::raiseError('The given dsn was not valid in file ' . __FILE__ . ' at line ' . __LINE__,
|
||||||
41,
|
41,
|
||||||
PEAR_ERROR_RETURN,
|
DOLIPEAR_ERROR_RETURN,
|
||||||
null,
|
null,
|
||||||
null
|
null
|
||||||
);
|
);
|
||||||
|
|||||||
@ -488,7 +488,7 @@ class DB_mysql extends DB_common
|
|||||||
$seqname = $this->getSequenceName($seq_name);
|
$seqname = $this->getSequenceName($seq_name);
|
||||||
do {
|
do {
|
||||||
$repeat = 0;
|
$repeat = 0;
|
||||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
$this->pushErrorHandling(DOLIPEAR_ERROR_RETURN);
|
||||||
$result = $this->query("UPDATE ${seqname} ".
|
$result = $this->query("UPDATE ${seqname} ".
|
||||||
'SET id=LAST_INSERT_ID(id+1)');
|
'SET id=LAST_INSERT_ID(id+1)');
|
||||||
$this->popErrorHandling();
|
$this->popErrorHandling();
|
||||||
|
|||||||
@ -660,7 +660,7 @@ class DB_mysqli extends DB_common
|
|||||||
$seqname = $this->getSequenceName($seq_name);
|
$seqname = $this->getSequenceName($seq_name);
|
||||||
do {
|
do {
|
||||||
$repeat = 0;
|
$repeat = 0;
|
||||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
$this->pushErrorHandling(DOLIPEAR_ERROR_RETURN);
|
||||||
$result = $this->query('UPDATE ' . $seqname
|
$result = $this->query('UPDATE ' . $seqname
|
||||||
. ' SET id = LAST_INSERT_ID(id + 1)');
|
. ' SET id = LAST_INSERT_ID(id + 1)');
|
||||||
$this->popErrorHandling();
|
$this->popErrorHandling();
|
||||||
|
|||||||
@ -474,13 +474,13 @@ class DB_pgsql extends DB_common
|
|||||||
$seqname = $this->getSequenceName($seq_name);
|
$seqname = $this->getSequenceName($seq_name);
|
||||||
$repeat = false;
|
$repeat = false;
|
||||||
do {
|
do {
|
||||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
$this->pushErrorHandling(DOLIPEAR_ERROR_RETURN);
|
||||||
$result = $this->query("SELECT NEXTVAL('${seqname}')");
|
$result = $this->query("SELECT NEXTVAL('${seqname}')");
|
||||||
$this->popErrorHandling();
|
$this->popErrorHandling();
|
||||||
if ($ondemand && DB::isError($result) &&
|
if ($ondemand && DB::isError($result) &&
|
||||||
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
|
$result->getCode() == DB_ERROR_NOSUCHTABLE) {
|
||||||
$repeat = true;
|
$repeat = true;
|
||||||
$this->pushErrorHandling(PEAR_ERROR_RETURN);
|
$this->pushErrorHandling(DOLIPEAR_ERROR_RETURN);
|
||||||
$result = $this->createSequence($seq_name);
|
$result = $this->createSequence($seq_name);
|
||||||
$this->popErrorHandling();
|
$this->popErrorHandling();
|
||||||
if (DB::isError($result)) {
|
if (DB::isError($result)) {
|
||||||
|
|||||||
@ -964,7 +964,7 @@ class MDB2_Error extends DOLIPEAR_Error
|
|||||||
* @param int what error level to use for $mode & PEAR_ERROR_TRIGGER
|
* @param int what error level to use for $mode & PEAR_ERROR_TRIGGER
|
||||||
* @param smixed additional debug info, such as the last query
|
* @param smixed additional debug info, such as the last query
|
||||||
*/
|
*/
|
||||||
function MDB2_Error($code = MDB2_ERROR, $mode = PEAR_ERROR_RETURN,
|
function MDB2_Error($code = MDB2_ERROR, $mode = DOLIPEAR_ERROR_RETURN,
|
||||||
$level = E_USER_NOTICE, $debuginfo = null)
|
$level = E_USER_NOTICE, $debuginfo = null)
|
||||||
{
|
{
|
||||||
if (is_null($code)) {
|
if (is_null($code)) {
|
||||||
@ -1441,7 +1441,7 @@ class MDB2_Driver_Common extends DOLIPEAR
|
|||||||
}
|
}
|
||||||
|
|
||||||
$err =& DOLIPEAR::raiseError(null, $code, $mode, $options, $userinfo, 'MDB2_Error', true);
|
$err =& DOLIPEAR::raiseError(null, $code, $mode, $options, $userinfo, 'MDB2_Error', true);
|
||||||
if ($err->getMode() !== PEAR_ERROR_RETURN
|
if ($err->getMode() !== DOLIPEAR_ERROR_RETURN
|
||||||
&& isset($this->nested_transaction_counter) && !$this->has_transaction_error) {
|
&& isset($this->nested_transaction_counter) && !$this->has_transaction_error) {
|
||||||
$this->has_transaction_error =& $err;
|
$this->has_transaction_error =& $err;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -45,7 +45,7 @@
|
|||||||
// $Id$
|
// $Id$
|
||||||
|
|
||||||
//require_once 'MDB2/LOB.php';
|
//require_once 'MDB2/LOB.php';
|
||||||
require_once PEAR_PATH."/MDB2/LOB.php';
|
require_once PEAR_PATH."/MDB2/LOB.php";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @package MDB2
|
* @package MDB2
|
||||||
|
|||||||
@ -69,12 +69,12 @@ class MDB2_Driver_Native_pgsql extends MDB2_Driver_Native_Common
|
|||||||
function deleteOID($OID)
|
function deleteOID($OID)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
$connection = $db->getConnection();
|
$connection = $db->getConnection();
|
||||||
if (PEAR::isError($connection)) {
|
if (DOLIPEAR::isError($connection)) {
|
||||||
return $connection;
|
return $connection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -93,11 +93,11 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$where = false, $types = null, $result_types = MDB2_PREPARE_MANIP)
|
$where = false, $types = null, $result_types = MDB2_PREPARE_MANIP)
|
||||||
{
|
{
|
||||||
$query = $this->buildManipSQL($table, $table_fields, $mode, $where);
|
$query = $this->buildManipSQL($table, $table_fields, $mode, $where);
|
||||||
if (PEAR::isError($query)) {
|
if (DOLIPEAR::isError($query)) {
|
||||||
return $query;
|
return $query;
|
||||||
}
|
}
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
return $db->prepare($query, $types, $result_types);
|
return $db->prepare($query, $types, $result_types);
|
||||||
@ -148,7 +148,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$query = $this->buildManipSQL($table, $keys, $mode, $where);
|
$query = $this->buildManipSQL($table, $keys, $mode, $where);
|
||||||
|
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
if ($mode == MDB2_AUTOQUERY_SELECT) {
|
if ($mode == MDB2_AUTOQUERY_SELECT) {
|
||||||
@ -158,7 +158,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$stmt = $this->autoPrepare($table, $keys, $mode, $where, $types, $result_types);
|
$stmt = $this->autoPrepare($table, $keys, $mode, $where, $types, $result_types);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
$result =& $stmt->execute($params, $result_class);
|
$result =& $stmt->execute($params, $result_class);
|
||||||
@ -194,7 +194,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
function buildManipSQL($table, $table_fields, $mode, $where = false)
|
function buildManipSQL($table, $table_fields, $mode, $where = false)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,12 +268,12 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$result_wrap_class = false)
|
$result_wrap_class = false)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $db->setLimit($limit, $offset);
|
$result = $db->setLimit($limit, $offset);
|
||||||
if (PEAR::isError($result)) {
|
if (DOLIPEAR::isError($result)) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
$result =& $db->query($query, $types, $result_class, $result_wrap_class);
|
$result =& $db->query($query, $types, $result_class, $result_wrap_class);
|
||||||
@ -297,7 +297,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
function execParam($query, $params = array(), $param_types = null)
|
function execParam($query, $params = array(), $param_types = null)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -307,12 +307,12 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare($query, $param_types, MDB2_PREPARE_MANIP);
|
$stmt = $db->prepare($query, $param_types, MDB2_PREPARE_MANIP);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $stmt->execute($params);
|
$result = $stmt->execute($params);
|
||||||
if (PEAR::isError($result)) {
|
if (DOLIPEAR::isError($result)) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$param_types = null, $colnum = 0)
|
$param_types = null, $colnum = 0)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,7 +352,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare($query, $param_types, $type);
|
$stmt = $db->prepare($query, $param_types, $type);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,7 +388,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$param_types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT)
|
$param_types = null, $fetchmode = MDB2_FETCHMODE_DEFAULT)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -398,7 +398,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare($query, $param_types, $types);
|
$stmt = $db->prepare($query, $param_types, $types);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -434,7 +434,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$param_types = null, $colnum = 0)
|
$param_types = null, $colnum = 0)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare($query, $param_types, $type);
|
$stmt = $db->prepare($query, $param_types, $type);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$rekey = false, $force_array = false, $group = false)
|
$rekey = false, $force_array = false, $group = false)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare($query, $param_types, $types);
|
$stmt = $db->prepare($query, $param_types, $types);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
$fetchmode = MDB2_FETCHMODE_DEFAULT, $force_array = false, $group = false)
|
$fetchmode = MDB2_FETCHMODE_DEFAULT, $force_array = false, $group = false)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,7 +605,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
}
|
}
|
||||||
|
|
||||||
$stmt = $db->prepare($query, $param_types, $types);
|
$stmt = $db->prepare($query, $param_types, $types);
|
||||||
if (PEAR::isError($stmt)) {
|
if (DOLIPEAR::isError($stmt)) {
|
||||||
return $stmt;
|
return $stmt;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -642,7 +642,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
{
|
{
|
||||||
for ($i = 0, $j = count($params); $i < $j; $i++) {
|
for ($i = 0, $j = count($params); $i < $j; $i++) {
|
||||||
$result = $stmt->execute($params[$i]);
|
$result = $stmt->execute($params[$i]);
|
||||||
if (PEAR::isError($result)) {
|
if (DOLIPEAR::isError($result)) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -667,14 +667,14 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
function getBeforeID($table, $field = null, $ondemand = true, $quote = true)
|
function getBeforeID($table, $field = null, $ondemand = true, $quote = true)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($db->supports('auto_increment') !== true) {
|
if ($db->supports('auto_increment') !== true) {
|
||||||
$seq = $table.(empty($field) ? '' : '_'.$field);
|
$seq = $table.(empty($field) ? '' : '_'.$field);
|
||||||
$id = $db->nextID($seq, $ondemand);
|
$id = $db->nextID($seq, $ondemand);
|
||||||
if (!$quote || PEAR::isError($id)) {
|
if (!$quote || DOLIPEAR::isError($id)) {
|
||||||
return $id;
|
return $id;
|
||||||
}
|
}
|
||||||
return $db->quote($id, 'integer');
|
return $db->quote($id, 'integer');
|
||||||
@ -700,7 +700,7 @@ class MDB2_Extended extends MDB2_Module_Common
|
|||||||
function getAfterID($id, $table, $field = null)
|
function getAfterID($id, $table, $field = null)
|
||||||
{
|
{
|
||||||
$db =& $this->getDBInstance();
|
$db =& $this->getDBInstance();
|
||||||
if (PEAR::isError($db)) {
|
if (DOLIPEAR::isError($db)) {
|
||||||
return $db;
|
return $db;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -114,7 +114,7 @@ class MDB2_Iterator implements Iterator
|
|||||||
{
|
{
|
||||||
if (is_null($this->row)) {
|
if (is_null($this->row)) {
|
||||||
$row = $this->result->fetchRow($this->fetchmode);
|
$row = $this->result->fetchRow($this->fetchmode);
|
||||||
if (PEAR::isError($row)) {
|
if (DOLIPEAR::isError($row)) {
|
||||||
$row = false;
|
$row = false;
|
||||||
}
|
}
|
||||||
$this->row = $row;
|
$this->row = $row;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user