1--TEST-- 2Phar: phar:// include with Opcache 3--EXTENSIONS-- 4phar 5opcache 6--SKIPIF-- 7<?php 8if (strpos(PHP_OS, 'WIN') === false) die("skip Extra warning on Windows."); 9$cache_dir = dirname(__FILE__) . "/024-file_cache"; 10if (!is_dir($cache_dir) && !mkdir($cache_dir)) die("skip unable to create file_cache dir"); 11?> 12--INI-- 13phar.require_hash=0 14opcache.enable=1 15opcache.enable_cli=1 16opcache.file_cache={PWD}/024-file_cache 17opcache.memory_consumption=64 18opcache.interned_strings_buffer=8 19opcache.max_accelerated_files=4000 20opcache.jit=tracing 21opcache.revalidate_freq=60 22opcache.fast_shutdown=1 23--FILE-- 24<?php 25 26$fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php'; 27$pname = 'phar://' . $fname; 28$file = "<?php __HALT_COMPILER(); ?>"; 29 30$files = array(); 31$files['a.php'] = '<?php echo "This is a\n"; ?>'; 32$files['b.php'] = '<?php echo "This is b\n"; ?>'; 33$files['b/c.php'] = '<?php echo "This is b/c\n"; ?>'; 34 35include 'files/phar_test.inc'; 36 37include $pname . '/a.php'; 38include $pname . '/b.php'; 39include $pname . '/b/c.php'; 40 41$cache_dir = ini_get("opcache.file_cache"); 42if (is_dir($cache_dir)) { 43 $it = new RecursiveIteratorIterator( 44 new RecursiveDirectoryIterator($cache_dir, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST 45 ); 46 foreach ($it as $fi) { 47 $fn = ($fi->isDir() ? 'rmdir' : 'unlink'); 48 $fn($fi->getRealPath()); 49 } 50 51 rmdir($cache_dir); 52} 53 54?> 55--CLEAN-- 56<?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?> 57--EXPECT-- 58This is a 59This is b 60This is b/c 61