Skip to content

Instantly share code, notes, and snippets.

@TheLastCicada
Last active December 11, 2015 05:09
Show Gist options
  • Save TheLastCicada/4550516 to your computer and use it in GitHub Desktop.
Save TheLastCicada/4550516 to your computer and use it in GitHub Desktop.
// Add some debug info just before </head>
if ( $this->debug ) {
$tag = "<!--\n\tgenerated in " . $cache['timer'] . " seconds\n\t" . strlen(serialize($cache)) . " bytes batcached for " . $this->max_age . " seconds\n-->\n";
if ( false !== $tag_position = strpos($output, '</head>') ) {
$tag = "<!--\n\tgenerated in " . $cache['timer'] . " seconds\n\t" . strlen(serialize($cache)) . " bytes batcached for " . $this->max_age . " seconds\n-->\n";
$output = substr($output, 0, $tag_position) . $tag . substr($output, $tag_position);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment