FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ZendDeveloperTools/Module.php at master · EvanDotPro/ZendDeveloperTools · GitHub
EvanDotPro
/
ZendDeveloperTools
Public
forked from
zendframework/zend-developer-tools
Notifications
You must be signed in to change notification settings
Fork
1
Star
2
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
ZendDeveloperTools
/
Module.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
92 lines (83 loc) · 2.91 KB
Breadcrumbs
ZendDeveloperTools
/
Module.php
Copy path
File metadata and controls
92 lines (83 loc) · 2.91 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
85
86
87
88
89
90
91
92
<?php
/**
* ZendDeveloperTools
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://framework.zend.com/license/new-bsd
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@zend.com so we can send you a copy immediately.
*
* @category Zend
* @package ZendDeveloperTools
* @subpackage Module
* @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace
ZendDeveloperTools
;
use
Zend
\
Module
\
Manager
,
Zend
\
Module
\
Consumer
\
AutoloaderProvider
,
Zend
\
EventManager
\
StaticEventManager
;
class
Module
implements
AutoloaderProvider
{
protected
$
viewListener
;
protected
$
view
;
public
function
init
(
Manager
$
moduleManager
)
{
Service
\DeveloperTools::
$
startTime
=
microtime
(
true
);
$
events
= StaticEventManager::
getInstance
();
$
events
->
attach
(
'
bootstrap
'
,
'
bootstrap
'
,
array
(
$
this
,
'
initializeView
'
),
1000
);
$
events
->
attach
(
'
Zend\Mvc\Application
'
,
'
finish
'
,
function
(
$
e
) {
Service
\DeveloperTools::
$
stopTime
=
microtime
(
true
);
$
devToolService
=
new
Service
\
DeveloperTools
;
return
$
devToolService
->
appendResponse
(
$
e
);
});
}
public
function
getAutoloaderConfig
()
{
return
array
(
'
Zend\Loader\ClassMapAutoloader
'
=>
array
(
__DIR__
.
'
/autoload_classmap.php
'
,
),
'
Zend\Loader\StandardAutoloader
'
=>
array
(
'
namespaces
'
=>
array
(
__NAMESPACE__
=>
__DIR__
.
'
/src/
'
.
__NAMESPACE__
,
),
),
);
}
public
function
getConfig
(
$
env
=
null
)
{
return
include
__DIR__
.
'
/config/module.config.php
'
;
}
public
function
initializeView
(
$
e
)
{
$
app
=
$
e
->
getParam
(
'
application
'
);
$
locator
=
$
app
->
getLocator
();
$
config
=
$
e
->
getParam
(
'
config
'
);
$
view
=
$
this
->
getView
(
$
app
);
$
viewListener
=
$
this
->
getViewListener
(
$
view
,
$
config
);
$
events
= StaticEventManager::
getInstance
();
$
viewListener
->
registerStaticListeners
(
$
events
,
$
locator
);
}
protected
function
getViewListener
(
$
view
,
$
config
)
{
if
(
$
this
->
viewListener
instanceof
View
\Listener) {
return
$
this
->
viewListener
;
}
$
viewListener
=
new
View
\
Listener
(
$
view
,
$
config
->
zend_developer_tools
->
layout
);
$
this
->
viewListener
=
$
viewListener
;
return
$
viewListener
;
}
protected
function
getView
(
$
app
)
{
if
(
$
this
->
view
===
null
) {
$
this
->
view
=
$
app
->
getLocator
()->
get
(
'
view
'
);
}
return
$
this
->
view
;
}
}
Back
|
FazBrowse Home
|
New Git URL