diff --git a/Westdc/User/Account.php b/Westdc/User/Account.php index a8143f0..c5b85ec 100644 --- a/Westdc/User/Account.php +++ b/Westdc/User/Account.php @@ -34,7 +34,7 @@ class Account implements EventManagerAwareInterface function __construct() { - $this->db = new Db(); + $this->db = Db::getInstance(); $this->config = Config::get(); $Listener = new Listener(); @@ -173,8 +173,8 @@ class Account implements EventManagerAwareInterface { $auth = new AuthenticationService(); $auth->setStorage(new SessionStorage($this->config->session_namespace)); - - new Zend_Db($dbAdapter); + + $dbAdapter = Zend_Db::getInstance(); $authAdapter = new \Zend\Authentication\Adapter\DbTable( $dbAdapter, diff --git a/Westdc/User/Handle/LoginHandle.php b/Westdc/User/Handle/LoginHandle.php index 48d1f8d..7630bed 100644 --- a/Westdc/User/Handle/LoginHandle.php +++ b/Westdc/User/Handle/LoginHandle.php @@ -19,7 +19,7 @@ class LoginHandle function __construct() { - $this->db = new Db(); + $this->db = Db::getInstance(); } public function checkParam(EventInterface $e){ diff --git a/Westdc/User/Handle/RegisterHandle.php b/Westdc/User/Handle/RegisterHandle.php index 4b543cc..0ddc32d 100644 --- a/Westdc/User/Handle/RegisterHandle.php +++ b/Westdc/User/Handle/RegisterHandle.php @@ -21,7 +21,7 @@ class RegisterHandle function __construct($db = NULL) { - $this->db = new Db(); + $this->db = Db::getInstance(); $this->config = Config::get(); }