aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rwxr-xr-xinc/poche/Poche.class.php14
-rw-r--r--themes/baggy/config.twig5
2 files changed, 14 insertions, 5 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 0c4143e1..ba262c98 100755
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -582,8 +582,12 @@ class Poche
582 switch ($view) 582 switch ($view)
583 { 583 {
584 case 'config': 584 case 'config':
585 $dev = trim($this->getPocheVersion('dev')); 585 $dev_infos = $this->getPocheVersion('dev');
586 $prod = trim($this->getPocheVersion('prod')); 586 $dev = trim($dev_infos[0]);
587 $check_time_dev = date('d-M-Y H:i', $dev_infos[1]);
588 $prod_infos = $this->getPocheVersion('prod');
589 $prod = trim($prod_infos[0]);
590 $check_time_prod = date('d-M-Y H:i', $prod_infos[1]);
587 $compare_dev = version_compare(POCHE, $dev); 591 $compare_dev = version_compare(POCHE, $dev);
588 $compare_prod = version_compare(POCHE, $prod); 592 $compare_prod = version_compare(POCHE, $prod);
589 $themes = $this->getInstalledThemes(); 593 $themes = $this->getInstalledThemes();
@@ -595,6 +599,8 @@ class Poche
595 'languages' => $languages, 599 'languages' => $languages,
596 'dev' => $dev, 600 'dev' => $dev,
597 'prod' => $prod, 601 'prod' => $prod,
602 'check_time_dev' => $check_time_dev,
603 'check_time_prod' => $check_time_prod,
598 'compare_dev' => $compare_dev, 604 'compare_dev' => $compare_dev,
599 'compare_prod' => $compare_prod, 605 'compare_prod' => $compare_prod,
600 'token' => $token, 606 'token' => $token,
@@ -1105,15 +1111,17 @@ class Poche
1105 private function getPocheVersion($which = 'prod') 1111 private function getPocheVersion($which = 'prod')
1106 { 1112 {
1107 $cache_file = CACHE . '/' . $which; 1113 $cache_file = CACHE . '/' . $which;
1114 $check_time = time();
1108 1115
1109 # checks if the cached version file exists 1116 # checks if the cached version file exists
1110 if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) { 1117 if (file_exists($cache_file) && (filemtime($cache_file) > (time() - 86400 ))) {
1111 $version = file_get_contents($cache_file); 1118 $version = file_get_contents($cache_file);
1119 $check_time = filemtime($cache_file);
1112 } else { 1120 } else {
1113 $version = file_get_contents('http://static.wallabag.org/versions/' . $which); 1121 $version = file_get_contents('http://static.wallabag.org/versions/' . $which);
1114 file_put_contents($cache_file, $version, LOCK_EX); 1122 file_put_contents($cache_file, $version, LOCK_EX);
1115 } 1123 }
1116 return $version; 1124 return array($version, $check_time);
1117 } 1125 }
1118 1126
1119 public function generateToken() 1127 public function generateToken()
diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig
index b37ac115..33de701e 100644
--- a/themes/baggy/config.twig
+++ b/themes/baggy/config.twig
@@ -25,9 +25,10 @@
25 <h2>{% trans "Upgrading wallabag" %}</h2> 25 <h2>{% trans "Upgrading wallabag" %}</h2>
26 <ul> 26 <ul>
27 <li>{% trans "Installed version" %} : <strong>{{ constant('POCHE') }}</strong></li> 27 <li>{% trans "Installed version" %} : <strong>{{ constant('POCHE') }}</strong></li>
28 <li>{% trans "Latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent stable version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %}</li> 28 <li>{% trans "Latest stable version" %} : {{ prod }}. {% if compare_prod == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent stable version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %} ({% trans "Last check:" %} {{ check_time_prod }})</li>
29 {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "Latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent development version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %}</li>{% endif %} 29 {% if constant('DEBUG_POCHE') == 1 %}<li>{% trans "Latest dev version" %} : {{ dev }}. {% if compare_dev == -1 %}<strong><a href="http://wallabag.org/">{% trans "A more recent development version is available." %}</a></strong>{% else %}{% trans "You are up to date." %}{% endif %} ({% trans "Last check:" %} {{ check_time_dev }}){% endif %}</li>
30 </ul> 30 </ul>
31 <p>{% trans "You can clear cache to check the latest release." %}</p>
31 32
32 <h2>{% trans "Feeds" %}</h2> 33 <h2>{% trans "Feeds" %}</h2>
33 {% if token == '' %} 34 {% if token == '' %}