From e284a40d0d03404db257cb9d5e1e72ea1ed79dd1 Mon Sep 17 00:00:00 2001 From: Phan An Date: Sun, 10 Jan 2021 23:17:37 +0100 Subject: [PATCH] feat: store Koel version in a .version config file instead --- .version | 1 + app/Application.php | 18 ------------------ app/Helpers.php | 5 +++++ app/Http/Controllers/API/DataController.php | 5 ++--- app/Services/ApplicationInformationService.php | 3 +-- 5 files changed, 9 insertions(+), 23 deletions(-) create mode 100644 .version delete mode 100644 app/Application.php diff --git a/.version b/.version new file mode 100644 index 00000000..4bccc27e --- /dev/null +++ b/.version @@ -0,0 +1 @@ +v5.0.1 diff --git a/app/Application.php b/app/Application.php deleted file mode 100644 index 971915b2..00000000 --- a/app/Application.php +++ /dev/null @@ -1,18 +0,0 @@ - config('koel.streaming.ffmpeg_path') && is_executable(config('koel.streaming.ffmpeg_path')), 'cdnUrl' => static_url(), - 'currentVersion' => Application::KOEL_VERSION, + 'currentVersion' => koel_version(), 'latestVersion' => $this->currentUser->is_admin ? $this->applicationInformationService->getLatestVersionNumber() - : Application::KOEL_VERSION, + : koel_version(), ]); } } diff --git a/app/Services/ApplicationInformationService.php b/app/Services/ApplicationInformationService.php index e499a290..6a2ea77a 100644 --- a/app/Services/ApplicationInformationService.php +++ b/app/Services/ApplicationInformationService.php @@ -2,7 +2,6 @@ namespace App\Services; -use App\Application; use GuzzleHttp\Client; use Illuminate\Contracts\Cache\Repository as Cache; use Illuminate\Log\Logger; @@ -36,7 +35,7 @@ class ApplicationInformationService } catch (Throwable $e) { $this->logger->error($e); - return Application::KOEL_VERSION; + return koel_version(); } }); }