From: ArthurHoaro Date: Tue, 10 Nov 2020 09:46:04 +0000 (+0100) Subject: Merge pull request #1635 from ArthurHoaro/feature/phpcs X-Git-Tag: v0.12.1^2~1 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=302662797cb5e8ac6579a99297ceae301f7927a6;hp=-c;p=github%2Fshaarli%2FShaarli.git Merge pull request #1635 from ArthurHoaro/feature/phpcs --- 302662797cb5e8ac6579a99297ceae301f7927a6 diff --combined application/config/ConfigManager.php index 3260d7c0,a0acc94d..717a038f --- a/application/config/ConfigManager.php +++ b/application/config/ConfigManager.php @@@ -1,4 -1,5 +1,5 @@@ getConfigFileExt()) && !$isLoggedIn) { @@@ -370,8 -371,8 +371,8 @@@ $this->setEmpty('general.enable_async_metadata', true); $this->setEmpty('general.tags_separator', ' '); - $this->setEmpty('updates.check_updates', false); - $this->setEmpty('updates.check_updates_branch', 'stable'); + $this->setEmpty('updates.check_updates', true); + $this->setEmpty('updates.check_updates_branch', 'latest'); $this->setEmpty('updates.check_updates_interval', 86400); $this->setEmpty('feed.rss_permalinks', true); @@@ -392,7 -393,7 +393,7 @@@ $this->setEmpty('translation.mode', 'php'); $this->setEmpty('translation.extensions', []); - $this->setEmpty('plugins', array()); + $this->setEmpty('plugins', []); $this->setEmpty('formatter', 'markdown'); } diff --combined application/front/controller/admin/ServerController.php index 780151dd,575a2f9d..fabeaf2f --- a/application/front/controller/admin/ServerController.php +++ b/application/front/controller/admin/ServerController.php @@@ -25,16 -25,9 +25,16 @@@ class ServerController extends ShaarliA */ public function index(Request $request, Response $response): Response { - $latestVersion = 'v' . ApplicationUtils::getVersion( - ApplicationUtils::$GIT_RAW_URL . '/latest/' . ApplicationUtils::$VERSION_FILE - ); + $releaseUrl = ApplicationUtils::$GITHUB_URL . '/releases/'; + if ($this->container->conf->get('updates.check_updates', true)) { + $latestVersion = 'v' . ApplicationUtils::getVersion( + ApplicationUtils::$GIT_RAW_URL . '/latest/' . ApplicationUtils::$VERSION_FILE + ); + $releaseUrl .= 'tag/' . $latestVersion; + } else { + $latestVersion = t('Check disabled'); + } + $currentVersion = ApplicationUtils::getVersion('./shaarli_version.php'); $currentVersion = $currentVersion === 'dev' ? $currentVersion : 'v' . $currentVersion; $phpEol = new \DateTimeImmutable(ApplicationUtils::getPhpEol(PHP_VERSION)); @@@ -44,7 -37,7 +44,7 @@@ $this->assignView('php_has_reached_eol', $phpEol < new \DateTimeImmutable()); $this->assignView('php_extensions', ApplicationUtils::getPhpExtensionsRequirement()); $this->assignView('permissions', ApplicationUtils::checkResourcePermissions($this->container->conf)); - $this->assignView('release_url', ApplicationUtils::$GITHUB_URL . '/releases/tag/' . $latestVersion); + $this->assignView('release_url', $releaseUrl); $this->assignView('latest_version', $latestVersion); $this->assignView('current_version', $currentVersion); $this->assignView('thumbnails_mode', $this->container->conf->get('thumbnails.mode')); @@@ -72,7 -65,9 +72,9 @@@ $this->saveWarningMessage( t('Thumbnails cache has been cleared.') . ' ' . - '' . t('Please synchronize them.') .'' + '' . + t('Please synchronize them.') . + '' ); } else { $folders = [