From 02bcc2d484113ae5284c61d93ee541a226894698 Mon Sep 17 00:00:00 2001 From: Anton Date: Thu, 1 Jun 2017 17:34:59 +0300 Subject: [PATCH] create db adapter factory to inject service manager --- config/module.config.php | 2 +- src/Authentication/Adapter/DbFactory.php | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 src/Authentication/Adapter/DbFactory.php diff --git a/config/module.config.php b/config/module.config.php index 43435d1..3333f0d 100644 --- a/config/module.config.php +++ b/config/module.config.php @@ -7,9 +7,9 @@ ), 'service_manager' => array( 'invokables' => array( - 'ldc-zfc-user-oauth2-authentication-adapter-db' => 'LdcZfcUserOAuth2\Authentication\Adapter\Db', ), 'factories' => array( + 'ldc-zfc-user-oauth2-authentication-adapter-db' => 'LdcZfcUserOAuth2\Authentication\Adapter\DbFactory', 'ldc-zfc-user-oauth2-storage-pdo' => 'LdcZfcUserOAuth2\Storage\ZfcUserPdoFactory', 'ldc-zfc-user-oauth2-storage-bridge' => 'LdcZfcUserOAuth2\Storage\ZfcUserStorageBridgeFactory', ), diff --git a/src/Authentication/Adapter/DbFactory.php b/src/Authentication/Adapter/DbFactory.php new file mode 100644 index 0000000..450aa08 --- /dev/null +++ b/src/Authentication/Adapter/DbFactory.php @@ -0,0 +1,24 @@ +setServiceManager($serviceLocator); + + return $db; + } +}