-
Notifications
You must be signed in to change notification settings - Fork 6
/
Module.php
69 lines (60 loc) · 2.25 KB
/
Module.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* @license http://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
* @copyright Copyright (c) 2014 Zend Technologies USA Inc. (http://www.zend.com)
*/
namespace ZF\OAuth2\Doctrine\Console;
use ZF\OAuth2\Client\Service\OAuth2Service;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface;
use Zend\Console\Adapter\AdapterInterface as Console;
/**
* ZF2 module
*/
class Module implements
ConfigProviderInterface,
ConsoleUsageProviderInterface
{
public function getConsoleUsage(Console $console)
{
return array(
'oauth2:client:create [--config=]' => 'Create client',
'oauth2:client:list [--config=]' => 'List clients',
'oauth2:client:update --id=# [--config=]' => 'Update client',
'oauth2:client:delete --id=# [--config=]' => 'Delete client',
'oauth2:scope:create [--config=]' => 'Create scope',
'oauth2:scope:list [--config=]' => 'List scopes',
'oauth2:scope:update --id=# [--config=]' => 'Update scope',
'oauth2:scope:delete --id=# [--config=]' => 'Delete scope',
'oauth2:public-key:create --id=# [--config=]' => 'Create public key. id is a client record.',
'oauth2:public-key:delete --id=# [--config=]' => 'Delete public key. id is a client record.',
'oauth2:jwt:create --id=# [--config=]' => 'Create a JWT entry. id is a client record.',
'oauth2:jwt:list [--config=]' => 'List JWT entries',
'oauth2:jwt:delete --id=# [--config=]' => 'Delete a JWT entry. id is a jwt record.',
);
}
/**
* Retrieve autoloader configuration
*
* @return array
*/
public function getAutoloaderConfig()
{
return array('Zend\Loader\StandardAutoloader' => array('namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/',
)));
}
/**
* Provide default configuration.
*
* @param return array
*/
public function getConfig()
{
$provider = new ConfigProvider();
return [
'controllers' => $provider->getControllerDependencyConfig(),
'console' => ['router' => $provider->getConsoleRouterConfig()],
];
}
}