Open gozoro opened 4 months ago
When php is launched with chroot as:
chroot
sudo /usr/sbin/chroot /opt/php55 /usr/bin/php "$@"
and in bash, run the command:
./yii
Method \yii\console\Request::resolve() throws exception 'yii\base\InvalidRouteException' with message 'Unable to resolve the request "--".'
'yii\base\InvalidRouteException' with message 'Unable to resolve the request "--".'
I expected the route to resolve as "help".
This happens because $_SERVER['argv'] contains an array:
Array ( [0] => /var/www/my_project/yii [1] => -- )
and route resolved as NULL.
Fix. Change this line https://github.com/yiisoft/yii2/blob/f2ea9be24225987b2acf2d6fdd2789e0a32b7fb0/framework/console/Request.php#L68 to
$route = (string)array_shift($rawParams);
What steps will reproduce the problem?
When php is launched with
chroot
as:sudo /usr/sbin/chroot /opt/php55 /usr/bin/php "$@"
and in bash, run the command:
./yii
Method \yii\console\Request::resolve() throws exception
'yii\base\InvalidRouteException' with message 'Unable to resolve the request "--".'
What is the expected result?
I expected the route to resolve as "help".
What do you get instead?
This happens because $_SERVER['argv'] contains an array:
and route resolved as NULL.
Additional info