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.
Comments
Comment #2
avpadernoComment #4
avpadernoComment #6
avpaderno