Replace the shutdown callback with hook_page_alter()

Created on 23 July 2024, about 2 months ago
Updated 6 August 2024, about 1 month ago

The module uses a shutdown callback to show information about which values have been retrieved in the cache, set, or deleted. Since it is a very low-level function, it needs to:

  • Check what Drupal returned (HTML markup, plain text, XML, an image), while it is only interested to add its own output when Drupal outputs HTML markup
  • Verify theme() is available, and be sure the theme registry is not rebuilt

It is also added to the list of the shutdown callbacks to invoke in hook_init(), which is not invoked for cached pages.

Implementing hook_page_alter(), the code would be simpler.

Furthermore, instead of using a global variable, the code should use a DrupalApcCache static property, accessible via a static method.

📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇮🇹Italy apaderno Brescia, 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024