mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-08 01:26:47 +01:00
Now checks for updates of ICEcoder & CodeMirror
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.
This commit is contained in:
18
index.php
18
index.php
@@ -10,12 +10,18 @@ if (!$allowedIP) {
|
||||
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>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user