db = new _db($config); } } class user{ private $db; public function __construct($config) { $this->db = new _db($config); } } class category{ private $db; public function __construct($config) { $this->db = new _db($config); } } class group{ private $db; public function __construct($congig) { $this->db = new _db($congig); } } class _dbMysql{ } class _db{ private $db; public function __construct($config) { switch ($driver){ case "mysql": $this->db = new _dbMysql; $this->db->init(); break; } } } class galerie{ public $_db; public $galery; public $user; public $category; public $group; public function __construct() { $this->galery = new galery($this->config); $this->user = new user($this->cofig); $this->category = new category($this->config); $this->group = new group($this->config); } } ?>