Permalink
Browse files

make db adapter service manager alias configurable

  • Loading branch information...
1 parent dc92311 commit a074811b65db6af7c3520cc852a52b8fa2833c0c @bjyoungblood committed Dec 19, 2012
Showing with 7 additions and 3 deletions.
  1. +1 −1 Module.php
  2. +5 −1 config/module.config.php
  3. +1 −1 src/BjyAuthorize/Provider/Role/ZendDb.php
View
2 Module.php
@@ -65,7 +65,7 @@ function ($instance, $sm) {
'BjyAuthorize\Provider\Role\ZendDb' => function ($sm) {
$provider = new Provider\Role\ZendDb;
- $provider->setAdapter($sm->get('Zend\Db\Adapter\Adapter'));
+ $provider->setAdapter($sm->get('bjyauthorize_zend_db_adapter'));
return $provider;
},
View
6 config/module.config.php
@@ -14,7 +14,11 @@
'guards' => array(
),
),
-
+ 'service_manager' => array(
+ 'aliases' => array(
+ 'bjyauthorize_zend_db_adapter' => 'Zend\Db\Adapter\Adapter',
+ ),
+ ),
'view_manager' => array(
'template_map' => array(
'error/403' => __DIR__ . '/../view/error/403.phtml',
View
2 src/BjyAuthorize/Provider/Role/ZendDb.php
@@ -35,7 +35,7 @@ public function __construct($options, $serviceManager)
public function getRoles()
{
- $tableGateway = new TableGateway($this->tableName, $this->sm->get('Zend\Db\Adapter\Adapter'));
+ $tableGateway = new TableGateway($this->tableName, $this->sm->get('bjyauthorize_zend_db_adapter'));
$sql = new Select;
$sql->from($this->tableName);

0 comments on commit a074811

Please sign in to comment.