Fix: les classes dans le PEAR embarqu avait tait renomm en DOLIPEAR. Cependant, il rest encore des rfrence en PEAR.
This commit is contained in:
parent
5f31e7892d
commit
b144f3af52
@ -18,8 +18,10 @@
|
||||
//
|
||||
// $Id$
|
||||
//
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/PEAR.php";
|
||||
|
||||
//require_once "PEAR.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/PEAR.php";
|
||||
|
||||
|
||||
define("AUTH_IDLED", -1);
|
||||
define("AUTH_EXPIRED", -2);
|
||||
|
||||
@ -74,7 +74,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
$this->_parseOptions($dsn);
|
||||
|
||||
if (empty($this->options['dsn'])) {
|
||||
PEAR::raiseError('No connection parameters specified!');
|
||||
DOLIPEAR::raiseError('No connection parameters specified!');
|
||||
}
|
||||
} else {
|
||||
$this->options['dsn'] = $dsn;
|
||||
@ -98,9 +98,9 @@ class Auth_Container_DB extends Auth_Container
|
||||
} elseif (get_parent_class($dsn) == "db_common") {
|
||||
$this->db = $dsn;
|
||||
} elseif (DB::isError($dsn)) {
|
||||
return PEAR::raiseError($dsn->getMessage(), $dsn->getCode());
|
||||
return DOLIPEAR::raiseError($dsn->getMessage(), $dsn->getCode());
|
||||
} else {
|
||||
return PEAR::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,
|
||||
PEAR_ERROR_RETURN,
|
||||
null,
|
||||
@ -228,7 +228,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
// Prepare for a database query
|
||||
$err = $this->_prepare();
|
||||
if ($err !== true) {
|
||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
||||
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||
}
|
||||
|
||||
// Find if db_fileds contains a *, i so assume all col are selected
|
||||
@ -249,7 +249,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
$res = $this->db->getRow($query, $query_params, DB_FETCHMODE_ASSOC);
|
||||
|
||||
if (DB::isError($res)) {
|
||||
return PEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
return DOLIPEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
}
|
||||
if (!is_array($res)) {
|
||||
$this->activeUser = '';
|
||||
@ -281,7 +281,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
{
|
||||
$err = $this->_prepare();
|
||||
if ($err !== true) {
|
||||
return PEAR::raiseError($err->getMessage(), $err->getCode());
|
||||
return DOLIPEAR::raiseError($err->getMessage(), $err->getCode());
|
||||
}
|
||||
|
||||
$retVal = array();
|
||||
@ -301,7 +301,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
$res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
|
||||
|
||||
if (DB::isError($res)) {
|
||||
return PEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
return DOLIPEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
} else {
|
||||
foreach ($res as $user) {
|
||||
$user['username'] = $user[$this->options['usernamecol']];
|
||||
@ -355,7 +355,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
$res = $this->query($query);
|
||||
|
||||
if (DB::isError($res)) {
|
||||
return PEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
return DOLIPEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
@ -383,7 +383,7 @@ class Auth_Container_DB extends Auth_Container
|
||||
$res = $this->query($query);
|
||||
|
||||
if (DB::isError($res)) {
|
||||
return PEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
return DOLIPEAR::raiseError($res->getMessage(), $res->getCode());
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
|
||||
//require_once "PEAR.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/PEAR.php";
|
||||
|
||||
// {{{ constants
|
||||
// {{{ error codes
|
||||
/*
|
||||
@ -682,32 +683,32 @@ class DB_result
|
||||
/**
|
||||
* DB_result constructor.
|
||||
* @param resource &$dbh DB object reference
|
||||
* @param resource $result result resource id
|
||||
* @param resource $result result resource id
|
||||
* @param array $options assoc array with optional result options
|
||||
*/
|
||||
|
||||
function DB_result(&$dbh, $result, $options = array())
|
||||
{
|
||||
{
|
||||
$this->dbh = &$dbh;
|
||||
$this->result = $result;
|
||||
foreach ($options as $key => $value) {
|
||||
$this->setOption($key, $value);
|
||||
$this->result = $result;
|
||||
foreach ($options as $key => $value) {
|
||||
$this->setOption($key, $value);
|
||||
}
|
||||
$this->limit_type = $dbh->features['limit'];
|
||||
$this->autofree = $dbh->options['autofree'];
|
||||
$this->fetchmode = $dbh->fetchmode;
|
||||
$this->fetchmode_object_class = $dbh->fetchmode_object_class;
|
||||
}
|
||||
|
||||
function setOption($key, $value = null)
|
||||
{
|
||||
switch ($key) {
|
||||
case 'limit_from':
|
||||
$this->limit_from = $value; break;
|
||||
case 'limit_count';
|
||||
$this->limit_count = $value; break;
|
||||
}
|
||||
}
|
||||
|
||||
function setOption($key, $value = null)
|
||||
{
|
||||
switch ($key) {
|
||||
case 'limit_from':
|
||||
$this->limit_from = $value; break;
|
||||
case 'limit_count';
|
||||
$this->limit_count = $value; break;
|
||||
}
|
||||
}
|
||||
|
||||
// }}}
|
||||
// {{{ fetchRow()
|
||||
@ -728,7 +729,7 @@ class DB_result
|
||||
if ($fetchmode === DB_FETCHMODE_OBJECT) {
|
||||
$fetchmode = DB_FETCHMODE_ASSOC;
|
||||
$object_class = $this->fetchmode_object_class;
|
||||
}
|
||||
}
|
||||
if ($this->limit_from !== null) {
|
||||
if ($this->row_counter === null) {
|
||||
$this->row_counter = $this->limit_from;
|
||||
@ -742,7 +743,7 @@ class DB_result
|
||||
}
|
||||
if ($this->row_counter >= (
|
||||
$this->limit_from + $this->limit_count))
|
||||
{
|
||||
{
|
||||
if ($this->autofree) {
|
||||
$this->free();
|
||||
}
|
||||
@ -752,23 +753,23 @@ class DB_result
|
||||
$rownum = $this->row_counter;
|
||||
}
|
||||
$this->row_counter++;
|
||||
}
|
||||
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
|
||||
if ($res === DB_OK) {
|
||||
if (isset($object_class)) {
|
||||
}
|
||||
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
|
||||
if ($res === DB_OK) {
|
||||
if (isset($object_class)) {
|
||||
// default mode specified in DB_common::fetchmode_object_class property
|
||||
if ($object_class == 'stdClass') {
|
||||
$arr = (object) $arr;
|
||||
} else {
|
||||
$arr = &new $object_class($arr);
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $arr;
|
||||
}
|
||||
if ($res == null && $this->autofree) {
|
||||
$this->free();
|
||||
}
|
||||
return $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
// }}}
|
||||
@ -807,7 +808,7 @@ class DB_result
|
||||
}
|
||||
if ($this->row_counter >= (
|
||||
$this->limit_from + $this->limit_count))
|
||||
{
|
||||
{
|
||||
if ($this->autofree) {
|
||||
$this->free();
|
||||
}
|
||||
@ -818,23 +819,23 @@ class DB_result
|
||||
}
|
||||
|
||||
$this->row_counter++;
|
||||
}
|
||||
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
|
||||
if ($res === DB_OK) {
|
||||
if (isset($object_class)) {
|
||||
}
|
||||
$res = $this->dbh->fetchInto($this->result, $arr, $fetchmode, $rownum);
|
||||
if ($res === DB_OK) {
|
||||
if (isset($object_class)) {
|
||||
// default mode specified in DB_common::fetchmode_object_class property
|
||||
if ($object_class == 'stdClass') {
|
||||
$arr = (object) $arr;
|
||||
} else {
|
||||
$arr = new $object_class($arr);
|
||||
}
|
||||
}
|
||||
return DB_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
return DB_OK;
|
||||
}
|
||||
if ($res == null && $this->autofree) {
|
||||
$this->free();
|
||||
}
|
||||
return $res;
|
||||
return $res;
|
||||
}
|
||||
|
||||
// }}}
|
||||
|
||||
@ -26,6 +26,7 @@
|
||||
* inherited by all such.
|
||||
*/
|
||||
|
||||
//require_once "PEAR.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/PEAR.php";
|
||||
|
||||
class DB_common extends DOLIPEAR
|
||||
@ -683,14 +684,14 @@ class DB_common extends DOLIPEAR
|
||||
* @see prepare()
|
||||
*/
|
||||
function freePrepared($stmt)
|
||||
{
|
||||
// Free the internal prepared vars
|
||||
{
|
||||
// Free the internal prepared vars
|
||||
if (isset($this->prepare_tokens[$stmt])) {
|
||||
unset($this->prepare_tokens[$stmt]);
|
||||
unset($this->prepare_types[$stmt]);
|
||||
unset($this->prepared_queries[$stmt]);
|
||||
return true;
|
||||
}
|
||||
unset($this->prepared_queries[$stmt]);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -19,8 +19,10 @@
|
||||
// $Id$
|
||||
//
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/Auth/Container.php";
|
||||
// require_once 'PEAR.php';
|
||||
// require_once 'Auth/Container.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/PEAR.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/Auth/Container.php";
|
||||
|
||||
/**
|
||||
* Storage driver for fetching login data from LDAP
|
||||
@ -176,7 +178,7 @@ class Auth_Container_LDAP extends Auth_Container
|
||||
function Auth_Container_LDAP($params)
|
||||
{
|
||||
if (false === extension_loaded('ldap')) {
|
||||
return PEAR::raiseError('Auth_Container_LDAP: LDAP Extension not loaded', 41, PEAR_ERROR_DIE);
|
||||
return DOLIPEAR::raiseError('Auth_Container_LDAP: LDAP Extension not loaded', 41, PEAR_ERROR_DIE);
|
||||
}
|
||||
|
||||
$this->_setDefaults();
|
||||
@ -207,7 +209,7 @@ class Auth_Container_LDAP extends Auth_Container
|
||||
}
|
||||
|
||||
if (($this->conn_id = @call_user_func_array('ldap_connect', $conn_params)) === false) {
|
||||
return PEAR::raiseError('Auth_Container_LDAP: Could not connect to server.', 41, PEAR_ERROR_DIE);
|
||||
return DOLIPEAR::raiseError('Auth_Container_LDAP: Could not connect to server.', 41, PEAR_ERROR_DIE);
|
||||
}
|
||||
$this->_debug('Successfully connected to server', __LINE__);
|
||||
|
||||
@ -229,7 +231,7 @@ class Auth_Container_LDAP extends Auth_Container
|
||||
if ((@call_user_func_array('ldap_bind', $bind_params)) == false) {
|
||||
$this->_debug();
|
||||
$this->_disconnect();
|
||||
return PEAR::raiseError("Auth_Container_LDAP: Could not bind to LDAP server.", 41, PEAR_ERROR_DIE);
|
||||
return DOLIPEAR::raiseError("Auth_Container_LDAP: Could not bind to LDAP server.", 41, PEAR_ERROR_DIE);
|
||||
}
|
||||
$this->_debug('Binding was successful', __LINE__);
|
||||
}
|
||||
@ -277,7 +279,7 @@ class Auth_Container_LDAP extends Auth_Container
|
||||
|
||||
// if base ist still not set, raise error
|
||||
if ($this->options['basedn'] == "") {
|
||||
return PEAR::raiseError("Auth_Container_LDAP: LDAP search base not specified!", 41, PEAR_ERROR_DIE);
|
||||
return DOLIPEAR::raiseError("Auth_Container_LDAP: LDAP search base not specified!", 41, PEAR_ERROR_DIE);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -25,6 +25,7 @@
|
||||
// $Id$
|
||||
//
|
||||
|
||||
// require_once 'DB/common.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/DB/common.php";
|
||||
|
||||
/**
|
||||
|
||||
@ -22,6 +22,8 @@
|
||||
// $Id$
|
||||
//
|
||||
|
||||
// require_once 'DB/common.php';
|
||||
// require_once 'DB/ldap2.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/DB/common.php";
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/DB/ldap2.php";
|
||||
|
||||
|
||||
@ -29,6 +29,7 @@
|
||||
// be registered here.
|
||||
//
|
||||
|
||||
//require_once 'DB/common.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/DB/common.php";
|
||||
|
||||
class DB_mysql extends DB_common
|
||||
@ -563,11 +564,11 @@ class DB_mysql extends DB_common
|
||||
return $res;
|
||||
}
|
||||
// insert yields value 1, nextId call will generate ID 2
|
||||
$res = $this->query("INSERT INTO ${seqname} VALUES(0)");
|
||||
if (DB::isError($res)) {
|
||||
return $res;
|
||||
}
|
||||
// so reset to zero
|
||||
$res = $this->query("INSERT INTO ${seqname} VALUES(0)");
|
||||
if (DB::isError($res)) {
|
||||
return $res;
|
||||
}
|
||||
// so reset to zero
|
||||
return $this->query("UPDATE ${seqname} SET id = 0;");
|
||||
}
|
||||
|
||||
|
||||
@ -23,7 +23,9 @@
|
||||
// extension.
|
||||
//
|
||||
|
||||
require_once 'DB/common.php';
|
||||
//require_once 'DB/common.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/includes/pear/DB/common.php";
|
||||
|
||||
|
||||
class DB_pgsql extends DB_common
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user