include upgrader timestamp

document recent changes
i18n for upgrader
This commit is contained in:
Garvin Hicking
2014-04-25 09:55:41 +02:00
parent 919674e25a
commit 5e0c4c074e
70 changed files with 237 additions and 10 deletions
+1 -2
View File
@@ -44,12 +44,11 @@ $output = array();
serendipity_plugin_api::hook_event('backend_frontpage_display', $output);
$data['backend_frontpage_display'] = $output['more'];
$data['curVersion'] = serendipity_getCurrentVersion();
$data['usedVersion'] = $serendipity['version'];
$data['updateCheck'] = $serendipity['updateCheck'];
$data['curVersion'] = serendipity_getCurrentVersion();
$data['update'] = version_compare($data['usedVersion'], $data['curVersion'], '<');
$comments = serendipity_db_query("SELECT c.*, e.title FROM {$serendipity['dbPrefix']}comments c
LEFT JOIN {$serendipity['dbPrefix']}entries e ON (e.id = c.entry_id)
ORDER BY c.id DESC LIMIT 5");
+16 -4
View File
@@ -1204,15 +1204,24 @@ function serendipity_verifyFTPChecksums() {
* */
function serendipity_getCurrentVersion() {
global $serendipity;
if ($serendipity['updateCheck'] != "stable" && $serendipity['updateCheck'] != "beta") {
return -1;
}
// Perform update check once a day. We use a suffix of the configured channel, so when
// the user switches channels, it has its own timer.
if ($serendipity['last_update_check_' . $serendipity['updateCheck']] >= (time()-86400)) {
// Last update was performed less than a day ago. Return last result.
return $serendipity['last_update_version_' . $serendipity['updateCheck']];
}
serendipity_set_config_var('last_update_check_' . $serendipity['updateCheck'], time());
$updateURL = 'https://raw.github.com/s9y/Serendipity/master/docs/RELEASE';
$context = stream_context_create( array('http'=>array('timeout' => 5.0)) );
$context = stream_context_create(array('http' => array('timeout' => 5.0)));
$file = @file_get_contents($updateURL, false, $context);
$file = @file_get_contents($updateURL, false, $context);
if ( ! $file) {
if (!$file) {
if (function_exists('curl_init')) {
$ch = curl_init($updateURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
@@ -1225,14 +1234,17 @@ function serendipity_getCurrentVersion() {
if ($file) {
if ($serendipity['updateCheck'] == "stable") {
if (preg_match('/^stable:(.+)\b/', $file, $match)) {
serendipity_set_config_var('last_update_version_' . $serendipity['updateCheck'], $match[1]);
return $match[1];
}
} else {
if (preg_match('/^beta:(.+)\b/', $file, $match)) {
serendipity_set_config_var('last_update_version_' . $serendipity['updateCheck'], $match[1]);
return $match[1];
}
}
}
return -1;
}
+1 -1
View File
@@ -400,7 +400,7 @@
'permission' => 'blogConfiguration'),
array('var' => 'updateCheck',
'title' => UPDATE_NOTIFICATION,
'description' => "Show the update notification in the Dashboard, and for which channel?", # i18n
'description' => UPDATE_NOTIFICATION_DESC,
'type' => 'list',
'default' => array('stable' => 'stable', 'beta' => 'beta', 'false' => NO ), # i18n
'permission' => 'blogConfiguration'),