Skip to content

Commit

Permalink
Move the module to Server namespace to allow more flexibility
Browse files Browse the repository at this point in the history
  • Loading branch information
bakura10 committed Feb 13, 2014
1 parent 7971953 commit bb3e216
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
/**
* This file is placed here for compatibility with Zend Framework 2's ModuleManager.
* It allows usage of this module even without composer.
* The original Module.php is in 'src/ZfrOAuth2Module' in order to respect PSR-0
* The original Module.php is in 'src/ZfrOAuth2Module/Server' in order to respect PSR-0
*/
require_once __DIR__ . '/src/ZfrOAuth2Module/Module.php';
require_once __DIR__ . '/src/ZfrOAuth2Module/Server/Module.php';
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# ZfrOAuth2ServerModule
# ZfrOAuth2Module\Server

[![Build Status](https://travis-ci.org/zf-fr/zfr-oauth2-server-module.png?branch=master)](https://travis-ci.org/zf-fr/zfr-oauth2-server-module)
[![Latest Stable Version](https://poser.pugx.org/zfr/zfr-oauth2-server-module/v/stable.png)](https://packagist.org/packages/zfr/zfr-oauth2-server-module)
[![Coverage Status](https://coveralls.io/repos/zf-fr/zfr-oauth2-server-module/badge.png)](https://coveralls.io/r/zf-fr/zfr-oauth2-server-module)
[![Total Downloads](https://poser.pugx.org/zfr/zfr-oauth2-server-module/downloads.png)](https://packagist.org/packages/zfr/zfr-oauth2-server-module)

ZfrOAuth2ServerModule is a Zend Framework 2 module for ZfrOAuth2Server. Its goal is to easily create a OAuth 2
ZfrOAuth2Module\Server is a Zend Framework 2 module for ZfrOAuth2\Server. Its goal is to easily create a OAuth 2
compliant server.

## Requirements
Expand All @@ -27,13 +27,13 @@ php composer.phar require zfr/zfr-oauth2-server-module:0.1.*
```

Copy-paste the `zfr_oauth2_server.global.php.dist` file to your `autoload` folder, and enable the module by adding
`ZfrOAuth2Module` to your `application.config.php` file.
`ZfrOAuth2Module\Server` to your `application.config.php` file.

## Documentation

### Configuring the module

ZfrOAuth2Module provides a lot of default configuration. However, there are some information you need to provide.
ZfrOAuth2Module\Server provides a lot of default configuration. However, there are some information you need to provide.

#### Setting the User class

Expand Down Expand Up @@ -91,5 +91,7 @@ You can also pass a service key, that will be pulled from the service manager, i

### Delete expired tokens

ZfrOAuth2Module offers a console route you can use to delete expired access tokens. You can use this as a CRON
task to clean your database. In the `public` folder, use the following command: `php index.php oauth2 delete expired tokens`.
ZfrOAuth2Module\Server offers a console route you can use to delete expired access tokens. You can use this as a CRON
task to clean your database. In the `public` folder, use the following command:

`php index.php oauth2 server delete expired tokens`.
2 changes: 1 addition & 1 deletion config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
'delete-expired-tokens' => [
'type' => 'Simple',
'options' => [
'route' => 'oauth2 delete expired tokens',
'route' => 'oauth2 server delete expired tokens',
'defaults' => [
'controller' => 'ZfrOAuth2Module\Server\Controller\TokenController',
'action' => 'delete-expired-tokens'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* and is licensed under the MIT license.
*/

namespace ZfrOAuth2Module;
namespace ZfrOAuth2Module\Server;

use Zend\Console\Adapter\AdapterInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
Expand All @@ -40,7 +40,7 @@ class Module implements
*/
public function getConfig()
{
return include __DIR__ . '/../../config/module.config.php';
return include __DIR__ . '/../../../config/module.config.php';
}

/**
Expand All @@ -56,7 +56,7 @@ public function getModuleDependencies()
*/
public function getConsoleBanner(AdapterInterface $console)
{
return 'ZfrOAuth2Server';
return 'ZfrOAuth2Module\Server';
}

/**
Expand All @@ -65,7 +65,7 @@ public function getConsoleBanner(AdapterInterface $console)
public function getConsoleUsage(AdapterInterface $console)
{
return [
'oauth2 delete expired tokens' => 'Delete expired access tokens'
'oauth2 server delete expired tokens' => 'Delete expired access tokens'
];
}
}

0 comments on commit bb3e216

Please sign in to comment.