aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Poche.class.php')
-rwxr-xr-xinc/poche/Poche.class.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 5a89a8d2..fb4e1a7f 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -534,8 +534,12 @@ class Poche
534 switch ($view) 534 switch ($view)
535 { 535 {
536 case 'config': 536 case 'config':
537 $dev = trim($this->getPocheVersion('dev')); 537 $dev_infos = $this->getPocheVersion('dev');
538 $prod = trim($this->getPocheVersion('prod')); 538 $dev = trim($dev_infos[0]);
539 $check_time_dev = date('d-M-Y H:i', $dev_infos[1]);
540 $prod_infos = $this->getPocheVersion('prod');
541 $prod = trim($prod_infos[0]);
542 $check_time_prod = date('d-M-Y H:i', $prod_infos[1]);
539 $compare_dev = version_compare(POCHE, $dev); 543 $compare_dev = version_compare(POCHE, $dev);
540 $compare_prod = version_compare(POCHE, $prod); 544 $compare_prod = version_compare(POCHE, $prod);
541 $themes = $this->getInstalledThemes(); 545 $themes = $this->getInstalledThemes();
@@ -547,6 +551,8 @@ class Poche
547 'languages' => $languages, 551 'languages' => $languages,
548 'dev' => $dev, 552 'dev' => $dev,
549 'prod' => $prod, 553 'prod' => $prod,
554 'check_time_dev' => $check_time_dev,
555 'check_time_prod' => $check_time_prod,
550 'compare_dev' => $compare_dev, 556 'compare_dev' => $compare_dev,
551 'compare_prod' => $compare_prod, 557 'compare_prod' => $compare_prod,
552 'token' => $token, 558 'token' => $token,
@@ -1067,15 +1073,17 @@ class Poche
1067 private function getPocheVersion($which = 'prod') 1073 private function getPocheVersion($which = 'prod')
1068 { 1074 {
1069 $cache_file = CACHE . '/' . $which; 1075 $cache_file = CACHE . '/' . $which;
1076 $check_time = time();
1070 1077
1071 # checks if the cached version file exists 1078 # checks if the cached version file exists
1072 if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) { 1079 if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) {
1073 $version = file_get_contents($cache_file); 1080 $version = file_get_contents($cache_file);
1081 $check_time = filemtime($cache_file);
1074 } else { 1082 } else {
1075 $version = file_get_contents('http://static.wallabag.org/versions/' . $which); 1083 $version = file_get_contents('http://static.wallabag.org/versions/' . $which);
1076 file_put_contents($cache_file, $version, LOCK_EX); 1084 file_put_contents($cache_file, $version, LOCK_EX);
1077 } 1085 }
1078 return $version; 1086 return array($version, $check_time);
1079 } 1087 }
1080 1088
1081 public function generateToken() 1089 public function generateToken()
@@ -1109,8 +1117,9 @@ class Poche
1109 $feed = new FeedWriter(RSS2); 1117 $feed = new FeedWriter(RSS2);
1110 $feed->setTitle('wallabag — ' . $type . ' feed'); 1118 $feed->setTitle('wallabag — ' . $type . ' feed');
1111 $feed->setLink(Tools::getPocheUrl()); 1119 $feed->setLink(Tools::getPocheUrl());
1112 $feed->setChannelElement('updated', date(DATE_RSS , time())); 1120 $feed->setChannelElement('pubDate', date(DATE_RSS , time()));
1113 $feed->setChannelElement('author', 'wallabag'); 1121 $feed->setChannelElement('generator', 'wallabag');
1122 $feed->setDescription('wallabag ' . $type . ' elements');
1114 1123
1115 if ($type == 'tag') { 1124 if ($type == 'tag') {
1116 $entries = $this->store->retrieveEntriesByTag($tag_id, $user_id); 1125 $entries = $this->store->retrieveEntriesByTag($tag_id, $user_id);