public static function getConnection($name = NULL) { if ($name === NULL) { if (self::$connection === NULL) { throw new Dibi\Exception('Dibi is not connected to database.'); } return self::$connection; } if (!isset(self::$registry[$name])) { throw new Dibi\Exception("There is no connection named '{$name}'."); } return self::$registry[$name]; }
public function __construct(IComponentContainer $parent = NULL, $name = NULL) { parent::__construct($parent, $name); $this->db = dibi::getConnection(); self::$count++; // $this->setWebloaderPaths(); }