Skip to content

Instantly share code, notes, and snippets.

@coudenysj
Last active April 23, 2019 07:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save coudenysj/22034a6b7c59a9e61771d6e764254637 to your computer and use it in GitHub Desktop.
Save coudenysj/22034a6b7c59a9e61771d6e764254637 to your computer and use it in GitHub Desktop.
A small script to return PHP stats in JSON format
<?php
header('Content-Type: application/json');
echo json_encode(
[
'opcache' => opcache_get_status(),
'realpath_cache_size' => [
'configured' => ini_get('realpath_cache_size'),
'real' => realpath_cache_size(),
]
],
JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment