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

temporary fix for the web stub

parent d9d397b1
......@@ -105,29 +105,31 @@ class Compiler
require_once __DIR__.'/autoload.php';
$command = isset($argv[1]) ? $argv[1] : null;
switch ($command) {
case 'update':
$remoteFilename = 'http://silex-project.org/get/silex.phar';
$localFilename = getcwd().'/silex.phar';
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:
printf("Silex version %s\n", Silex\Application::VERSION);
break;
if ('cli' === php_sapi_name()) {
$command = isset($argv[1]) ? $argv[1] : null;
switch ($command) {
case 'update':
$remoteFilename = 'http://silex-project.org/get/silex.phar';
$localFilename = getcwd().'/silex.phar';
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:
printf("Silex version %s\n", Silex\Application::VERSION);
break;
}
}
__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