Commit 9a9eeecd authored by Fabien Potencier's avatar Fabien Potencier

fixed a regression where the Silex.phar could not be used anymore to simulate requests on the CLI

parent 1cf18343
......@@ -481,12 +481,12 @@ Console
Silex includes a lightweight console for updating to the latest
version.
To find out which version of Silex you are using, just invoke
``silex.phar`` on the command-line without any arguments:
To find out which version of Silex you are using, invoke ``silex.phar`` on the
command-line with ``version`` as an argument:
.. code-block:: text
$ php silex.phar
$ php silex.phar version
Silex version 0a243d3 2011-04-17 14:49:31 +0200
To check that your are using the latest version, run the ``check`` command:
......
......@@ -105,10 +105,8 @@ Phar::mapPhar('silex.phar');
require_once 'phar://silex.phar/autoload.php';
if ('cli' === php_sapi_name()) {
$command = isset($argv[1]) ? $argv[1] : null;
switch ($command) {
if ('cli' === php_sapi_name() && isset($argv[1])) {
switch ($argv[1]) {
case 'update':
$remoteFilename = 'http://silex-project.org/get/silex.phar';
$localFilename = getcwd().'/silex.phar';
......@@ -126,10 +124,15 @@ if ('cli' === php_sapi_name()) {
}
break;
default:
case 'version':
printf("Silex version %s\n", Silex\Application::VERSION);
break;
default:
printf("Unkown command '%s' (available commands: version, check, and update).\n", $argv[1]);
}
exit(0);
}
__HALT_COMPILER();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment