xref: /PHP-8.0/ext/phar/tests/include_path.phpt (revision d1764ca3)
1--TEST--
2Phar: include_path with phar:// wrapper
3--SKIPIF--
4<?php if (!extension_loaded("phar")) die("skip"); ?>
5--CONFLICTS--
6tempmanifest1.phar.php
7--INI--
8phar.readonly=0
9--FILE--
10<?php
11$fname = __DIR__ . '/tempmanifest1.phar.php';
12$a = new Phar($fname);
13$a['file1.php'] = 'file1.php
14';
15$a['test/file1.php'] = 'test/file1.php
16';
17unset($a);
18set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname);
19include 'file1.php';
20set_include_path('.' . PATH_SEPARATOR . 'phar://' . $fname . '/test');
21include 'file1.php';
22include 'file2.php';
23?>
24--CLEAN--
25<?php
26@unlink(__DIR__ . '/tempmanifest1.phar.php');
27?>
28--EXPECTF--
29file1.php
30test/file1.php
31
32Warning: include(file2.php): Failed to open stream: No such file or directory in %sinclude_path.php on line %d
33
34Warning: include(): Failed opening 'file2.php' for inclusion (include_path='%sphar://%stempmanifest1.phar.php/test') in %sinclude_path.php on line %d
35