From bc343acc7c8d5beb796674ea3c61db6a4b78596e Mon Sep 17 00:00:00 2001 From: Philipp Daun Date: Sat, 26 Sep 2026 14:06:34 +0200 Subject: [PATCH] Memoize version read --- src/Version.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } }