xref: /PHP-8.3/ext/opcache/tests/issue0149.phpt (revision e9f783fc)
1--TEST--
2ISSUE #149 (Phar mount points not working this OPcache enabled)
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6phar.readonly=0
7--EXTENSIONS--
8opcache
9phar
10--CONFLICTS--
11server
12--FILE--
13<?php
14$stub = "<?php header('Content-Type: text/plain;');
15Phar::mount('this.file', '". __FILE__ . "');
16echo 'OK\n';
17__HALT_COMPILER(); ?>";
18$p = new Phar(__DIR__ . '/issue0149.phar.php', 0, 'this');
19$p['index.php'] = "";  # A Phar must have at least one file, hence this dummy
20$p->setStub($stub);
21unset($p);
22
23include "php_cli_server.inc";
24php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX);
25echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
26echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
27echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
28?>
29--CLEAN--
30<?php
31@unlink(__DIR__ . '/issue0149.phar.php');
32?>
33--EXPECT--
34OK
35OK
36OK
37