From 3ece4b574b3c2b4ba86950ac0c076c68c5d36062 Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Fri, 15 Mar 2024 09:30:18 -0400 Subject: [PATCH] revert --- src/Listeners/ClearState.php | 2 -- src/Statamic.php | 14 ++------------ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/src/Listeners/ClearState.php b/src/Listeners/ClearState.php index ced2b006fa6..2b0fbf7148e 100644 --- a/src/Listeners/ClearState.php +++ b/src/Listeners/ClearState.php @@ -3,14 +3,12 @@ namespace Statamic\Listeners; use Statamic\Facades\URL; -use Statamic\Statamic; use Statamic\View\State\StateManager; class ClearState { public function handle() { - Statamic::clearApiRouteCache(); StateManager::resetState(); URL::clearExternalUrlCache(); } diff --git a/src/Statamic.php b/src/Statamic.php index bb70deea98d..e9576014969 100644 --- a/src/Statamic.php +++ b/src/Statamic.php @@ -36,7 +36,6 @@ class Statamic protected static $jsonVariables = []; protected static $bootedCallbacks = []; protected static $afterInstalledCallbacks = []; - private static $isApiRouteCache; public static function version() { @@ -213,22 +212,13 @@ public static function cpRoute($route, $params = []) return $route; } - public static function clearApiRouteCache() - { - self::$isApiRouteCache = null; - } - public static function isApiRoute() { - if (self::$isApiRouteCache !== null) { - return self::$isApiRouteCache; - } - if (! config('statamic.api.enabled') || ! static::pro()) { - return self::$isApiRouteCache = false; + return false; } - return self::$isApiRouteCache = starts_with(request()->path(), config('statamic.api.route')); + return starts_with(request()->path(), config('statamic.api.route')); } public static function apiRoute($route, $params = [])