Merge pull request #31 from nodiscc/version-check

Version check: check against latest version on github
This commit is contained in:
nodiscc 2014-10-23 17:41:06 +02:00
commit 57dbbe51a6
2 changed files with 2 additions and 1 deletions

View File

@ -133,7 +133,7 @@ function checkUpdate()
if (!is_file($GLOBALS['config']['UPDATECHECK_FILENAME']) || (filemtime($GLOBALS['config']['UPDATECHECK_FILENAME'])<time()-($GLOBALS['config']['UPDATECHECK_INTERVAL'])))
{
$version=shaarli_version;
list($httpstatus,$headers,$data) = getHTTP('http://sebsauvage.net/files/shaarli_version.txt',2);
list($httpstatus,$headers,$data) = getHTTP('https://raw.githubusercontent.com/shaarli/Shaarli/master/shaarli_version.txt',2);
if (strpos($httpstatus,'200 OK')!==false) $version=$data;
// If failed, never mind. We don't want to bother the user with that.
file_put_contents($GLOBALS['config']['UPDATECHECK_FILENAME'],$version); // touch file date

1
shaarli_version.txt Normal file
View File

@ -0,0 +1 @@
0.0.41 beta