Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
make db adapter service manager alias configurable
  • Loading branch information
bjyoungblood committed Dec 19, 2012
1 parent dc92311 commit a074811
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Module.php
Expand Up @@ -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;
},

Expand Down
6 changes: 5 additions & 1 deletion config/module.config.php
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion src/BjyAuthorize/Provider/Role/ZendDb.php
Expand Up @@ -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);
Expand Down

0 comments on commit a074811

Please sign in to comment.