Skip to content
This repository has been archived by the owner on Dec 14, 2023. It is now read-only.

Commit

Permalink
Now checks for updates of ICEcoder & CodeMirror
Browse files Browse the repository at this point in the history
Extended this process to check for firstly ICEcoder updates and then
CodeMirror
Both working via their own remotely sourced latest-version.txt files
If ICEcoder is up to date, if performs a check on CodeMirrors version
no.
  • Loading branch information
mattpass committed Jun 11, 2012
1 parent 49ca9d7 commit 229a089
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,18 @@
header('Location: /');
};

// Test for latest CodeMirror version
if ($testcMVersion) {
$cMLatestVer = json_encode(file_get_contents("http://codemirror.net/latest-version.txt"));
$cMLatestVer = rtrim(ltrim($cMLatestVer,"\""),"\"\\n");
if ($cMThisVer<$cMLatestVer) {
echo '<script>alert(\'Code Mirror '.$cMLatestVer.' now released\n\nPlease upgrade\');</script>';
// Check for updates of ICEcoder & CodeMirror
if ($checkUpdates) {
$ICEcoderLatestVer = json_encode(file_get_contents("http://icecoder.net/latest-version.txt"));
$ICEcoderLatestVer = rtrim(ltrim($ICEcoderLatestVer,"\""),"\"\\n");
if (ltrim($versionNo,"v ")<ltrim($ICEcoderLatestVer,"v ")) {
echo '<script>alert(\'ICEcoder '.$ICEcoderLatestVer.' now released\n\nPlease upgrade\');</script>';
} else {
$cMLatestVer = json_encode(file_get_contents("http://codemirror.net/latest-version.txt"));
$cMLatestVer = rtrim(ltrim($cMLatestVer,"\""),"\"\\n");
if ($cMThisVer<$cMLatestVer) {
echo '<script>alert(\'Code Mirror '.$cMLatestVer.' now released\n\nPlease upgrade\');</script>';
}
}
}
?>
Expand Down

0 comments on commit 229a089

Please sign in to comment.