File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change 5
5
6
6
const SUCCESS = 0 ,
7
7
WITH_ERRORS = 1 ,
8
- FAILED = 255 ;
8
+ FAILED = 254 ; // 255 code is reserved to PHP itself
9
9
10
10
if (PHP_VERSION < '5.4.0 ' ) {
11
- die ("PHP Var Dump Check require PHP 5.4.0 and newer " );
11
+ fwrite (STDERR ,"PHP Var Dump Check require PHP 5.4.0 and newer " );
12
+ die (FAILED );
12
13
}
13
14
14
- function showOptions ()
15
- {
15
+ function showOptions () {
16
16
?>
17
17
Options:
18
18
--tracy Enable support for Tracy (Debugger::dump)
@@ -62,17 +62,19 @@ function showOptions()
62
62
}
63
63
64
64
if (!$ autoloadFileFound ) {
65
- die (
65
+ fwrite ( STDERR ,
66
66
'You need to set up the project dependencies using the following commands: ' . PHP_EOL .
67
67
'curl -s http://getcomposer.org/installer | php ' . PHP_EOL .
68
68
'php composer.phar install ' . PHP_EOL
69
69
);
70
+ die (FAILED );
70
71
}
71
72
72
73
try {
73
74
$ settings = PhpVarDumpCheck \Settings::parseArguments ($ _SERVER ['argv ' ]);
74
75
} catch (PhpVarDumpCheck \Exception \InvalidArgument $ e ) {
75
- echo "Invalid option {$ e ->getArgument ()}" . PHP_EOL . PHP_EOL ;
76
+ fwrite (STDERR , "Invalid option {$ e ->getArgument ()}" . PHP_EOL );
77
+ echo PHP_EOL ;
76
78
showOptions ();
77
79
die (FAILED );
78
80
}
@@ -82,6 +84,6 @@ function showOptions()
82
84
$ status = $ check ->check ($ settings );
83
85
die ($ status ? SUCCESS : WITH_ERRORS );
84
86
} catch (PhpVarDumpCheck \Exception \Exception $ e ) {
85
- echo $ e ->getMessage () . PHP_EOL ;
87
+ fwrite ( STDERR , $ e ->getMessage () . PHP_EOL ) ;
86
88
die (FAILED );
87
89
}
You can’t perform that action at this time.
0 commit comments