diff --git a/Civi/Core/ClassScanner.php b/Civi/Core/ClassScanner.php index 486b91e4dbd7..5d7b6954ed94 100644 --- a/Civi/Core/ClassScanner.php +++ b/Civi/Core/ClassScanner.php @@ -222,9 +222,11 @@ public static function cache(string $name): \CRM_Utils_Cache_Interface { switch ($name) { case 'index': if (empty($_DB_DATAOBJECT['CONFIG'])) { + \Civi\HitOrMiss::inc('ClassScanner::cache(index) => Early usage'); // Atypical example: You have a test with a @dataProvider that relies on ClassScanner. Runs before bot. return new \CRM_Utils_Cache_ArrayCache([]); } + \Civi\HitOrMiss::inc('ClassScanner::cache(index) => create(...)'); static::$caches[$name] = \CRM_Utils_Cache::create([ 'name' => 'classes', 'type' => ['*memory*', 'SqlGroup', 'ArrayCache'], @@ -232,6 +234,7 @@ public static function cache(string $name): \CRM_Utils_Cache_Interface { ]); case 'structure': + \Civi\HitOrMiss::inc('ClassScanner::cache(structure) => New arraycache'); static::$caches[$name] = new \CRM_Utils_Cache_ArrayCache([]); break; diff --git a/Civi/HitOrMiss.php b/Civi/HitOrMiss.php new file mode 100644 index 000000000000..66dc9d613f8c --- /dev/null +++ b/Civi/HitOrMiss.php @@ -0,0 +1,12 @@ +