diff --git a/src/Version.php b/src/Version.php index 19c73d26ebd..73ecd27866f 100644 --- a/src/Version.php +++ b/src/Version.php @@ -6,14 +6,20 @@ class Version { + private static ?string $version = null; + public function get() { + if (static::$version !== null) { + return static::$version; + } + $currentVersion = Composer::installedVersion(Statamic::PACKAGE); if (! $currentVersion) { throw new \Exception('Statamic version could not be found. The composer.lock file is missing.'); } - return $currentVersion; + return static::$version = $currentVersion; } }