FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
phalcon-devtools/phalcon.php at master · InteLigent/phalcon-devtools · GitHub
InteLigent
/
phalcon-devtools
Public
forked from
phalcon/phalcon-devtools
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
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
phalcon-devtools
/
phalcon.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
98 lines (79 loc) · 3.4 KB
Breadcrumbs
phalcon-devtools
/
phalcon.php
Copy path
File metadata and controls
executable file
·
98 lines (79 loc) · 3.4 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
93
94
95
96
97
98
#!/usr/bin/env php
<?php
/*
+------------------------------------------------------------------------+
| Phalcon Developer Tools |
+------------------------------------------------------------------------+
| Copyright (c) 2011-2014 Phalcon Team (http://www.phalconphp.com) |
+------------------------------------------------------------------------+
| This source file is subject to the New BSD License that is bundled |
| with this package in the file docs/LICENSE.txt. |
| |
| 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@phalconphp.com so we can send you a copy immediately. |
+------------------------------------------------------------------------+
| Authors: Andres Gutierrez <andres@phalconphp.com> |
| Eduar Carvajal <eduar@phalconphp.com> |
+------------------------------------------------------------------------+
*/
error_reporting
(
E_ALL
);
use
Phalcon
\
Script
;
use
Phalcon
\
Version
;
use
Phalcon
\
Script
\
Color
;
use
Phalcon
\
Commands
\
CommandsListener
;
use
Phalcon
\
Loader
;
use
Phalcon
\
Events
\
Manager
as
EventsManager
;
use
Phalcon
\
Exception
as
PhalconException
;
try
{
$
extensionLoaded
=
true
;
if
(!
extension_loaded
(
'
phalcon
'
)) {
$
extensionLoaded
=
false
;
throw
new
Exception
(
'
Phalcon extension isn
\'
t installed, follow these instructions to install it: http://docs.phalconphp.com/en/latest/reference/install.html
'
);
}
$
loader
=
new
Loader
();
$
loader
->
registerDirs
(
array
(
__DIR__
.
'
/scripts/
'
));
$
loader
->
registerNamespaces
(
array
(
'
Phalcon
'
=>
__DIR__
.
'
/scripts/
'
));
$
loader
->
register
();
if
(Version::
getId
() < Script::
COMPATIBLE_VERSION
) {
throw
new
PhalconException
(
'
Your Phalcon version isn
\'
t compatible with Developer Tools, download the latest at: http://phalconphp.com/download
'
);
}
if
(!
defined
(
'
TEMPLATE_PATH
'
)) {
define
(
'
TEMPLATE_PATH
'
,
__DIR__
.
'
/templates
'
);
}
$
vendor
=
sprintf
(
'
Phalcon DevTools (%s)
'
, Version::
get
());
print
PHP_EOL
. Color::
colorize
(
$
vendor
, Color::
FG_GREEN
, Color::
AT_BOLD
) .
PHP_EOL
.
PHP_EOL
;
$
eventsManager
=
new
EventsManager
();
$
eventsManager
->
attach
(
'
command
'
,
new
CommandsListener
());
$
script
=
new
Script
(
$
eventsManager
);
$
commandsToEnable
=
array
(
'
\Phalcon\Commands\Builtin\Enumerate
'
,
'
\Phalcon\Commands\Builtin\Controller
'
,
'
\Phalcon\Commands\Builtin\Model
'
,
'
\Phalcon\Commands\Builtin\AllModels
'
,
'
\Phalcon\Commands\Builtin\Project
'
,
'
\Phalcon\Commands\Builtin\Scaffold
'
,
'
\Phalcon\Commands\Builtin\Migration
'
,
'
\Phalcon\Commands\Builtin\Webtools
'
);
foreach
(
$
commandsToEnable
as
$
command
) {
$
script
->
attach
(
new
$
command
(
$
script
,
$
eventsManager
));
}
$
script
->
run
();
}
catch
(
PhalconException
$
e
) {
if
(
$
extensionLoaded
) {
print
Color::
error
(
$
e
->
getMessage
()) .
PHP_EOL
;
}
else
{
print
'
ERROR:
'
.
$
e
->
getMessage
() .
PHP_EOL
;
}
}
catch
(
Exception
$
e
) {
if
(
$
extensionLoaded
) {
print
Color::
error
(
$
e
->
getMessage
()) .
PHP_EOL
;
}
else
{
print
'
ERROR:
'
.
$
e
->
getMessage
() .
PHP_EOL
;
}
}
Back
|
FazBrowse Home
|
New Git URL