Hi !
A quick PR to fix an error in the statistics generation and validation.
First commit fix the template for the statistics.php file. When op_cache is disabled, the function opcache_get_status return false which can't be used in the following array_key_exists resulting (in my case) in an error and no statistics.json file generation.
I tried to keep the fix readable (no nested ternary) and php 5.x compliant.
The second commit fix the validate:benchmark:statistics command which fail to valid the Json format with the new preload key added. I don't really know why (and didn't searched long) but if the key preload is present but not in the list of configureRequiredOption it throw an error The option "preload" does not exist. Defined options are: "code", "memory".
Anyway, I fixed it by adding the preload key as mandatory and added the type validation which can be int or null if preload / op_cache is disabled.
Hi ! A quick PR to fix an error in the statistics generation and validation.
First commit fix the template for the statistics.php file. When op_cache is disabled, the function
opcache_get_status
returnfalse
which can't be used in the followingarray_key_exists
resulting (in my case) in an error and no statistics.json file generation. I tried to keep the fix readable (no nested ternary) and php 5.x compliant.The second commit fix the
validate:benchmark:statistics
command which fail to valid the Json format with the newpreload
key added. I don't really know why (and didn't searched long) but if the keypreload
is present but not in the list ofconfigureRequiredOption
it throw an errorThe option "preload" does not exist. Defined options are: "code", "memory".
Anyway, I fixed it by adding thepreload
key as mandatory and added the type validation which can beint
ornull
if preload / op_cache is disabled.Let me know ! :)