xref: /PHP-8.1/ext/phar/tests/zf_test.phpt (revision 74859783)
1--TEST--
2Phar: test broken app
3--EXTENSIONS--
4phar
5zlib
6--INI--
7phar.readonly=0
8phar.require_hash=0
9--FILE--
10<?php
11
12$file = "zfapp";
13$orig_file = __DIR__ . "/files/$file.tgz";
14$tgz_file = __DIR__ . "/$file.tgz";
15$phar_file = __DIR__ . "/$file.phar.tar.gz";
16copy($orig_file, $tgz_file);
17
18$phar = new PharData($tgz_file);
19$phar = $phar->convertToExecutable();
20
21$phar = new Phar($phar_file);
22$phar->startBuffering();
23$phar->setStub("<?php
24Phar::interceptFileFuncs();
25Phar::webPhar('$file.phar', 'html/index.php');
26echo 'BlogApp is intended to be executed from a web browser\n';
27exit -1;
28__HALT_COMPILER();
29");
30$phar->stopBuffering();
31
32foreach(new RecursiveIteratorIterator($phar) as $path) {
33    echo str_replace('\\', '/', $path->getPathName()) . "\n";
34}
35
36?>
37--CLEAN--
38<?php
39unlink(__DIR__ . '/zfapp.tgz');
40unlink(__DIR__ . '/zfapp.phar.tar.gz');
41?>
42--EXPECTF--
43phar://%szfapp.phar.tar.gz/application/default/controllers/ErrorController.php
44phar://%szfapp.phar.tar.gz/application/default/controllers/IndexController.php
45phar://%szfapp.phar.tar.gz/application/default/views/scripts/error/error.phtml
46phar://%szfapp.phar.tar.gz/application/default/views/scripts/index/index.phtml
47phar://%szfapp.phar.tar.gz/html/.htaccess
48phar://%szfapp.phar.tar.gz/html/index.php
49