Listo lo que hice ahora fue esto.
DbFactory
Código PHP:
Ver originalpublic static function create($sIniFile)
{
$config = new Reader($sIniFile);
$config_data = $config->getConfig();
$database_class = key($config_data);
include($database_class.'.class.php');
if(Registry::has($sIniFile))
{
return Registry::get($sIniFile);
}else{
$db = new $database_class($config);
Registry::set($sIniFile, $db);
return $db;
}
}
Y Cambie el registry por uno que tu hiciste en otro post
Código PHP:
Ver original<?php
class Registry {
private $_cache;
public function __construct() {
}
public function set($key, &$item) {
$this->_cache[$key] = &$item;
}
public function get($key) {
return $this->_cache[$key];
}
public function has($key) {
return ($this->get($key) !== null);
}
}
?>
hay creeria que ya no se crea una nueva.
Si?
saludos