Loading core/lib/Drupal/Core/Hook/HookCollectorPass.php +7 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Component\Annotation\Doctrine\StaticReflectionParser; use Drupal\Component\Annotation\Reflection\MockFileFinder; use Drupal\Component\FileCache\FileCacheFactory; use Drupal\Component\Utility\OpCodeCache; use Drupal\Core\Extension\ProceduralCall; use Drupal\Core\Hook\Attribute\Hook; use Drupal\Core\Hook\Attribute\HookAttributeInterface; Loading Loading @@ -374,6 +375,12 @@ protected function collectModuleHookImplementations($dir, $module, $current_modu $attributes = $cached['attributes']; } else { // Immediately after a deployment, opcache may not yet have refreshed // depending on the value of opcache.revalidation_freq which defaults // to 2 seconds. Ensure that reflection operates on the new code by // forcibly invalidating the opcode cache. // @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq OpCodeCache::invalidate($filename); $namespace = preg_replace('#^src/#', "Drupal/$module/", $iterator->getSubPath()); $class = $namespace . '/' . $fileinfo->getBasename('.php'); $class = str_replace('/', '\\', $class); Loading core/lib/Drupal/Core/Hook/ThemeHookCollectorPass.php +7 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Component\Annotation\Doctrine\StaticReflectionParser; use Drupal\Component\Annotation\Reflection\MockFileFinder; use Drupal\Component\FileCache\FileCacheFactory; use Drupal\Component\Utility\OpCodeCache; use Drupal\Core\Hook\Attribute\Hook; use Drupal\Core\Hook\Attribute\HookAttributeInterface; use Drupal\Core\Hook\Attribute\LegacyHook; Loading Loading @@ -230,6 +231,12 @@ protected function collectThemeHookImplementations($dir, $theme, $currentThemePr $attributes = $cached['attributes']; } else { // Immediately after a deployment, opcache may not yet have refreshed // depending on the value of opcache.revalidation_freq which defaults // to 2 seconds. Ensure that reflection operates on the new code by // forcibly invalidating the opcode cache. // @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq OpCodeCache::invalidate($filename); $namespace = preg_replace('#^src/#', "Drupal/$theme/", $iterator->getSubPath()); $class = $namespace . '/' . $fileinfo->getBasename('.php'); $class = str_replace('/', '\\', $class); Loading Loading
core/lib/Drupal/Core/Hook/HookCollectorPass.php +7 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Component\Annotation\Doctrine\StaticReflectionParser; use Drupal\Component\Annotation\Reflection\MockFileFinder; use Drupal\Component\FileCache\FileCacheFactory; use Drupal\Component\Utility\OpCodeCache; use Drupal\Core\Extension\ProceduralCall; use Drupal\Core\Hook\Attribute\Hook; use Drupal\Core\Hook\Attribute\HookAttributeInterface; Loading Loading @@ -374,6 +375,12 @@ protected function collectModuleHookImplementations($dir, $module, $current_modu $attributes = $cached['attributes']; } else { // Immediately after a deployment, opcache may not yet have refreshed // depending on the value of opcache.revalidation_freq which defaults // to 2 seconds. Ensure that reflection operates on the new code by // forcibly invalidating the opcode cache. // @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq OpCodeCache::invalidate($filename); $namespace = preg_replace('#^src/#', "Drupal/$module/", $iterator->getSubPath()); $class = $namespace . '/' . $fileinfo->getBasename('.php'); $class = str_replace('/', '\\', $class); Loading
core/lib/Drupal/Core/Hook/ThemeHookCollectorPass.php +7 −0 Original line number Diff line number Diff line Loading @@ -7,6 +7,7 @@ use Drupal\Component\Annotation\Doctrine\StaticReflectionParser; use Drupal\Component\Annotation\Reflection\MockFileFinder; use Drupal\Component\FileCache\FileCacheFactory; use Drupal\Component\Utility\OpCodeCache; use Drupal\Core\Hook\Attribute\Hook; use Drupal\Core\Hook\Attribute\HookAttributeInterface; use Drupal\Core\Hook\Attribute\LegacyHook; Loading Loading @@ -230,6 +231,12 @@ protected function collectThemeHookImplementations($dir, $theme, $currentThemePr $attributes = $cached['attributes']; } else { // Immediately after a deployment, opcache may not yet have refreshed // depending on the value of opcache.revalidation_freq which defaults // to 2 seconds. Ensure that reflection operates on the new code by // forcibly invalidating the opcode cache. // @see https://www.php.net/manual/en/opcache.configuration.php#ini.opcache.revalidate-freq OpCodeCache::invalidate($filename); $namespace = preg_replace('#^src/#', "Drupal/$theme/", $iterator->getSubPath()); $class = $namespace . '/' . $fileinfo->getBasename('.php'); $class = str_replace('/', '\\', $class); Loading