Skip to content
This repository was archived by the owner on Jan 23, 2019. It is now read-only.

Commit 35cba39

Browse files
committed
bug fixed
1 parent d8e0c52 commit 35cba39

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/console/Input.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@ class Input
3333
* e.g `./bin/app` OR `bin/cli.php`
3434
* @var string
3535
*/
36-
public static $scriptName;
36+
public static $scriptName = '';
3737

3838
/**
3939
* the script name
4040
* e.g `image/packTask` OR `start`
4141
* @var string
4242
*/
43-
public static $command;
43+
public static $command = '';
4444

4545
public function __construct($parseArgv = true, $fixServer = false, $fillToGlobal = false)
4646
{
@@ -128,10 +128,6 @@ public static function parseGlobalArgv($fixServer = false, $fillToGlobal = false
128128
global $argv;
129129
$args = $argv;
130130

131-
if ($args[0] === 'php') {
132-
array_shift($args);
133-
}
134-
135131
self::$scriptName = array_shift($args);
136132

137133
if ($fixServer) {
@@ -153,7 +149,7 @@ public static function parseGlobalArgv($fixServer = false, $fillToGlobal = false
153149
}
154150

155151
// collect command
156-
if ( isset($args[0]) && strpos($args[0], '=') === false ) {
152+
if ( isset($args[0]) && $args[0]{0} !== '-' && strpos($args[0], '=') === false ) {
157153
self::$command = trim(array_shift($args), '/');
158154

159155
if ($fixServer) {

0 commit comments

Comments
 (0)