-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
80 lines (71 loc) · 2.39 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
70
71
72
73
74
75
76
77
78
79
80
<?php
namespace InstallScripts;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\ConfigProviderInterface;
use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface;
use Zend\Console\Adapter\AdapterInterface as Console;
/**
* Class Module
*
* @package InstallScripts
*/
class Module implements
AutoloaderProviderInterface,
ConfigProviderInterface,
ConsoleUsageProviderInterface
{
/** @var array */
protected $config;
/**
* @return array
*/
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/src/' . __NAMESPACE__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
/**
* @return array
*/
public function getConfig($key = null)
{
if (null === $this->config) {
$this->config = array_merge(
include __DIR__ . '/config/router.config.php',
include __DIR__ . '/config/controllers.config.php'
);
}
if (!empty($key)) {
return $this->config[$key];
}
return $this->config;
}
/**
* @return array
*/
public function getConsoleUsage(Console $console)
{
return array(
'install-scripts list' => 'show install scripts list',
'install-scripts versions [<script>]' => 'show script versions',
'install-scripts config' => 'shows configuration',
'install-scripts set-latest' => 'set all scripts to latest version',
'install-scripts set <script> <version>' => 'set version without executing scripts',
'install-scripts install <script> <version>' => 'install specific version',
'install-scripts update [<script>]' => 'install scripts incrementally to latest version',
// parameters
array('script', 'Install script name' ),
array('version', 'Install script version number'),
array('<parameter>', 'Mandatory'),
array('[<parameter>]', 'Optional'),
);
}
}