xref: /PHP-7.4/ext/opcache/tests/issue0149.phpt (revision c0e15a3b)
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--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9<?php if (!extension_loaded("phar")) die("skip"); ?>
10<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
11--CONFLICTS--
12server
13--FILE--
14<?php
15$stub = "<?php header('Content-Type: text/plain;');
16Phar::mount('this.file', '". __FILE__ . "');
17echo 'OK\n';
18__HALT_COMPILER(); ?>";
19$p = new Phar(__DIR__ . '/issue0149.phar.php', 0, 'this');
20$p['index.php'] = "";  # A Phar must have at least one file, hence this dummy
21$p->setStub($stub);
22unset($p);
23
24include "php_cli_server.inc";
25php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d extension=phar.'.PHP_SHLIB_SUFFIX);
26echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
27echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
28echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/issue0149.phar.php');
29?>
30--CLEAN--
31<?php
32@unlink(__DIR__ . '/issue0149.phar.php');
33?>
34--EXPECT--
35OK
36OK
37OK
38