Commit d9d397b1 authored by Fabien Potencier's avatar Fabien Potencier

added a command to check if a newer version of Silex is available

parent 0a243d3c
......@@ -392,7 +392,13 @@ To find out which version of Silex you are using, just invoke
.. code-block:: text
$ php silex.phar
Silex version 1ee6b36
Silex version 0a243d3 2011-04-17 14:49:31 +0200
To check that your are using the latest version, run the ``check`` command:
.. code-block:: text
$ php silex.phar check
To update ``silex.phar`` to the latest version, invoke the ``update``
command:
......
......@@ -115,8 +115,18 @@ switch ($command) {
file_put_contents($localFilename, file_get_contents($remoteFilename));
break;
case 'check':
$latest = trim(file_get_contents('http://silex-project.org/get/version'));
if ($latest != Silex\Application::VERSION) {
printf("A newer Silex version is available (%s).\n", $latest);
} else {
print("You are using the latest Silex version.\n");
}
break;
default:
echo "Silex version ".Silex\Application::VERSION."\n";
printf("Silex version %s\n", Silex\Application::VERSION);
break;
}
......
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