Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make db adapter service manager alias configurable

  • Loading branch information...
commit a074811b65db6af7c3520cc852a52b8fa2833c0c 1 parent dc92311
@bjyoungblood authored
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);
Please sign in to comment.
Something went wrong with that request. Please try again.