-
Notifications
You must be signed in to change notification settings - Fork 0
/
Module.php
84 lines (76 loc) · 2.14 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
81
82
83
84
<?php
namespace Flower;
/*
*
*
* @copyright Copyright (c) 2013-2014 KipsProduction (http://www.kips.gr.jp)
* @license http://www.kips.gr.jp/newbsd/LICENSE.txt New BSD License
*/
use Flower\Exception\RuntimeException;
use Zend\View\Model\ViewModel;
use Zend\Mvc\MvcEvent;
use Zend\Http\Response as HttpResponse;
class Module
{
public function getAutoloaderConfig()
{
return array(
'Zend\Loader\ClassMapAutoloader' => array(
__DIR__ . '/autoload_classmap.php',
),
'Zend\Loader\StandardAutoloader' => array(
'namespaces' => array(
__NAMESPACE__ => __DIR__ . '/src/' . __NAMESPACE__,
),
),
);
}
/**
*
* @see Flower\File\DefaultResolveListener
* @return string
*/
public static function dataDir()
{
return __DIR__ . '/data';
}
public static function getSalt()
{
$path = __DIR__ . '/data/salt.php';
$distPath = __DIR__ . '/data/salt.php.dist';
if (! is_readable($path)) {
error_log('please set your salt in ' . $path, E_USER_NOTICE);
if (! is_readable($distPath)) {
throw new RuntimeException('Please set salt in '. $path);
} else {
return include($distPath);
}
}
return include($path);
}
public function getConfig()
{
$config = include __DIR__ . '/config/module.config.php';
return $config;
}
public function getServiceConfig()
{
return array(
/*'factories' => array(
'Flower\Model\ItemTable' => function($sm) {
$dbAdapter = $sm->get('Zend\Db\Adapter\Adapter');
$table = new Model\ItemTable($dbAdapter);
return $table;
},
),*/
);
}
public function getProvides()
{
return array(
__NAMESPACE__ => array(
'version' => '0.1.0'
),
);
}
}