1--TEST--
2revalidate_path 01: OPCache must cache only resolved real paths when revalidate_path is set
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.revalidate_path=1
7--SKIPIF--
8<?php require_once('skipif.inc'); ?>
9<?php if (php_sapi_name() != "cli") die("skip CLI only"); ?>
10--FILE--
11<?php
12$dir = dirname(__FILE__);
13$dir1 = "$dir/test1";
14$dir2 = "$dir/test2";
15$link = "$dir/test";
16$file1 = "$dir1/index.php";
17$file2 = "$dir2/index.php";
18$main = "$dir/main.php";
19@mkdir($dir1);
20@mkdir($dir2);
21@file_put_contents($main,  '<?php include(\'' . $link .'/index.php\');');
22@file_put_contents($file1, "TEST 1\n");
23@file_put_contents($file2, "TEST 2\n");
24while (filemtime($file1) != filemtime($file2)) {
25	touch($file1);
26	touch($file2);
27}
28@unlink($link);
29@symlink($dir1, $link);
30
31include "php_cli_server.inc";
32//php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.revalidate_path=1');
33php_cli_server_start('-d opcache.enable=1 -d opcache.enable_cli=1 -d opcache.revalidate_path=1 -d opcache.file_update_protection=0 -d realpath_cache_size=0');
34echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
35echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
36@unlink($link);
37@symlink($dir2, $link);
38echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
39echo file_get_contents('http://' . PHP_CLI_SERVER_ADDRESS . '/main.php');
40?>
41--CLEAN--
42<?php
43$dir = dirname(__FILE__);
44$dir1 = "$dir/test1";
45$dir2 = "$dir/test2";
46$link = "$dir/test";
47$file1 = "$dir1/index.php";
48$file2 = "$dir2/index.php";
49$main = "$dir/main.php";
50@unlink($main);
51@unlink($link);
52@unlink($file1);
53@unlink($file2);
54@rmdir($dir1);
55@rmdir($dir2);
56?>
57--EXPECT--
58TEST 1
59TEST 1
60TEST 2
61TEST 2
62