Skip to content
This repository was archived by the owner on Mar 9, 2020. It is now read-only.

Commit 368685b

Browse files
committed
Merge branch 'master' of github.com:api-skeletons/zf-oauth2-doctrine
2 parents 10e87ff + 761719b commit 368685b

File tree

6 files changed

+106
-78
lines changed

6 files changed

+106
-78
lines changed

.travis.yml

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,40 +13,13 @@ env:
1313
matrix:
1414
fast_finish: true
1515
include:
16-
- php: 5.5
17-
env:
18-
- DEPS=lowest
19-
- php: 5.5
20-
env:
21-
- DEPS=latest
22-
- EXECUTE_CS_CHECK=true
23-
- php: 5.6
24-
env:
25-
- DEPS=lowest
26-
- php: 5.6
27-
env:
28-
- EXECUTE_COVERAGE=true
29-
- DEPS=latest
30-
- php: 7.0
31-
env:
32-
- DEPS=lowest
33-
- php: 7.0
34-
env:
35-
- DEPS=latest
3616
- php: 7.1
3717
env:
18+
- EXECUTE_COVERAGE=true
3819
- DEPS=lowest
3920
- php: 7.1
4021
env:
4122
- DEPS=latest
42-
- php: hhvm
43-
env:
44-
- DEPS=lowest
45-
- php: hhvm
46-
env:
47-
- DEPS=latest
48-
allow_failures:
49-
- php: hhvm
5023

5124
notifications:
5225
irc: "irc.freenode.org#apigility-dev"

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,17 @@ OAuth2 Doctrine ORM Adapter for Apigility
22
=========================================
33

44
[![Build Status](https://travis-ci.org/API-Skeletons/zf-oauth2-doctrine.svg)](https://travis-ci.org/API-Skeletons/zf-oauth2-doctrine)
5+
[![Documentation Status](https://readthedocs.org/projects/doctrine-in-apigility-docs/badge/?version=latest)](http://doctrine-in-apigility-docs.readthedocs.io/en/latest/zf-oauth2-doctrine/index.html)
56
[![Total Downloads](https://poser.pugx.org/api-skeletons/zf-oauth2-doctrine/downloads)](https://packagist.org/packages/api-skeletons/zf-oauth2-doctrine)
67

78
This provides a Doctrine adapter for [zfcampus/zf-mvc-auth](https://github.com/zfcampus/zf-mvc-auth) and [zfcampus/zf-oauth2](https://github.com/zfcampus/zf-oauth2) and entity definitions for all aspects of OAuth2 including Authorization Code, Access Tokens, Refresh Tokens, JWT & JTI, and Scopes.
89

10+
11+
Versions
12+
--------
13+
14+
The Version 1.x series is for PHP 5.5 to 7.0. The 2.x series is for PHP 7.1 onward.
15+
916
![Entity Relationship Diagram](https://raw.githubusercontent.com/API-Skeletons/zf-oauth2-doctrine/master/media/oauth2-doctrine-erd.png)
1017
Entity Relationship Diagram created with [Skipper](https://skipper18.com)
1118

composer.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@
88
"apigility"
99
],
1010
"require": {
11-
"php": "^5.5 || ^7.0",
12-
"zfcampus/zf-oauth2": "^1.3",
13-
"doctrine/orm": "^2.4.5",
14-
"doctrine/doctrine-module": "~0.8 || ^1.0",
15-
"doctrine/doctrine-orm-module": "~0.8 || ^1.0",
16-
"zfcampus/zf-mvc-auth": "^1.3",
17-
"zendframework/zend-mvc": "^2.4 || ^3.0.3",
18-
"zendframework/zend-config": "^2.4 || ^3.0",
19-
"zendframework/zend-modulemanager": "^2.4",
20-
"zendframework/zend-servicemanager": "^2.4 || ^3.0",
11+
"php": ">=7.1",
12+
"zfcampus/zf-oauth2": "^1.4",
13+
"doctrine/orm": "^2.5.11",
14+
"doctrine/doctrine-module": "^1.2",
15+
"doctrine/doctrine-orm-module": "^1.1.5",
16+
"zfcampus/zf-mvc-auth": "^1.4.3",
17+
"zendframework/zend-mvc": "^3.1",
18+
"zendframework/zend-config": "^3.1",
19+
"zendframework/zend-modulemanager": "^2.8",
20+
"zendframework/zend-servicemanager": "^3.3",
2121
"zendframework/zend-i18n": "^2.4"
2222
},
2323
"require-dev": {
24-
"phpunit/phpunit": "^4.8.8 || ^5.2 || ^6.0",
25-
"squizlabs/php_codesniffer": "^2.7",
26-
"zendframework/zend-form": "^2.4",
24+
"phpunit/phpunit": "^6.0",
25+
"squizlabs/php_codesniffer": "^3.1",
26+
"zendframework/zend-form": "^2.10",
2727
"zendframework/zend-loader": "^2.4",
28-
"zendframework/zend-log": "^2.4",
29-
"zendframework/zend-serializer": "^2.4",
30-
"zendframework/zend-test": "^2.4 || ^3.0",
31-
"zendframework/zend-authentication": "^2.4",
32-
"zendframework/zend-eventmanager": "^2.4 || ^3.0",
28+
"zendframework/zend-log": "^2.9",
29+
"zendframework/zend-serializer": "^2.7",
30+
"zendframework/zend-test": "^3.1",
31+
"zendframework/zend-authentication": "^2.5",
32+
"zendframework/zend-eventmanager": "^3.2",
3333
"mockery/mockery": "^0.9.5",
3434
"satooshi/php-coveralls": "^1.0"
3535
},

config/module.config.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/ConfigProvider.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
3+
namespace ZF\OAuth2\Doctrine;
4+
5+
use Zend\ServiceManager\Factory\InvokableFactory;
6+
7+
class ConfigProvider
8+
{
9+
/**
10+
* Return general purpose zf-oauth2-doctrine configuration
11+
*
12+
* @return array
13+
*/
14+
public function __invoke()
15+
{
16+
return [
17+
'dependencies' => $provider->getDependencyConfig(),
18+
'zf-apigility-doctrine-query-create-filter' => $provider->getQueryCreateFilterConfig(),
19+
'zf-apigility-doctrine-query-provider' => $provider->getQueryProviderConfig(),
20+
];
21+
}
22+
23+
/**
24+
* Return application-level dependency configuration.
25+
*
26+
* @return array
27+
*/
28+
public function getDependencyConfig()
29+
{
30+
return [
31+
'factories' => [
32+
Adapter\DoctrineAdapterFactory::class => InvokableFactory::class,
33+
Mapper\MapperManager::class => InvokableFactory::class,
34+
Adapter\DoctrineAdapter::class => InvokableFactory::class,
35+
],
36+
'shared' => [
37+
Adapter\DoctrineAdapterFactory::class => false,
38+
Mapper\MapperManager::class => false,
39+
],
40+
];
41+
}
42+
43+
/**
44+
* Return QueryCreateFilter configuration.
45+
*
46+
* @return array
47+
*/
48+
public function getQueryCreateFilterConfig()
49+
{
50+
return [
51+
'initializers' => [
52+
Query\OAuth2ServerInitializer::class,
53+
],
54+
];
55+
}
56+
57+
/**
58+
* Return QueryProvider configuration.
59+
*
60+
* @return array
61+
*/
62+
public function getQueryProviderConfig()
63+
{
64+
return [
65+
'initializers' => [
66+
Query\OAuth2ServerInitializer::class,
67+
],
68+
];
69+
}
70+
}

src/Module.php

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Zend\ModuleManager\Feature\ConfigProviderInterface;
88
use Zend\Config\Config;
99
use Zend\Mvc\MvcEvent;
10+
use Zend\Loader\StandardAutoloader;
1011
use Zend\ServiceManager\ServiceLocatorInterface;
1112
use ZF\OAuth2\Doctrine\Adapter\DoctrineAdapterFactory;
1213

@@ -21,7 +22,7 @@ class Module implements
2122
*/
2223
public function getAutoloaderConfig()
2324
{
24-
return ['Zend\Loader\StandardAutoloader' => ['namespaces' => [
25+
return [StandardAutoloader::class => ['namespaces' => [
2526
__NAMESPACE__ => __DIR__,
2627
]]];
2728
}
@@ -33,7 +34,13 @@ public function getAutoloaderConfig()
3334
*/
3435
public function getConfig()
3536
{
36-
return include __DIR__ . '/../config/module.config.php';
37+
$provider = new ConfigProvider();
38+
39+
return [
40+
'service_manager' => $provider->getDependencyConfig(),
41+
'zf-apigility-doctrine-query-create-filter' => $provider->getQueryCreateFilterConfig(),
42+
'zf-apigility-doctrine-query-provider' => $provider->getQueryProviderConfig(),
43+
];
3744
}
3845

3946
public function onBootstrap(MvcEvent $e)
@@ -54,6 +61,7 @@ public function getServiceConfig()
5461
/** @var DoctrineAdapterFactory $factory */
5562
$factory = $serviceManager->get(DoctrineAdapterFactory::class);
5663
$factory->setConfig($config);
64+
5765
return $factory->createService($serviceManager);
5866
}
5967
],

0 commit comments

Comments
 (0)