mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-27 01:39:22 +02:00
* some better info when fetching latest version
This commit is contained in:
parent
26b88d9d42
commit
6e6ce55a7b
@ -14,17 +14,28 @@ $title = 'Version check';
|
|||||||
// fetch version
|
// fetch version
|
||||||
//$file = @fopen('http://my-aac.org/VERSION', 'r') or die('Error while fetching version.');
|
//$file = @fopen('http://my-aac.org/VERSION', 'r') or die('Error while fetching version.');
|
||||||
//$myaac_version = fgets($file);
|
//$myaac_version = fgets($file);
|
||||||
$myaac_version = file_get_contents('http://my-aac.org/VERSION');
|
$myaac_version = @file_get_contents('http://my-aac.org/VERSION');
|
||||||
|
if(!$myaac_version) {
|
||||||
|
warning('Error while fetching version info from http://my-aac.org. Site might be offline.');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// compare them
|
// compare them
|
||||||
if(version_compare($myaac_version, MYAAC_VERSION) <= 0)
|
$version_compare = version_compare($myaac_version, MYAAC_VERSION);
|
||||||
echo '<p class="success">MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.
|
if($version_compare == 0) {
|
||||||
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here') . '</p>';
|
success('MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.
|
||||||
else
|
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
||||||
echo '<p class="warning">You\'re using outdated version.<br/>
|
}
|
||||||
|
else if($version_compare < 0) {
|
||||||
|
echo success('Woah, seems you\'re using newer version as latest released one! MyAAC latest released version is ' . $myaac_version . ', and you\'re using version ' . MYAAC_VERSION . '.
|
||||||
|
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
warning('You\'re using outdated version.<br/>
|
||||||
Your version: <b>' . MYAAC_VERSION . '</b><br/>
|
Your version: <b>' . MYAAC_VERSION . '</b><br/>
|
||||||
Latest version: <b>' . $myaac_version . '</b><br/>
|
Latest version: <b>' . $myaac_version . '</b><br/>
|
||||||
Download available at: <a href="http://my-aac.org" target="_blank">www.my-aac.org</a></p>';
|
Download available at: <a href="http://my-aac.org" target="_blank">www.my-aac.org</a>');
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
function version_revert($version)
|
function version_revert($version)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user