Commit 33d8ddf8 authored by Igor Wiedler's avatar Igor Wiedler

temporary fix for the web stub

parent d9d397b1
...@@ -105,29 +105,31 @@ class Compiler ...@@ -105,29 +105,31 @@ class Compiler
require_once __DIR__.'/autoload.php'; require_once __DIR__.'/autoload.php';
$command = isset($argv[1]) ? $argv[1] : null; if ('cli' === php_sapi_name()) {
$command = isset($argv[1]) ? $argv[1] : null;
switch ($command) {
case 'update': switch ($command) {
$remoteFilename = 'http://silex-project.org/get/silex.phar'; case 'update':
$localFilename = getcwd().'/silex.phar'; $remoteFilename = 'http://silex-project.org/get/silex.phar';
$localFilename = getcwd().'/silex.phar';
file_put_contents($localFilename, file_get_contents($remoteFilename));
break; file_put_contents($localFilename, file_get_contents($remoteFilename));
break;
case 'check':
$latest = trim(file_get_contents('http://silex-project.org/get/version')); 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); if ($latest != Silex\Application::VERSION) {
} else { printf("A newer Silex version is available (%s).\n", $latest);
print("You are using the latest Silex version.\n"); } else {
} print("You are using the latest Silex version.\n");
break; }
break;
default:
printf("Silex version %s\n", Silex\Application::VERSION); default:
break; printf("Silex version %s\n", Silex\Application::VERSION);
break;
}
} }
__HALT_COMPILER(); __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