diff options
author | Max Romanov <max.romanov@nginx.com> | 2021-11-09 15:48:44 +0300 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2021-11-09 15:48:44 +0300 |
commit | b424a00ec5746884f8ebb1d75b3f0fec0b3a05ff (patch) | |
tree | 77c7ca06d1298d97c9818eb9f875e9dc41508f44 /test/php | |
parent | 506ec2b8258cfe03d0d7e3b19eb79d1075a6174c (diff) | |
download | unit-b424a00ec5746884f8ebb1d75b3f0fec0b3a05ff.tar.gz unit-b424a00ec5746884f8ebb1d75b3f0fec0b3a05ff.tar.bz2 |
Tests: PHP shared opcache test added.
Diffstat (limited to 'test/php')
-rw-r--r-- | test/php/opcache/index.php | 18 | ||||
-rw-r--r-- | test/php/opcache/test.php | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/test/php/opcache/index.php b/test/php/opcache/index.php new file mode 100644 index 00000000..de4002bb --- /dev/null +++ b/test/php/opcache/index.php @@ -0,0 +1,18 @@ +<?php + +$pid = getmypid(); + +header('X-Pid: ' . $pid); + +if (function_exists('opcache_is_script_cached')) { + if (opcache_is_script_cached(__DIR__ . '/test.php')) { + header('X-Cached: 1'); + } else { + header('X-Cached: 0'); + opcache_compile_file(__DIR__ . '/test.php'); + } +} else { + header('X-Cached: -1'); +} + +?> diff --git a/test/php/opcache/test.php b/test/php/opcache/test.php new file mode 100644 index 00000000..147cebcd --- /dev/null +++ b/test/php/opcache/test.php @@ -0,0 +1 @@ +<?php phpinfo(); ?> |