diff options
Diffstat (limited to 'application/front/controller/admin/ServerController.php')
-rw-r--r-- | application/front/controller/admin/ServerController.php | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/application/front/controller/admin/ServerController.php b/application/front/controller/admin/ServerController.php index bfc99422..780151dd 100644 --- a/application/front/controller/admin/ServerController.php +++ b/application/front/controller/admin/ServerController.php | |||
@@ -25,9 +25,16 @@ class ServerController extends ShaarliAdminController | |||
25 | */ | 25 | */ |
26 | public function index(Request $request, Response $response): Response | 26 | public function index(Request $request, Response $response): Response |
27 | { | 27 | { |
28 | $latestVersion = 'v' . ApplicationUtils::getVersion( | 28 | $releaseUrl = ApplicationUtils::$GITHUB_URL . '/releases/'; |
29 | ApplicationUtils::$GIT_RAW_URL . '/latest/' . ApplicationUtils::$VERSION_FILE | 29 | if ($this->container->conf->get('updates.check_updates', true)) { |
30 | ); | 30 | $latestVersion = 'v' . ApplicationUtils::getVersion( |
31 | ApplicationUtils::$GIT_RAW_URL . '/latest/' . ApplicationUtils::$VERSION_FILE | ||
32 | ); | ||
33 | $releaseUrl .= 'tag/' . $latestVersion; | ||
34 | } else { | ||
35 | $latestVersion = t('Check disabled'); | ||
36 | } | ||
37 | |||
31 | $currentVersion = ApplicationUtils::getVersion('./shaarli_version.php'); | 38 | $currentVersion = ApplicationUtils::getVersion('./shaarli_version.php'); |
32 | $currentVersion = $currentVersion === 'dev' ? $currentVersion : 'v' . $currentVersion; | 39 | $currentVersion = $currentVersion === 'dev' ? $currentVersion : 'v' . $currentVersion; |
33 | $phpEol = new \DateTimeImmutable(ApplicationUtils::getPhpEol(PHP_VERSION)); | 40 | $phpEol = new \DateTimeImmutable(ApplicationUtils::getPhpEol(PHP_VERSION)); |
@@ -37,7 +44,7 @@ class ServerController extends ShaarliAdminController | |||
37 | $this->assignView('php_has_reached_eol', $phpEol < new \DateTimeImmutable()); | 44 | $this->assignView('php_has_reached_eol', $phpEol < new \DateTimeImmutable()); |
38 | $this->assignView('php_extensions', ApplicationUtils::getPhpExtensionsRequirement()); | 45 | $this->assignView('php_extensions', ApplicationUtils::getPhpExtensionsRequirement()); |
39 | $this->assignView('permissions', ApplicationUtils::checkResourcePermissions($this->container->conf)); | 46 | $this->assignView('permissions', ApplicationUtils::checkResourcePermissions($this->container->conf)); |
40 | $this->assignView('release_url', ApplicationUtils::$GITHUB_URL . '/releases/tag/' . $latestVersion); | 47 | $this->assignView('release_url', $releaseUrl); |
41 | $this->assignView('latest_version', $latestVersion); | 48 | $this->assignView('latest_version', $latestVersion); |
42 | $this->assignView('current_version', $currentVersion); | 49 | $this->assignView('current_version', $currentVersion); |
43 | $this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode')); | 50 | $this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode')); |