forked from integritycrew/hyphers-visio-crud-zf2
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathModule.php
66 lines (61 loc) · 2.81 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
<?php
/**
* @todo add module information
*/
namespace VisioCrudModeler;
use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\ModuleManager\Feature\ConsoleBannerProviderInterface;
use Zend\ModuleManager\Feature\ConsoleUsageProviderInterface;
class Module implements ConsoleBannerProviderInterface, ConsoleUsageProviderInterface
{
public function onBootstrap(MvcEvent $e)
{
$eventManager = $e->getApplication()->getEventManager();
$moduleRouteListener = new ModuleRouteListener();
$moduleRouteListener->attach($eventManager);
}
public function getConfig()
{
return include __DIR__ . '/config/module.config.php';
}
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__
)
)
);
}
/*
* (non-PHPdoc)
* @see \Zend\ModuleManager\Feature\ConsoleBannerProviderInterface::getConsoleBanner()
*/
public function getConsoleBanner(\Zend\Console\Adapter\AdapterInterface $console)
{
return "HyPHPers visio crud ZF2 v.alpha";
}
/*
* (non-PHPdoc)
* @see \Zend\ModuleManager\Feature\ConsoleUsageProviderInterface::getConsoleUsage()
*/
public function getConsoleUsage(\Zend\Console\Adapter\AdapterInterface $console)
{
return array(
'Available commands',
'list generators'=>'Lists all available generators to use',
'generate <generator>'=>"runs given generator, you could use also 'all' and it will run all available generators",
'optionall parameters supported by generators',
array('--author=AUTHOR','phpdoc author','Name used in PHPDocumentor tag @author where available'),
array('--copyright=COPYRIGHT','phpdoc copyright','Name used in PHPDocumentor tag @copyright where available'),
array('--project=PROJECT','phpdoc project','Name used in PHPDocumentor tag @project where available'),
array('--license=LICENSE','phpdoc license','Name used in PHPDocumentor tag @license where available'),
array('--modulesDirectory=PATH','relative path','Relative path to ZF2 modules directory, needs to be writable. Generator will write all files to it.'),
array('--moduleName=NAME','ZF2 module name','Name for generated module. will be used as Namespace root and module directory name'),
array('--adapterServiceKey=NAME','service name','Name used to retrieve data adapter, used by descriptors to discover Data Source structure'),
array('--descriptor=NAME','descriptor name','Name of descriptor used in generators')
);
}
}