summaryrefslogtreecommitdiff
path: root/app/Controllers/updateController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-08 20:07:09 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-08 20:07:09 +0200
commitd59eebf5423afb94ff68550aa9218674889ab4ad (patch)
treed8e1450a4cfffd8d516bb7c4c5adc092fa0f6d57 /app/Controllers/updateController.php
parent48f91da2e5d7da4d8a4f11987116bfc8cbf049ca (diff)
Add data/last_update.txt
Remember last update timestamp.
Diffstat (limited to 'app/Controllers/updateController.php')
-rw-r--r--app/Controllers/updateController.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php
index 5d5ec3586..5424792f4 100644
--- a/app/Controllers/updateController.php
+++ b/app/Controllers/updateController.php
@@ -11,7 +11,11 @@ class FreshRSS_update_Controller extends Minz_ActionController {
}
Minz_View::prependTitle(_t('update_system') . ' ยท ');
- $this->view->last_update_time = 'unknown'; // TODO
+ $this->view->last_update_time = 'unknown';
+ $timestamp = (int)@file_get_contents(DATA_PATH . '/last_update.txt');
+ if (is_numeric($timestamp) && $timestamp > 0) {
+ $this->view->last_update_time = timestamptodate($timestamp);
+ }
}
public function indexAction() {
@@ -99,8 +103,7 @@ class FreshRSS_update_Controller extends Minz_ActionController {
if ($res === true) {
@unlink(UPDATE_FILENAME);
-
- // TODO: record last update_finished
+ @file_put_contents(DATA_PATH . '/last_update.txt', time());
Minz_Request::good(_t('update_finished'));
} else {