Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
S
Silex
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
common
Silex
Commits
d9d397b1
Commit
d9d397b1
authored
Apr 17, 2011
by
Fabien Potencier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added a command to check if a newer version of Silex is available
parent
0a243d3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
doc/usage.rst
doc/usage.rst
+7
-1
src/Silex/Compiler.php
src/Silex/Compiler.php
+11
-1
No files found.
doc/usage.rst
View file @
d9d397b1
...
@@ -392,7 +392,13 @@ To find out which version of Silex you are using, just invoke
...
@@ -392,7 +392,13 @@ To find out which version of Silex you are using, just invoke
.. code-block:: text
.. code-block:: text
$ php silex.phar
$ 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``
To update ``silex.phar`` to the latest version, invoke the ``update``
command:
command:
...
...
src/Silex/Compiler.php
View file @
d9d397b1
...
@@ -115,8 +115,18 @@ switch ($command) {
...
@@ -115,8 +115,18 @@ switch ($command) {
file_put_contents($localFilename, file_get_contents($remoteFilename));
file_put_contents($localFilename, file_get_contents($remoteFilename));
break;
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:
default:
echo "Silex version ".Silex\Application::VERSION."\n"
;
printf("Silex version %s\n", Silex\Application::VERSION)
;
break;
break;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment