22/12/2005, 09:57
|
| | | Fecha de Ingreso: noviembre-2004
Mensajes: 2.344
Antigüedad: 20 años, 1 mes Puntos: 8 | |
Hola de nuevo, he encontrado la función en cuestión:
Código:
function &getDatabaseConnection()
{
global $_DB_DATAOBJECT;
if (($e = $this->_connect()) !== true) {
return $e;
}
if (!isset($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
return false;
}
return $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
}
y la función _connect()
Código:
function _connect()
{
global $_DB_DATAOBJECT;
if (empty($_DB_DATAOBJECT['CONFIG'])) {
DB_DataObject::_loadConfig();
}
// is it already connected ?
if ($this->_database_dsn_md5 && @$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]) {
if (PEAR::isError($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
return DB_DataObject::raiseError(
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->message,
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->code, PEAR_ERROR_DIE
);
}
if (!$this->_database) {
$this->_database = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['database'];
}
}
$options= &$_DB_DATAOBJECT['CONFIG'];
$dsn = @$this->_database_dsn;
if (!$dsn) {
if (!$this->_database) {
$this->_database = @$options["table_{$this->__table}"];
}
if (@$this->_database && @$options["database_{$this->_database}"]) {
$dsn = $options["database_{$this->_database}"];
} else if ($options['database']) {
$dsn = $options['database'];
}
}
$this->_database_dsn_md5 = md5($dsn);
if (@$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]) {
if (@$_DB_DATAOBJECT['CONFIG']['debug']) {
$this->debug("USING CACHED CONNECTION", "CONNECT",3);
}
if (!$this->_database) {
$this->_database = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn["database"];
}
return true;
}
if (@$_DB_DATAOBJECT['CONFIG']['debug']) {
$this->debug("NEW CONNECTION", "CONNECT",3);
/* actualy make a connection */
$this->debug("{$dsn} {$this->_database_dsn_md5}", "CONNECT",3);
}
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5] = DB::connect($dsn);
if (@$_DB_DATAOBJECT['CONFIG']['debug']) {
$this->debug(serialize($_DB_DATAOBJECT['CONNECTIONS']), "CONNECT",5);
}
if (PEAR::isError($_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5])) {
return DB_DataObject::raiseError(
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->message,
$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->code, PEAR_ERROR_DIE
);
}
if (!$this->_database) {
$this->_database = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn["database"];
}
// Oracle need to optimize for portibility - not sure exactly what this does though :)
$c = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
if ($c->phptype == 'oci8') {
$c->setOption('optimize','portability');
}
return true;
}
No se que es lo que está pasando, voy a seguir revisando a ver que veo. |