summaryrefslogtreecommitdiff
path: root/ext/phar/tests/cache_list
diff options
context:
space:
mode:
Diffstat (limited to 'ext/phar/tests/cache_list')
-rw-r--r--ext/phar/tests/cache_list/copyonwrite1.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite10.phar.phpt24
-rw-r--r--ext/phar/tests/cache_list/copyonwrite11.phar.phpt22
-rw-r--r--ext/phar/tests/cache_list/copyonwrite12.phar.phpt24
-rw-r--r--ext/phar/tests/cache_list/copyonwrite13.phar.phpt15
-rw-r--r--ext/phar/tests/cache_list/copyonwrite14.phar.phpt15
-rw-r--r--ext/phar/tests/cache_list/copyonwrite15.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite16.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite17.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite18.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite19.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite2.phar.phpt17
-rw-r--r--ext/phar/tests/cache_list/copyonwrite20.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite21.phar.phpt15
-rw-r--r--ext/phar/tests/cache_list/copyonwrite22.phar.phpt15
-rw-r--r--ext/phar/tests/cache_list/copyonwrite23.phar.phpt17
-rw-r--r--ext/phar/tests/cache_list/copyonwrite24.phar.phpt15
-rw-r--r--ext/phar/tests/cache_list/copyonwrite25.phar.phpt16
-rw-r--r--ext/phar/tests/cache_list/copyonwrite3.phar.phpt16
-rw-r--r--ext/phar/tests/cache_list/copyonwrite4.phar.phpt15
-rw-r--r--ext/phar/tests/cache_list/copyonwrite4a.phpt20
-rw-r--r--ext/phar/tests/cache_list/copyonwrite5.phar.phpt27
-rw-r--r--ext/phar/tests/cache_list/copyonwrite6.phar.phpt29
-rw-r--r--ext/phar/tests/cache_list/copyonwrite7.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite8.phar.phpt14
-rw-r--r--ext/phar/tests/cache_list/copyonwrite9.phar.phpt23
-rw-r--r--ext/phar/tests/cache_list/files/blog.pharbin0 -> 468 bytes
-rw-r--r--ext/phar/tests/cache_list/files/blog.phar.inc20
-rw-r--r--ext/phar/tests/cache_list/files/config.xml9
-rw-r--r--ext/phar/tests/cache_list/files/extracted.inc1
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller.pharbin0 -> 331 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller.phar.inc13
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller10.pharbin0 -> 591 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller10.phar.inc20
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller11.pharbin0 -> 578 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller11.phar.inc20
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller12.pharbin0 -> 588 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller12.phar.inc20
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller13.pharbin0 -> 330 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller13.phar.inc14
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller14.pharbin0 -> 450 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller14.phar.inc19
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller16.pharbin0 -> 330 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller16.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller17.pharbin0 -> 315 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller17.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller18.pharbin0 -> 331 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller18.phar.inc19
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller19.pharbin0 -> 560 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller19.phar.inc25
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller2.pharbin0 -> 297 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller2.phar.inc12
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller3.pharbin0 -> 437 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller3.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller4.pharbin0 -> 433 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller4.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller5.pharbin0 -> 327 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller5.phar.inc12
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller6.pharbin0 -> 328 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller6.phar.inc12
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller7.pharbin0 -> 329 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller7.phar.inc12
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller8.pharbin0 -> 8970 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller8.phar.inc19
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller9.pharbin0 -> 448 bytes
-rw-r--r--ext/phar/tests/cache_list/files/frontcontroller9.phar.inc14
-rw-r--r--ext/phar/tests/cache_list/files/md5.pharbin0 -> 107 bytes
-rw-r--r--ext/phar/tests/cache_list/files/nophar.pharbin0 -> 7049 bytes
-rw-r--r--ext/phar/tests/cache_list/files/nophar.phar.inc10
-rw-r--r--ext/phar/tests/cache_list/files/openssl.pharbin0 -> 6901 bytes
-rw-r--r--ext/phar/tests/cache_list/files/openssl.phar.pubkey6
-rw-r--r--ext/phar/tests/cache_list/files/phar_oo_test.inc49
-rw-r--r--ext/phar/tests/cache_list/files/phar_test.inc78
-rw-r--r--ext/phar/tests/cache_list/files/private.pem15
-rw-r--r--ext/phar/tests/cache_list/files/sha1.pharbin0 -> 111 bytes
-rw-r--r--ext/phar/tests/cache_list/files/sha256.pharbin0 -> 123 bytes
-rw-r--r--ext/phar/tests/cache_list/files/sha512.pharbin0 -> 155 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write.pharbin0 -> 285 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write.phar.inc20
-rw-r--r--ext/phar/tests/cache_list/files/write10.pharbin0 -> 324 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write10.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/write11.pharbin0 -> 284 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write11.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write12.pharbin0 -> 301 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write12.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write13.pharbin0 -> 316 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write13.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write14.pharbin0 -> 312 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write14.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/write15.pharbin0 -> 270 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write15.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/write16.pharbin0 -> 327 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write16.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write17.pharbin0 -> 258 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write17.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/write18.pharbin0 -> 336 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write18.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write19.pharbin0 -> 304 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write19.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write2.pharbin0 -> 425 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write2.phar.inc23
-rw-r--r--ext/phar/tests/cache_list/files/write20.pharbin0 -> 299 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write20.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write21.pharbin0 -> 297 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write21.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/write22.pharbin0 -> 293 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write22.phar.inc17
-rw-r--r--ext/phar/tests/cache_list/files/write23.pharbin0 -> 366 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write23.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/write24.pharbin0 -> 327 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write24.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/write25.pharbin0 -> 331 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write25.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/write3.pharbin0 -> 447 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write3.phar.inc21
-rw-r--r--ext/phar/tests/cache_list/files/write4.pharbin0 -> 388 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write4.phar.inc16
-rw-r--r--ext/phar/tests/cache_list/files/write5.pharbin0 -> 564 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write5.phar.inc29
-rw-r--r--ext/phar/tests/cache_list/files/write6.pharbin0 -> 675 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write6.phar.inc30
-rw-r--r--ext/phar/tests/cache_list/files/write7.pharbin0 -> 316 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write7.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/write8.pharbin0 -> 255 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write8.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/write9.pharbin0 -> 277 bytes
-rw-r--r--ext/phar/tests/cache_list/files/write9.phar.inc18
-rw-r--r--ext/phar/tests/cache_list/files/zfapp.tgzbin0 -> 1725 bytes
-rw-r--r--ext/phar/tests/cache_list/frontcontroller1.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller10.phpt25
-rw-r--r--ext/phar/tests/cache_list/frontcontroller11.phpt22
-rw-r--r--ext/phar/tests/cache_list/frontcontroller12.phpt21
-rw-r--r--ext/phar/tests/cache_list/frontcontroller13.phpt21
-rw-r--r--ext/phar/tests/cache_list/frontcontroller14.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller15.phpt21
-rw-r--r--ext/phar/tests/cache_list/frontcontroller16.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller17.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller18.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller19.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller2.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller20.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller21.phpt25
-rw-r--r--ext/phar/tests/cache_list/frontcontroller22.phpt22
-rw-r--r--ext/phar/tests/cache_list/frontcontroller23.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller24.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller25.phpt18
-rw-r--r--ext/phar/tests/cache_list/frontcontroller26.phpt16
-rw-r--r--ext/phar/tests/cache_list/frontcontroller27.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller28.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller29.phpt17
-rw-r--r--ext/phar/tests/cache_list/frontcontroller3.phpt20
-rw-r--r--ext/phar/tests/cache_list/frontcontroller30.phpt14
-rw-r--r--ext/phar/tests/cache_list/frontcontroller31.phpt16
-rw-r--r--ext/phar/tests/cache_list/frontcontroller32.phpt16
-rw-r--r--ext/phar/tests/cache_list/frontcontroller33.phpt16
-rw-r--r--ext/phar/tests/cache_list/frontcontroller34.phpt19
-rw-r--r--ext/phar/tests/cache_list/frontcontroller4.phpt15
-rw-r--r--ext/phar/tests/cache_list/frontcontroller5.phpt16
-rw-r--r--ext/phar/tests/cache_list/frontcontroller6.phpt23
-rw-r--r--ext/phar/tests/cache_list/frontcontroller7.phpt16
-rw-r--r--ext/phar/tests/cache_list/frontcontroller8.phpt23
-rw-r--r--ext/phar/tests/cache_list/frontcontroller9.phpt20
162 files changed, 2033 insertions, 0 deletions
diff --git a/ext/phar/tests/cache_list/copyonwrite1.phar.phpt b/ext/phar/tests/cache_list/copyonwrite1.phar.phpt
new file mode 100644
index 0000000..90b0a8f
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite1.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 1 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite1.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write.phar
+--EXPECT--
+hi
+changed
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite10.phar.phpt b/ext/phar/tests/cache_list/copyonwrite10.phar.phpt
new file mode 100644
index 0000000..3d5b7fe
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite10.phar.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Phar: copy-on-write test 10 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite10.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write10.phar
+--EXPECTF--
+string(214) "<?php
+$p = new Phar(__FILE__);
+var_dump($p->getStub());
+$p2 = new Phar(__FILE__);
+$a = fopen("phar://" . __FILE__ . "/test.txt", "r");
+$p->setStub($a);
+echo $p2->getStub(),"\n";
+echo "ok\n";
+__HALT_COMPILER(); ?>
+"
+<?php __HALT_COMPILER(); ?>
+
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite11.phar.phpt b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt
new file mode 100644
index 0000000..6538816
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite11.phar.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Phar: copy-on-write test 11 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite11.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write11.phar
+--EXPECTF--
+string(174) "<?php
+$p = new Phar(__FILE__);
+var_dump($p->getStub());
+$p2 = new Phar(__FILE__);
+$p->setDefaultStub();
+echo strlen($p2->getStub()),"\n";
+echo "ok\n";
+__HALT_COMPILER(); ?>
+"
+6685
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite12.phar.phpt b/ext/phar/tests/cache_list/copyonwrite12.phar.phpt
new file mode 100644
index 0000000..40b5441
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite12.phar.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Phar: copy-on-write test 12 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite12.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write12.phar
+--EXPECTF--
+array(2) {
+ ["hash"]=>
+ string(40) "0163F471460EA74F7636268D28289BF5A1E8BD72"
+ ["hash_type"]=>
+ string(5) "SHA-1"
+}
+array(2) {
+ ["hash"]=>
+ string(32) "%s"
+ ["hash_type"]=>
+ string(3) "MD5"
+}
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite13.phar.phpt b/ext/phar/tests/cache_list/copyonwrite13.phar.phpt
new file mode 100644
index 0000000..fc47174
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite13.phar.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar: copy-on-write test 13 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite13.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write13.phar
+--EXPECTF--
+bool(false)
+bool(true)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite14.phar.phpt b/ext/phar/tests/cache_list/copyonwrite14.phar.phpt
new file mode 100644
index 0000000..11201ac
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite14.phar.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar: copy-on-write test 14 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite14.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write14.phar
+--EXPECTF--
+bool(true)
+bool(false)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite15.phar.phpt b/ext/phar/tests/cache_list/copyonwrite15.phar.phpt
new file mode 100644
index 0000000..6e46289
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite15.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 15 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite15.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write15.phar
+--EXPECTF--
+bool(false)
+bool(true)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite16.phar.phpt b/ext/phar/tests/cache_list/copyonwrite16.phar.phpt
new file mode 100644
index 0000000..f17784c
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite16.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 16 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite16.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write16.phar
+--EXPECTF--
+bool(true)
+bool(false)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite17.phar.phpt b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt
new file mode 100644
index 0000000..158c049
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite17.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 17 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite17.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write17.phar
+--EXPECTF--
+NULL
+%string|unicode%(2) "hi"
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite18.phar.phpt b/ext/phar/tests/cache_list/copyonwrite18.phar.phpt
new file mode 100644
index 0000000..3e65f5a
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite18.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 18 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite18.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write18.phar
+--EXPECTF--
+100666
+100444
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite19.phar.phpt b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt
new file mode 100644
index 0000000..6e03554
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite19.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 19 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite19.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write19.phar
+--EXPECTF--
+string(2) "hi"
+%string|unicode%(3) "hi2"
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite2.phar.phpt b/ext/phar/tests/cache_list/copyonwrite2.phar.phpt
new file mode 100644
index 0000000..8d21c81
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite2.phar.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar: copy-on-write test 2 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite2.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write2.phar
+--EXPECT--
+string(2) "hi"
+bool(true)
+string(2) "hi"
+bool(true)
+bool(true)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite20.phar.phpt b/ext/phar/tests/cache_list/copyonwrite20.phar.phpt
new file mode 100644
index 0000000..acce574
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite20.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 20 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite20.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write20.phar
+--EXPECTF--
+string(2) "hi"
+NULL
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite21.phar.phpt b/ext/phar/tests/cache_list/copyonwrite21.phar.phpt
new file mode 100644
index 0000000..8960ea7
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite21.phar.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar: copy-on-write test 21 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite21.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write21.phar
+--EXPECTF--
+bool(false)
+bool(true)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite22.phar.phpt b/ext/phar/tests/cache_list/copyonwrite22.phar.phpt
new file mode 100644
index 0000000..7cba216
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite22.phar.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar: copy-on-write test 22 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite22.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write22.phar
+--EXPECTF--
+bool(true)
+bool(false)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite23.phar.phpt b/ext/phar/tests/cache_list/copyonwrite23.phar.phpt
new file mode 100644
index 0000000..292e5af
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite23.phar.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar: copy-on-write test 23 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite23.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write23.phar
+--EXPECTF--
+bool(true)
+bool(false)
+bool(false)
+bool(true)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite24.phar.phpt b/ext/phar/tests/cache_list/copyonwrite24.phar.phpt
new file mode 100644
index 0000000..69197f2
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite24.phar.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar: copy-on-write test 24 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite24.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write24.phar
+--EXPECTF--
+bool(false)
+bool(true)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite25.phar.phpt b/ext/phar/tests/cache_list/copyonwrite25.phar.phpt
new file mode 100644
index 0000000..b661cb6
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite25.phar.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar: copy-on-write test 25 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite25.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (!extension_loaded("zlib")) die("skip no zlib extension"); ?>
+--FILE_EXTERNAL--
+files/write25.phar
+--EXPECTF--
+bool(false)
+bool(true)
+<?php __HALT_COMPILER();
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite3.phar.phpt b/ext/phar/tests/cache_list/copyonwrite3.phar.phpt
new file mode 100644
index 0000000..7e2c94c
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite3.phar.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar: copy-on-write test 3 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite3.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write3.phar
+--EXPECT--
+bool(true)
+bool(true)
+bool(false)
+bool(false)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite4.phar.phpt b/ext/phar/tests/cache_list/copyonwrite4.phar.phpt
new file mode 100644
index 0000000..20ff78e
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite4.phar.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar: copy-on-write test 4 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite4.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write4.phar
+--EXPECT--
+bool(false)
+bool(true)
+string(2) "hi"
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite4a.phpt b/ext/phar/tests/cache_list/copyonwrite4a.phpt
new file mode 100644
index 0000000..1945e31
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite4a.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Phar: copy-on-write test 4a [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite4.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE--
+<?php
+var_dump(file_exists('phar://' . dirname(__FILE__) . '/files/write4.phar/testit.txt'));
+Phar::mount('phar://' . dirname(__FILE__) . '/files/write4.phar/testit.txt', 'phar://' . dirname(__FILE__) . '/files/write4.phar/tobemounted');
+var_dump(file_exists('phar://' . dirname(__FILE__) . '/files/write4.phar/testit.txt'), file_get_contents('phar://' . dirname(__FILE__) . '/files/write4.phar/testit.txt'));
+?>
+===DONE===
+--EXPECT--
+bool(false)
+bool(true)
+string(2) "hi"
+===DONE=== \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite5.phar.phpt b/ext/phar/tests/cache_list/copyonwrite5.phar.phpt
new file mode 100644
index 0000000..89990a7
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite5.phar.phpt
@@ -0,0 +1,27 @@
+--TEST--
+Phar: copy-on-write test 5 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite5.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write5.phar
+--CLEAN--
+<?php
+unlink(dirname(__FILE__) . '/copyonwrite5/file1');
+unlink(dirname(__FILE__) . '/copyonwrite5/file2');
+rmdir(dirname(__FILE__) . '/copyonwrite5');
+?>
+--EXPECTF--
+array(2) {
+ ["file1"]=>
+ string(%d) "%sfile1"
+ ["file2"]=>
+ string(%d) "%sfile2"
+}
+phar://%scopyonwrite5.phar.php%cfile1 file1
+phar://%scopyonwrite5.phar.php%cfile2 file2
+phar://%scopyonwrite5.phar.php%chi hi
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite6.phar.phpt b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt
new file mode 100644
index 0000000..661fef4
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt
@@ -0,0 +1,29 @@
+--TEST--
+Phar: copy-on-write test 6 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite6.phar.php
+phar.readonly=0
+open_basedir=
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php if (version_compare(PHP_VERSION, "5.3", "<")) die("skip PHP 5.3+ required"); ?>
+--FILE_EXTERNAL--
+files/write6.phar
+--CLEAN--
+<?php
+unlink(dirname(__FILE__) . '/copyonwrite6/file1');
+unlink(dirname(__FILE__) . '/copyonwrite6/file2');
+rmdir(dirname(__FILE__) . '/copyonwrite6');
+?>
+--EXPECTF--
+array(2) {
+ ["file1"]=>
+ string(%d) "%sfile1"
+ ["file2"]=>
+ string(%d) "%sfile2"
+}
+phar://%scopyonwrite6.phar.php%cfile1 file1
+phar://%scopyonwrite6.phar.php%cfile2 file2
+phar://%scopyonwrite6.phar.php%chi hi
+ok
diff --git a/ext/phar/tests/cache_list/copyonwrite7.phar.phpt b/ext/phar/tests/cache_list/copyonwrite7.phar.phpt
new file mode 100644
index 0000000..d6faded
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite7.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 7 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite7.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write7.phar
+--EXPECT--
+bool(true)
+bool(false)
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite8.phar.phpt b/ext/phar/tests/cache_list/copyonwrite8.phar.phpt
new file mode 100644
index 0000000..7217d33
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite8.phar.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar: copy-on-write test 8 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite8.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write8.phar
+--EXPECTF--
+string(%s) "%scopyonwrite8.phar.php"
+hi
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/copyonwrite9.phar.phpt b/ext/phar/tests/cache_list/copyonwrite9.phar.phpt
new file mode 100644
index 0000000..ffda956
--- /dev/null
+++ b/ext/phar/tests/cache_list/copyonwrite9.phar.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Phar: copy-on-write test 9 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/copyonwrite9.phar.php
+phar.readonly=0
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--FILE_EXTERNAL--
+files/write9.phar
+--EXPECTF--
+string(188) "<?php
+$p = new Phar(__FILE__);
+var_dump($p->getStub());
+$p2 = new Phar(__FILE__);
+$p->setStub("<?php __HALT"."_COMPILER();");
+echo $p2->getStub(),"\n";
+echo "ok\n";
+__HALT_COMPILER(); ?>
+"
+<?php __HALT_COMPILER(); ?>
+
+ok \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/files/blog.phar b/ext/phar/tests/cache_list/files/blog.phar
new file mode 100644
index 0000000..58c8a3b
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/blog.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/blog.phar.inc b/ext/phar/tests/cache_list/files/blog.phar.inc
new file mode 100644
index 0000000..62d86c5
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/blog.phar.inc
@@ -0,0 +1,20 @@
+<?php
+
+$fname = dirname(__FILE__) . '/blog.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php if(file_exists(dirname(__FILE__) . "/files/config.xml")) {
+ Phar::mount("config.xml", dirname(__FILE__) . "/files/config.xml");
+}
+Phar::webPhar("blog", "index.php");
+__HALT_COMPILER(); ?>');
+$phar['index.php'] = '<?php if (!file_exists("config.xml")) {
+ include "install.php";
+ exit;
+}
+var_dump(file_get_contents("config.xml"));
+?>';
+$phar['install.php'] = '<?php echo "install\n"; ?>';
+
+?>
diff --git a/ext/phar/tests/cache_list/files/config.xml b/ext/phar/tests/cache_list/files/config.xml
new file mode 100644
index 0000000..cf0dbc5
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/config.xml
@@ -0,0 +1,9 @@
+<xml version="1.0" encoding="UTF-8">
+<config>
+ <database>
+ <host>localhost</name>
+ <user>squirrel</user>
+ <pass>nuts</pass>
+ <db>hoard</db>
+ </database>
+</config>
diff --git a/ext/phar/tests/cache_list/files/extracted.inc b/ext/phar/tests/cache_list/files/extracted.inc
new file mode 100644
index 0000000..a6e5224
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/extracted.inc
@@ -0,0 +1 @@
+<?php var_dump(__FILE__); ?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller.phar b/ext/phar/tests/cache_list/files/frontcontroller.phar
new file mode 100644
index 0000000..626bf48
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller.phar.inc
new file mode 100644
index 0000000..80d42e8
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller.phar.inc
@@ -0,0 +1,13 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a['index.php'] = 'here is my index';
+$a->setStub('<?php
+Phar::webPhar();
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller10.phar b/ext/phar/tests/cache_list/files/frontcontroller10.phar
new file mode 100644
index 0000000..078ce75
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller10.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller10.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller10.phar.inc
new file mode 100644
index 0000000..4c139db
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller10.phar.inc
@@ -0,0 +1,20 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller10.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller10.phar');
+$a['index.php'] = '<?php
+var_dump($_SERVER["PHP_SELF"]);
+var_dump($_SERVER["SCRIPT_NAME"]);
+var_dump($_SERVER["SCRIPT_FILENAME"]);
+var_dump($_SERVER["REQUEST_URI"]);
+var_dump($_SERVER["PHAR_PHP_SELF"]);
+var_dump($_SERVER["PHAR_SCRIPT_NAME"]);
+var_dump($_SERVER["PHAR_SCRIPT_FILENAME"]);
+var_dump($_SERVER["PHAR_REQUEST_URI"]);
+';
+$a->setStub('<?php
+Phar::mungServer(array("PHP_SELF", "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI", "OOPSIE"));
+Phar::webPhar();
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller11.phar b/ext/phar/tests/cache_list/files/frontcontroller11.phar
new file mode 100644
index 0000000..61ea843
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller11.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller11.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller11.phar.inc
new file mode 100644
index 0000000..0863508
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller11.phar.inc
@@ -0,0 +1,20 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller11.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller11.phar');
+$a['index.php'] = '<?php
+var_dump($_SERVER["PHP_SELF"]);
+var_dump($_SERVER["SCRIPT_NAME"]);
+var_dump($_SERVER["SCRIPT_FILENAME"]);
+var_dump($_SERVER["REQUEST_URI"]);
+var_dump($_SERVER["PHAR_PHP_SELF"]);
+var_dump($_SERVER["PHAR_SCRIPT_NAME"]);
+var_dump($_SERVER["PHAR_SCRIPT_FILENAME"]);
+var_dump($_SERVER["PHAR_REQUEST_URI"]);
+';
+$a->setStub('<?php
+Phar::mungServer(array(array(), "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI"));
+Phar::webPhar();
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller12.phar b/ext/phar/tests/cache_list/files/frontcontroller12.phar
new file mode 100644
index 0000000..1cf3629
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller12.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc
new file mode 100644
index 0000000..f1e4645
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller12.phar.inc
@@ -0,0 +1,20 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller12.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller12.phar');
+$a['index.php'] = '<?php
+var_dump($_SERVER["PHP_SELF"]);
+var_dump($_SERVER[b"SCRIPT_NAME"]);
+var_dump($_SERVER[b"SCRIPT_FILENAME"]);
+var_dump($_SERVER[b"REQUEST_URI"]);
+var_dump($_SERVER[b"PHAR_PHP_SELF"]);
+var_dump($_SERVER[b"PHAR_SCRIPT_NAME"]);
+var_dump($_SERVER[b"PHAR_SCRIPT_FILENAME"]);
+var_dump($_SERVER[b"PHAR_REQUEST_URI"]);
+';
+$a->setStub('<?php
+Phar::mungServer(array("PHP_SELF", "SCRIPT_NAME", "SCRIPT_FILENAME", "REQUEST_URI"));
+Phar::webPhar();
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller13.phar b/ext/phar/tests/cache_list/files/frontcontroller13.phar
new file mode 100644
index 0000000..750ff27
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller13.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller13.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller13.phar.inc
new file mode 100644
index 0000000..0bfef46
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller13.phar.inc
@@ -0,0 +1,14 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller13.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller13.phar');
+$a['index.php'] = '<?php
+var_dump("test");
+include "oof/test.php";';
+$a['oof/test.php'] = '<?php
+var_dump("oof/test.php");
+include "./hi.php";';
+$a['oof/hi.php'] = '<?php
+var_dump("hi");';
+$a->setStub('<?php
+Phar::webPhar();
+__HALT_COMPILER();'); \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/files/frontcontroller14.phar b/ext/phar/tests/cache_list/files/frontcontroller14.phar
new file mode 100644
index 0000000..ebc3e9b
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller14.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller14.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller14.phar.inc
new file mode 100644
index 0000000..23104a6
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller14.phar.inc
@@ -0,0 +1,19 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller14.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller14.phar');
+$a['html/index.php'] = '<?php
+var_dump($_SERVER[b"PATH_INFO"]);
+var_dump($_SERVER[b"PATH_TRANSLATED"]);
+';
+$a->setStub('<?php
+function s($a)
+{
+ return "/html/index.php";
+}
+Phar::interceptFileFuncs();
+Phar::mungServer(array("PHP_SELF", "REQUEST_URI"));
+Phar::webPhar("whatever", "/html/index.php", null, array(), "s");
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller16.phar b/ext/phar/tests/cache_list/files/frontcontroller16.phar
new file mode 100644
index 0000000..cce5db5
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller16.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller16.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller16.phar.inc
new file mode 100644
index 0000000..3c9986d
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller16.phar.inc
@@ -0,0 +1,16 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller16.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller16.phar');
+$a['index.php'] = '<?php
+echo "hi";
+';
+$a->setStub('<?php
+try {
+Phar::webPhar("test.phar", "/index.php", null, array(), array("fail", "here"));
+} catch (Exception $e) {
+die($e->getMessage() . "\n");
+}
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller17.phar b/ext/phar/tests/cache_list/files/frontcontroller17.phar
new file mode 100644
index 0000000..b83d41f
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller17.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller17.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller17.phar.inc
new file mode 100644
index 0000000..85b8729
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller17.phar.inc
@@ -0,0 +1,16 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller17.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller17.phar');
+$a['index.php'] = '<?php
+echo "hi";
+';
+$a->setStub('<?php
+try {
+Phar::webPhar("test.phar", "/index.php", null, array(), "sort");
+} catch (Exception $e) {
+die($e->getMessage() . "\n");
+}
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller18.phar b/ext/phar/tests/cache_list/files/frontcontroller18.phar
new file mode 100644
index 0000000..c447f39
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller18.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller18.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller18.phar.inc
new file mode 100644
index 0000000..847a713
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller18.phar.inc
@@ -0,0 +1,19 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller18.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller18.phar');
+$a['index.php'] = '<?php
+echo "hi";
+';
+$a->setStub('<?php
+function s($a)
+{
+}
+try {
+Phar::webPhar("test.phar", "/index.php", null, array(), "s");
+} catch (Exception $e) {
+die($e->getMessage() . "\n");
+}
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller19.phar b/ext/phar/tests/cache_list/files/frontcontroller19.phar
new file mode 100644
index 0000000..bdf8ee1
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller19.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller19.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller19.phar.inc
new file mode 100644
index 0000000..ba84ac4
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller19.phar.inc
@@ -0,0 +1,25 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller19.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller19.phar');
+$a['start/index.php'] = '<?php
+echo "start/index.php\n";
+include "./another.php";
+';
+$a['start/another.php'] = '<?php
+echo "start/another.php\n";
+include "../another.php";
+?>';
+$a['another.php'] = '<?php
+echo "another.php\n";
+?>';
+$a->setStub('<?php
+set_include_path("phar://" . __FILE__);
+try {
+Phar::webPhar("test.phar", "/start/index.php");
+} catch (Exception $e) {
+die($e->getMessage() . "\n");
+}
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller2.phar b/ext/phar/tests/cache_list/files/frontcontroller2.phar
new file mode 100644
index 0000000..0dd0e7f
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller2.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller2.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller2.phar.inc
new file mode 100644
index 0000000..653c796
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller2.phar.inc
@@ -0,0 +1,12 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller2.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller2.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a->setStub('<?php
+Phar::webPhar("whatever", "a.php");
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller3.phar b/ext/phar/tests/cache_list/files/frontcontroller3.phar
new file mode 100644
index 0000000..35a23ea
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller3.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc
new file mode 100644
index 0000000..6f9126f
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller3.phar.inc
@@ -0,0 +1,18 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller3.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller3.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a->setStub('<?php
+function s($a)
+{
+ static $b = array(b"/hi" => "a.phps");
+ if (isset($b[$a])) return $b[$a];
+ return $a;
+}
+Phar::webPhar("whatever", "/index.php", null, array(), "s");
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller4.phar b/ext/phar/tests/cache_list/files/frontcontroller4.phar
new file mode 100644
index 0000000..8359461
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller4.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc
new file mode 100644
index 0000000..daf807e
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller4.phar.inc
@@ -0,0 +1,18 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller4.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller4.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a->setStub('<?php
+function s($a)
+{
+ static $b = array(b"/hi" => false);
+ if (isset($b[$a])) return $b[$a];
+ return $a;
+}
+Phar::webPhar("whatever", "index.php", null, array(), "s");
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller5.phar b/ext/phar/tests/cache_list/files/frontcontroller5.phar
new file mode 100644
index 0000000..f206b59
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller5.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller5.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller5.phar.inc
new file mode 100644
index 0000000..d2d810c
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller5.phar.inc
@@ -0,0 +1,12 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller5.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller5.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a->setStub('<?php
+Phar::webPhar("whatever", "index.php", null, array(0 => "oops"));
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller6.phar b/ext/phar/tests/cache_list/files/frontcontroller6.phar
new file mode 100644
index 0000000..f4a8265
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller6.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller6.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller6.phar.inc
new file mode 100644
index 0000000..5c900eb
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller6.phar.inc
@@ -0,0 +1,12 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller6.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller6.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a->setStub('<?php
+Phar::webPhar("whatever", "index.php", null, array("blah" => 100));
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller7.phar b/ext/phar/tests/cache_list/files/frontcontroller7.phar
new file mode 100644
index 0000000..07884b2
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller7.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller7.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller7.phar.inc
new file mode 100644
index 0000000..6849702
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller7.phar.inc
@@ -0,0 +1,12 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller7.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller7.phar');
+$a['a.php'] = 'hio';
+$a['a.jpg'] = 'hio';
+$a['a.phps'] = '<?php function hio(){}';
+$a->setStub('<?php
+Phar::webPhar("whatever", "index.php", null, array("blah" => null));
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller8.phar b/ext/phar/tests/cache_list/files/frontcontroller8.phar
new file mode 100644
index 0000000..c9c0e40
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller8.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc
new file mode 100644
index 0000000..8629f08
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller8.phar.inc
@@ -0,0 +1,19 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller8.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller8.phar');
+$a['a.phps'] = 'hio1';
+$a['a1.phps'] = '<?php var_dump($_SERVER[b"REQUEST_URI"], $_SERVER[b"PATH_INFO"]);';
+$a['a.jpg'] = 'hio2';
+$a['a.php'] = '<?php function hio(){}';
+$a['fronk.gronk'] = 'hio3';
+$a['404.php'] = 'My 404 is rawesome';
+$a['noext'] = 'hi';
+$a['unknown.ext'] = '<?php var_dump("hi");';
+$a['bigfile.txt'] = str_repeat('a', 8193);
+$a['fatalerror.phps'] = '<?php oopsie_daisy();';
+$a->setStub('<?php
+Phar::webPhar("whatever", "index.php", "404.php", array("jpg" => "foo/bar", "phps" => Phar::PHP, "php" => Phar::PHPS));
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/frontcontroller9.phar b/ext/phar/tests/cache_list/files/frontcontroller9.phar
new file mode 100644
index 0000000..39ca28c
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller9.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/frontcontroller9.phar.inc b/ext/phar/tests/cache_list/files/frontcontroller9.phar.inc
new file mode 100644
index 0000000..00861f6
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/frontcontroller9.phar.inc
@@ -0,0 +1,14 @@
+<?php
+@unlink(dirname(__FILE__) . '/frontcontroller9.phar');
+$a = new Phar(dirname(__FILE__) . '/frontcontroller9.phar');
+$a['a.phps'] = 'hio1';
+$a['a.jpg'] = 'hio2';
+$a['a.php'] = '<?php function hio(){}';
+$a['fronk.gronk'] = 'hio3';
+$a->setStub('<?php
+Phar::mungServer(array());
+Phar::webPhar("whatever", "index.php", null, array("jpg" => "foo/bar", "phps" => Phar::PHP, "php" => Phar::PHPS));
+echo "oops did not run\n";
+var_dump($_ENV, $_SERVER);
+__HALT_COMPILER();');
+?>
diff --git a/ext/phar/tests/cache_list/files/md5.phar b/ext/phar/tests/cache_list/files/md5.phar
new file mode 100644
index 0000000..8ca2f84
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/md5.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/nophar.phar b/ext/phar/tests/cache_list/files/nophar.phar
new file mode 100644
index 0000000..4eb3083
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/nophar.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/nophar.phar.inc b/ext/phar/tests/cache_list/files/nophar.phar.inc
new file mode 100644
index 0000000..36d5628
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/nophar.phar.inc
@@ -0,0 +1,10 @@
+<?php
+$fname = dirname(__FILE__) . '/nophar.phar';
+@unlink($fname);
+$p = new Phar($fname);
+$p['index.php'] = '<?php include "b/c.php";' . "\n";
+$p['web.php'] = '<?php echo "web\n";';
+$p['b/c.php'] = '<?php echo "in b\n";$a = fopen("index.php", "r", true);echo stream_get_contents($a);fclose($a);include dirname(__FILE__) . "/../d";';
+$p['d'] = "in d\n";
+$p->setStub($p->createDefaultStub('index.php', 'web.php'));
+?> \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/files/openssl.phar b/ext/phar/tests/cache_list/files/openssl.phar
new file mode 100644
index 0000000..f3864d7
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/openssl.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/openssl.phar.pubkey b/ext/phar/tests/cache_list/files/openssl.phar.pubkey
new file mode 100644
index 0000000..7dd79ac
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/openssl.phar.pubkey
@@ -0,0 +1,6 @@
+-----BEGIN PUBLIC KEY-----
+MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDA3ADUiKZIEhekYShzPCZ3LFbg
+rDuV44jH94OdJQfqaCQBvZXqMoG1bWOeYfbc3iO0gHWW3SKB27Sf1ZBnc5c1+YzB
+mx9bFipOX2W2ouKS2YoHeIoR9leDNu4yqwBsuggFPGVPxM9ikEI+YAOGVTCd4mV5
+agpkVsHLNJWbz/nPVwIDAQAB
+-----END PUBLIC KEY-----
diff --git a/ext/phar/tests/cache_list/files/phar_oo_test.inc b/ext/phar/tests/cache_list/files/phar_oo_test.inc
new file mode 100644
index 0000000..9863e8d
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/phar_oo_test.inc
@@ -0,0 +1,49 @@
+<?php
+
+ini_set('date.timezone', 'GMT');
+
+$fname = dirname(__FILE__) . '/phar_oo_test.phar.php';
+$pname = 'phar://' . $fname;
+$file = '<?php include "' . $pname . '/a.php"; __HALT_COMPILER(); ?>';
+
+$files = array();
+
+if (!isset($pharconfig)) $pharconfig = 0;
+
+switch($pharconfig)
+{
+ default:
+ case 0:
+ $files['a.php'] = '<?php echo "This is a.php\n"; ?>';
+ $files['b.php'] = '<?php echo "This is b.php\n"; ?>';
+ $files['b/c.php'] = '<?php echo "This is b/c.php\n"; ?>';
+ $files['b/d.php'] = '<?php echo "This is b/d.php\n"; ?>';
+ $files['e.php'] = '<?php echo "This is e.php\n"; ?>';
+ break;
+ case 1:
+ $files['a.csv'] =<<<EOF
+1,2,3
+2,a,b
+3,"c","'e'"
+EOF;
+ break;
+ case 2:
+ $files['a.csv'] =<<<EOF
+1,2,3
+2,a,b
+3,"c","'e'"
+4
+5,5
+
+7,777
+EOF;
+ break;
+ case 3:
+ $files['a.php'] = '<?php echo new new class;';
+ break;
+}
+
+$ftime = mktime(12, 0, 0, 3, 1, 2006);
+include 'phar_test.inc';
+
+?> \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/files/phar_test.inc b/ext/phar/tests/cache_list/files/phar_test.inc
new file mode 100644
index 0000000..f82471d
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/phar_test.inc
@@ -0,0 +1,78 @@
+<?php
+
+if (function_exists('date_default_timezone_set')) {
+ date_default_timezone_set('UTC');
+}
+
+$manifest = (binary)'';
+$glags = 0;
+
+foreach($files as $name => $cont)
+{
+ global $gflags, $files;
+
+ $comp = NULL;
+ $crc32= NULL;
+ $clen = NULL;
+ $ulen = NULL;
+ $time = isset($ftime) ? $ftime : @mktime(12, 0, 0, 3, 1, 2006);
+ $flags= 0;
+ $perm = 0x000001B6;
+ $meta = NULL;
+
+ // overwrite if array
+ if (is_array($cont))
+ {
+ foreach(array('comp','crc32','clen','ulen','time','flags','perm','meta','cont') as $what)
+ {
+ if (isset($cont[$what]))
+ {
+ $$what = $cont[$what];
+ }
+ }
+ }
+
+ // create if not yet done
+ if (empty($comp)) $comp = $cont;
+ if (empty($ulen)) $ulen = strlen($cont);
+ if (empty($clen)) $clen = strlen($comp);
+ if (empty($crc32))$crc32= crc32((binary)$cont);
+ if (isset($meta)) $meta = serialize($meta);
+
+ // write manifest entry
+ $manifest .= pack('V', strlen($name)) . (binary)$name;
+ $manifest .= pack('VVVVVV', $ulen, $time, $clen, $crc32, $flags|$perm, strlen($meta)) . (binary)$meta;
+
+ // globals
+ $gflags |= $flags;
+ $files[$name] = $comp;
+}
+
+if (!isset($alias)) $alias = 'hio';
+
+if (isset($pmeta)) $pmeta = serialize($pmeta); else $pmeta = '';
+
+$manifest = pack('VnVV', count($files), isset($hasdir) ? 0x1110 : 0x1000, $gflags, strlen($alias)) . (binary)$alias . pack('V', strlen($pmeta)) . (binary)$pmeta . $manifest;
+$file = (binary)$file;
+$file .= pack('V', strlen($manifest)) . $manifest;
+
+foreach($files as $cont)
+{
+ $file .= (binary)$cont;
+}
+
+file_put_contents($fname, $file);
+
+if (@$gzip) {
+ $fp = gzopen($fname, 'w');
+ fwrite($fp, $file);
+ fclose($fp);
+}
+
+if (@$bz2) {
+ $fp = bzopen($fname, 'w');
+ fwrite($fp, $file);
+ fclose($fp);
+}
+
+?> \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/files/private.pem b/ext/phar/tests/cache_list/files/private.pem
new file mode 100644
index 0000000..e4f4883
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/private.pem
@@ -0,0 +1,15 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIICXQIBAAKBgQDA3ADUiKZIEhekYShzPCZ3LFbgrDuV44jH94OdJQfqaCQBvZXq
+MoG1bWOeYfbc3iO0gHWW3SKB27Sf1ZBnc5c1+YzBmx9bFipOX2W2ouKS2YoHeIoR
+9leDNu4yqwBsuggFPGVPxM9ikEI+YAOGVTCd4mV5agpkVsHLNJWbz/nPVwIDAQAB
+AoGAGiS4qBbuE48ATXQuO5DH1hfYnxQ575Oskw7mdIL0k74SQ3ojvF+kXae6fVni
+UQZ76JgRWKYZa2kRDymwLZXpxVbiGL9dDvQY8ZENDtWOy9s7TDtxNixbZloKBopg
+J7G1B05LgetR3dgFnQOwt+e3kOu72RpS7thyBaUm8zHCRSECQQDw+h5uxE7i9CC8
+KHyJlwGoR28KZgrSpo74yWhQ+b1lzxQ+rk2wToFD/p+WNe/nf78YUl/cq0LngCKH
+Y7t228VLAkEAzOHzAjuDlGGzK6Kpe67iKgXd+GpKwPr9iaFfmzABOkRwQug4LCN7
+skmzCX5pzxqMZW1xNICjeDjWsMA3d4EypQJBAJyXPA1onYaXc2oxuPPD3/zVJpAQ
+TTojp8Z9Qr9T+kJdNV+h7rQB37gqjtOSiynY9nm8lbSUya4bstRd96S+HU8CQQCp
+yBAd6H2oZ7IXVeuHACyRUF1ab5LVCukxtVXJ/2T1CSPSfieWhC0MWMCR/HzoUALK
+RoBKVtOgW9GllRQh5yG1AkARVYbvj0XBy6XUpe5WZsLNWwpw1JreRsygcPXYh8bs
+nxhCdHNHJQ01lRDMjvNLtI8a5YjJE/IeW76T2mPCiJZI
+-----END RSA PRIVATE KEY-----
diff --git a/ext/phar/tests/cache_list/files/sha1.phar b/ext/phar/tests/cache_list/files/sha1.phar
new file mode 100644
index 0000000..c7e9e7e
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/sha1.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/sha256.phar b/ext/phar/tests/cache_list/files/sha256.phar
new file mode 100644
index 0000000..81459ee
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/sha256.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/sha512.phar b/ext/phar/tests/cache_list/files/sha512.phar
new file mode 100644
index 0000000..a747381
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/sha512.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write.phar b/ext/phar/tests/cache_list/files/write.phar
new file mode 100644
index 0000000..7acdaa6
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write.phar.inc b/ext/phar/tests/cache_list/files/write.phar.inc
new file mode 100644
index 0000000..eb722af
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write.phar.inc
@@ -0,0 +1,20 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$phar = new Phar(__FILE__);
+echo $phar["test.txt"]->getContent();
+$phar["test.txt"] = "changed
+";
+echo $phar["test.txt"]->getContent();
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar->setMetadata('hi');
+$phar['test.txt'] = "hi
+";
+$phar['test.txt']->setMetadata('hi');
+?>
diff --git a/ext/phar/tests/cache_list/files/write10.phar b/ext/phar/tests/cache_list/files/write10.phar
new file mode 100644
index 0000000..473f0a1
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write10.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write10.phar.inc b/ext/phar/tests/cache_list/files/write10.phar.inc
new file mode 100644
index 0000000..a23b5e5
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write10.phar.inc
@@ -0,0 +1,18 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write10.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p->getStub());
+$p2 = new Phar(__FILE__);
+$a = fopen("phar://" . __FILE__ . "/test.txt", "r");
+$p->setStub($a);
+echo $p2->getStub(),"\n";
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write11.phar b/ext/phar/tests/cache_list/files/write11.phar
new file mode 100644
index 0000000..bb8d33f
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write11.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write11.phar.inc b/ext/phar/tests/cache_list/files/write11.phar.inc
new file mode 100644
index 0000000..d255264
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write11.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write11.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p->getStub());
+$p2 = new Phar(__FILE__);
+$p->setDefaultStub();
+echo strlen($p2->getStub()),"\n";
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write12.phar b/ext/phar/tests/cache_list/files/write12.phar
new file mode 100644
index 0000000..bff1456
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write12.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write12.phar.inc b/ext/phar/tests/cache_list/files/write12.phar.inc
new file mode 100644
index 0000000..f0c01eb
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write12.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write12.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p->getSignature());
+$p2 = new Phar(__FILE__);
+$p->setSignatureAlgorithm(Phar::MD5);
+var_dump($p->getSignature());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write13.phar b/ext/phar/tests/cache_list/files/write13.phar
new file mode 100644
index 0000000..46ca14d
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write13.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write13.phar.inc b/ext/phar/tests/cache_list/files/write13.phar.inc
new file mode 100644
index 0000000..e8b6f33
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write13.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write13.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p["test.txt"]->isCompressed());
+$p2 = new Phar(__FILE__);
+$p->compressFiles(Phar::GZ);
+var_dump($p["test.txt"]->isCompressed());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write14.phar b/ext/phar/tests/cache_list/files/write14.phar
new file mode 100644
index 0000000..4482752
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write14.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write14.phar.inc b/ext/phar/tests/cache_list/files/write14.phar.inc
new file mode 100644
index 0000000..c2b0448
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write14.phar.inc
@@ -0,0 +1,18 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write14.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p["test.txt"]->isCompressed());
+$p2 = new Phar(__FILE__);
+$p->decompressFiles();
+var_dump($p["test.txt"]->isCompressed());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+$phar->compressFiles(Phar::GZ);
+?>
diff --git a/ext/phar/tests/cache_list/files/write15.phar b/ext/phar/tests/cache_list/files/write15.phar
new file mode 100644
index 0000000..c6190b7
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write15.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write15.phar.inc b/ext/phar/tests/cache_list/files/write15.phar.inc
new file mode 100644
index 0000000..d30f6c8
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write15.phar.inc
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write15.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(isset($p["copied"]));
+$p->copy("test.txt","copied");
+var_dump(isset($p["copied"]));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write16.phar b/ext/phar/tests/cache_list/files/write16.phar
new file mode 100644
index 0000000..05106ea
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write16.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write16.phar.inc b/ext/phar/tests/cache_list/files/write16.phar.inc
new file mode 100644
index 0000000..b7a1b38
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write16.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write16.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(isset($p["test.txt"]));
+unset($p["test.txt"]);
+var_dump(isset($p["test.txt"]));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+$phar['test2.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write17.phar b/ext/phar/tests/cache_list/files/write17.phar
new file mode 100644
index 0000000..52ddb5e
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write17.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write17.phar.inc b/ext/phar/tests/cache_list/files/write17.phar.inc
new file mode 100644
index 0000000..47f5ea3
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write17.phar.inc
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write17.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p->getMetadata());
+$p->setMetadata("hi");
+var_dump($p->getMetadata());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write18.phar b/ext/phar/tests/cache_list/files/write18.phar
new file mode 100644
index 0000000..3fc9fe1
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write18.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write18.phar.inc b/ext/phar/tests/cache_list/files/write18.phar.inc
new file mode 100644
index 0000000..fca867d
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write18.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write18.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+echo decoct(fileperms("phar://" . __FILE__ . "/test.txt")),"\n";
+$p["test.txt"]->chmod(0444);
+echo decoct(fileperms("phar://" . __FILE__ . "/test.txt")),"\n";
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+$phar["test.txt"]->chmod(0666);
+?>
diff --git a/ext/phar/tests/cache_list/files/write19.phar b/ext/phar/tests/cache_list/files/write19.phar
new file mode 100644
index 0000000..9e8b7ee
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write19.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write19.phar.inc b/ext/phar/tests/cache_list/files/write19.phar.inc
new file mode 100644
index 0000000..55115ad
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write19.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write19.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p["test.txt"]->getMetadata());
+$p["test.txt"]->setMetadata("hi2");
+var_dump($p["test.txt"]->getMetadata());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+$phar["test.txt"]->setMetadata("hi");
+?>
diff --git a/ext/phar/tests/cache_list/files/write2.phar b/ext/phar/tests/cache_list/files/write2.phar
new file mode 100644
index 0000000..0941025
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write2.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write2.phar.inc b/ext/phar/tests/cache_list/files/write2.phar.inc
new file mode 100644
index 0000000..7a4e2e3
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write2.phar.inc
@@ -0,0 +1,23 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write2.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$phar = new Phar(__FILE__);
+var_dump($phar->getMetadata());
+mkdir("phar://" . __FILE__ . "/test");
+var_dump(is_dir("phar://" . __FILE__ . "/test"));
+$phar2 = new Phar(__FILE__);
+var_dump($phar2->getMetadata());
+var_dump(isset($phar["test"]));
+var_dump(isset($phar2["test"]));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar->setMetadata('hi');
+$phar['test.txt'] = "hi
+";
+$phar['test.txt']->setMetadata('hi');
+?>
diff --git a/ext/phar/tests/cache_list/files/write20.phar b/ext/phar/tests/cache_list/files/write20.phar
new file mode 100644
index 0000000..6109264
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write20.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write20.phar.inc b/ext/phar/tests/cache_list/files/write20.phar.inc
new file mode 100644
index 0000000..d356bfb
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write20.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write20.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p["test.txt"]->getMetadata());
+$p["test.txt"]->delMetadata();
+var_dump($p["test.txt"]->getMetadata());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+$phar["test.txt"]->setMetadata("hi");
+?>
diff --git a/ext/phar/tests/cache_list/files/write21.phar b/ext/phar/tests/cache_list/files/write21.phar
new file mode 100644
index 0000000..fad2165
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write21.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write21.phar.inc b/ext/phar/tests/cache_list/files/write21.phar.inc
new file mode 100644
index 0000000..79bfb20
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write21.phar.inc
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write21.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p["test.txt"]->isCompressed());
+$p["test.txt"]->compress(Phar::GZ);
+var_dump($p["test.txt"]->isCompressed());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write22.phar b/ext/phar/tests/cache_list/files/write22.phar
new file mode 100644
index 0000000..c3c5ce1
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write22.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write22.phar.inc b/ext/phar/tests/cache_list/files/write22.phar.inc
new file mode 100644
index 0000000..861cabb
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write22.phar.inc
@@ -0,0 +1,17 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write22.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p["test.txt"]->isCompressed());
+$p["test.txt"]->decompress();
+var_dump($p["test.txt"]->isCompressed());
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+$phar['test.txt']->compress(Phar::GZ);
+?>
diff --git a/ext/phar/tests/cache_list/files/write23.phar b/ext/phar/tests/cache_list/files/write23.phar
new file mode 100644
index 0000000..2246f61
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write23.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write23.phar.inc b/ext/phar/tests/cache_list/files/write23.phar.inc
new file mode 100644
index 0000000..ac92a85
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write23.phar.inc
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write23.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(isset($p["test.txt"]), isset($p["newname"]));
+rename("phar://" . __FILE__ . "/test.txt", "phar://" . __FILE__ . "/newname");
+var_dump(isset($p["test.txt"]), isset($p["newname"]));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write24.phar b/ext/phar/tests/cache_list/files/write24.phar
new file mode 100644
index 0000000..36972f3
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write24.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write24.phar.inc b/ext/phar/tests/cache_list/files/write24.phar.inc
new file mode 100644
index 0000000..216f7c4
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write24.phar.inc
@@ -0,0 +1,18 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write24.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(isset($p["newname"]));
+$fp = fopen("phar://" . __FILE__ . "/newname", "w");
+fwrite($fp, b"hi");
+fclose($fp);
+var_dump(isset($p["newname"]));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write25.phar b/ext/phar/tests/cache_list/files/write25.phar
new file mode 100644
index 0000000..93b301c
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write25.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write25.phar.inc b/ext/phar/tests/cache_list/files/write25.phar.inc
new file mode 100644
index 0000000..60a6978
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write25.phar.inc
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write25.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(isset($p["mounted"]));
+Phar::mount("mounted", "phar://" . __FILE__ . "/test.txt");
+var_dump(isset($p["mounted"]));
+echo $p["mounted"]->getContent(),"\nok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "<?php __HALT"."_COMPILER();";
+?>
diff --git a/ext/phar/tests/cache_list/files/write3.phar b/ext/phar/tests/cache_list/files/write3.phar
new file mode 100644
index 0000000..5ce4a95
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write3.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write3.phar.inc b/ext/phar/tests/cache_list/files/write3.phar.inc
new file mode 100644
index 0000000..686c065
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write3.phar.inc
@@ -0,0 +1,21 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write3.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+clearstatcache();
+var_dump(file_exists("phar://" . __FILE__ . "/test"), is_dir("phar://" . __FILE__ . "/test"));
+rmdir("phar://" . __FILE__ . "/test");
+clearstatcache();
+var_dump(file_exists("phar://" . __FILE__ . "/test"), is_dir("phar://" . __FILE__ . "/test"));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar->setMetadata('hi');
+$phar['test.txt'] = "hi
+";
+$phar['test.txt']->setMetadata('hi');
+$phar->addEmptyDir('test');
+?>
diff --git a/ext/phar/tests/cache_list/files/write4.phar b/ext/phar/tests/cache_list/files/write4.phar
new file mode 100644
index 0000000..c267bab
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write4.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write4.phar.inc b/ext/phar/tests/cache_list/files/write4.phar.inc
new file mode 100644
index 0000000..5b476ed
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write4.phar.inc
@@ -0,0 +1,16 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write4.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+var_dump(file_exists("phar://" . __FILE__ . "/test.txt"));
+clearstatcache();
+Phar::mount("test.txt", "phar://" . __FILE__ . "/tobemounted");
+var_dump(file_exists("phar://" . __FILE__ . "/test.txt"), file_get_contents("phar://" . __FILE__ . "/test.txt"));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['tobemounted'] = "hi";
+?>
diff --git a/ext/phar/tests/cache_list/files/write5.phar b/ext/phar/tests/cache_list/files/write5.phar
new file mode 100644
index 0000000..52635b4
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write5.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write5.phar.inc b/ext/phar/tests/cache_list/files/write5.phar.inc
new file mode 100644
index 0000000..5e7b9bb
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write5.phar.inc
@@ -0,0 +1,29 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write5.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$phar = new Phar(__FILE__);
+$d = dirname(__FILE__) . "/copyonwrite5";
+mkdir($d);
+file_put_contents($d . "/file1", "file1\n");
+file_put_contents($d . "/file2", "file2\n");
+$arr = $phar->buildFromDirectory($d);
+ksort($arr);
+var_dump($arr);
+$phar2 = new Phar(__FILE__);
+$arr = array();
+foreach ($phar2 as $name => $file) {
+ $arr[$name] = $file->getContent();
+}
+ksort($arr);
+foreach ($arr as $name => $content) {
+ echo $name, " ", $content;
+}
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['hi'] = "hi\n";
+?>
diff --git a/ext/phar/tests/cache_list/files/write6.phar b/ext/phar/tests/cache_list/files/write6.phar
new file mode 100644
index 0000000..e3e4341
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write6.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write6.phar.inc b/ext/phar/tests/cache_list/files/write6.phar.inc
new file mode 100644
index 0000000..3ba5db3
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write6.phar.inc
@@ -0,0 +1,30 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write6.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$phar = new Phar(__FILE__);
+$d = dirname(__FILE__) . "/copyonwrite6";
+mkdir($d);
+file_put_contents($d . "/file1", "file1\n");
+file_put_contents($d . "/file2", "file2\n");
+$arr = $phar->buildFromIterator(new RecursiveDirectoryIterator($d, RecursiveDirectoryIterator::SKIP_DOTS),$d);
+$arr = $phar->buildFromDirectory($d);
+ksort($arr);
+var_dump($arr);
+$phar2 = new Phar(__FILE__);
+$arr = array();
+foreach ($phar2 as $name => $file) {
+ $arr[$name] = $file->getContent();
+}
+ksort($arr);
+foreach ($arr as $name => $content) {
+ echo $name, " ", $content;
+}
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['hi'] = "hi\n";
+?>
diff --git a/ext/phar/tests/cache_list/files/write7.phar b/ext/phar/tests/cache_list/files/write7.phar
new file mode 100644
index 0000000..e5854ec
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write7.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write7.phar.inc b/ext/phar/tests/cache_list/files/write7.phar.inc
new file mode 100644
index 0000000..ef5b8b2
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write7.phar.inc
@@ -0,0 +1,18 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write7.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump(file_exists("phar://" . __FILE__ . "/test.txt"));
+$p->delete("test.txt");
+clearstatcache();
+var_dump(file_exists("phar://" . __FILE__ . "/test.txt"));
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "hi
+";
+?>
diff --git a/ext/phar/tests/cache_list/files/write8.phar b/ext/phar/tests/cache_list/files/write8.phar
new file mode 100644
index 0000000..d5d63be
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write8.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write8.phar.inc b/ext/phar/tests/cache_list/files/write8.phar.inc
new file mode 100644
index 0000000..2b733a7
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write8.phar.inc
@@ -0,0 +1,18 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write8.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p->getAlias());
+$p2 = new Phar(__FILE__);
+$p->setAlias("hi");
+echo $p2->getAlias(),"\n";
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "hi
+";
+?>
diff --git a/ext/phar/tests/cache_list/files/write9.phar b/ext/phar/tests/cache_list/files/write9.phar
new file mode 100644
index 0000000..c012c17
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write9.phar
Binary files differ
diff --git a/ext/phar/tests/cache_list/files/write9.phar.inc b/ext/phar/tests/cache_list/files/write9.phar.inc
new file mode 100644
index 0000000..ed3e681
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/write9.phar.inc
@@ -0,0 +1,18 @@
+<?php
+
+$fname = dirname(__FILE__) . '/write9.phar';
+@unlink($fname);
+
+$phar = new Phar($fname);
+$phar->setStub('<?php
+$p = new Phar(__FILE__);
+var_dump($p->getStub());
+$p2 = new Phar(__FILE__);
+$p->setStub("<?php __HALT"."_COMPILER();");
+echo $p2->getStub(),"\n";
+echo "ok\n";
+__HALT_COMPILER();
+?>');
+$phar['test.txt'] = "hi
+";
+?>
diff --git a/ext/phar/tests/cache_list/files/zfapp.tgz b/ext/phar/tests/cache_list/files/zfapp.tgz
new file mode 100644
index 0000000..fcaec86
--- /dev/null
+++ b/ext/phar/tests/cache_list/files/zfapp.tgz
Binary files differ
diff --git a/ext/phar/tests/cache_list/frontcontroller1.phpt b/ext/phar/tests/cache_list/frontcontroller1.phpt
new file mode 100644
index 0000000..d0d5552
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller1.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller other
+--INI--
+phar.cache_list={PWD}/frontcontroller1.php [cache_list]
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller1.php
+REQUEST_URI=/frontcontroller1.php/a.jpg
+PATH_INFO=/a.jpg
+--FILE_EXTERNAL--
+files/frontcontroller.phar
+--EXPECTHEADERS--
+Content-type: image/jpeg
+Content-length: 3
+--EXPECT--
+hio
diff --git a/ext/phar/tests/cache_list/frontcontroller10.phpt b/ext/phar/tests/cache_list/frontcontroller10.phpt
new file mode 100644
index 0000000..00177d4
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller10.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Phar front controller rewrite access denied [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller10.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller10.php
+REQUEST_URI=/frontcontroller10.php/hi
+PATH_INFO=/hi
+--FILE_EXTERNAL--
+files/frontcontroller4.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+Status: 403 Access Denied
+--EXPECT--
+<html>
+ <head>
+ <title>Access Denied</title>
+ </head>
+ <body>
+ <h1>403 - File /hi Access Denied</h1>
+ </body>
+</html>
diff --git a/ext/phar/tests/cache_list/frontcontroller11.phpt b/ext/phar/tests/cache_list/frontcontroller11.phpt
new file mode 100644
index 0000000..25b147e
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller11.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Phar front controller mime type extension is not a string [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller11.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+<?php die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller11.php
+REQUEST_URI=/frontcontroller11.php/a.php
+PATH_INFO=/a.php
+--FILE_EXTERNAL--
+files/frontcontroller5.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+Fatal error: Uncaught exception 'PharException' with message 'Key of MIME type overrides array must be a file extension, was "0"' in %sfrontcontroller11.php:2
+Stack trace:
+#0 %sfrontcontroller11.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#1 {main}
+ thrown in %sfrontcontroller11.php on line 2 \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller12.phpt b/ext/phar/tests/cache_list/frontcontroller12.phpt
new file mode 100644
index 0000000..cfc7d0e
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller12.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Phar front controller mime type unknown int [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller12.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller12.php
+REQUEST_URI=/frontcontroller12.php/a.php
+PATH_INFO=/a.php
+--FILE_EXTERNAL--
+files/frontcontroller6.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used, only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller12.php:2
+Stack trace:
+#0 %sfrontcontroller12.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#1 {main}
+ thrown in %sfrontcontroller12.php on line 2 \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller13.phpt b/ext/phar/tests/cache_list/frontcontroller13.phpt
new file mode 100644
index 0000000..e6c9dee
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller13.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Phar front controller mime type not string/int [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller13.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller13.php
+REQUEST_URI=/frontcontroller13.php/a.php
+PATH_INFO=/a.php
+--FILE_EXTERNAL--
+files/frontcontroller7.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+Fatal error: Uncaught exception 'PharException' with message 'Unknown mime type specifier used (not a string or int), only Phar::PHP, Phar::PHPS and a mime type string are allowed' in %sfrontcontroller13.php:2
+Stack trace:
+#0 %sfrontcontroller13.php(2): Phar::webPhar('whatever', 'index.php', '', Array)
+#1 {main}
+ thrown in %sfrontcontroller13.php on line 2 \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller14.phpt b/ext/phar/tests/cache_list/frontcontroller14.phpt
new file mode 100644
index 0000000..bbd9637
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller14.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller mime type override, other [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller14.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller14.php
+REQUEST_URI=/frontcontroller14.php/a.jpg
+PATH_INFO=/a.jpg
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: foo/bar
+Content-length: 4
+--EXPECT--
+hio2
diff --git a/ext/phar/tests/cache_list/frontcontroller15.phpt b/ext/phar/tests/cache_list/frontcontroller15.phpt
new file mode 100644
index 0000000..d142a5d
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller15.phpt
@@ -0,0 +1,21 @@
+--TEST--
+Phar front controller mime type override, Phar::PHPS [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller15.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller15.php
+REQUEST_URI=/frontcontroller15.php/a.php
+PATH_INFO=/a.php
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECT--
+<code><span style="color: #000000">
+<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
+</span>
+</code>
+
diff --git a/ext/phar/tests/cache_list/frontcontroller16.phpt b/ext/phar/tests/cache_list/frontcontroller16.phpt
new file mode 100644
index 0000000..10bebdc
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller16.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller mime type override, Phar::PHP [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller16.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller16.php
+REQUEST_URI=/frontcontroller16.php/a.phps
+PATH_INFO=/a.phps
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECT--
+hio1
+
diff --git a/ext/phar/tests/cache_list/frontcontroller17.phpt b/ext/phar/tests/cache_list/frontcontroller17.phpt
new file mode 100644
index 0000000..35d3ae4
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller17.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller mime type unknown [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller17.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller17.php
+REQUEST_URI=/frontcontroller17.php/fronk.gronk
+PATH_INFO=/fronk.gronk
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: application/octet-stream
+Content-length: 4
+--EXPECT--
+hio3
+
diff --git a/ext/phar/tests/cache_list/frontcontroller18.phpt b/ext/phar/tests/cache_list/frontcontroller18.phpt
new file mode 100644
index 0000000..5e94bf6
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller18.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller $_SERVER munging failure [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller18.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller18.php
+REQUEST_URI=/frontcontroller18.php/fronk.gronk
+PATH_INFO=/fronk.gronk
+--FILE_EXTERNAL--
+files/frontcontroller9.phar
+--EXPECTF--
+Fatal error: Uncaught exception 'PharException' with message 'No values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME' in %sfrontcontroller18.php:2
+Stack trace:
+#0 %sfrontcontroller18.php(2): Phar::mungServer(Array)
+#1 {main}
+ thrown in %sfrontcontroller18.php on line 2
diff --git a/ext/phar/tests/cache_list/frontcontroller19.phpt b/ext/phar/tests/cache_list/frontcontroller19.phpt
new file mode 100644
index 0000000..bed0b1d
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller19.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller $_SERVER munging failure 2 [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller19.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller19.php
+REQUEST_URI=/frontcontroller19.php/
+PATH_INFO=/
+--FILE_EXTERNAL--
+files/frontcontroller10.phar
+--EXPECTF--
+Fatal error: Uncaught exception 'PharException' with message 'Too many values passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME' in %sfrontcontroller19.php:2
+Stack trace:
+#0 %sfrontcontroller19.php(2): Phar::mungServer(Array)
+#1 {main}
+ thrown in %sfrontcontroller19.php on line 2
diff --git a/ext/phar/tests/cache_list/frontcontroller2.phpt b/ext/phar/tests/cache_list/frontcontroller2.phpt
new file mode 100644
index 0000000..67ccfc1
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller2.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller PHP test [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list=frontcontroller2.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller2.php
+REQUEST_URI=/frontcontroller2.php/a.php
+PATH_INFO=/a.php
+--FILE_EXTERNAL--
+files/frontcontroller.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECT--
+hio
diff --git a/ext/phar/tests/cache_list/frontcontroller20.phpt b/ext/phar/tests/cache_list/frontcontroller20.phpt
new file mode 100644
index 0000000..bf333c7
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller20.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller $_SERVER munging failure 3 [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller20.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller20.php
+REQUEST_URI=/frontcontroller20.php/
+PATH_INFO=/
+--FILE_EXTERNAL--
+files/frontcontroller11.phar
+--EXPECTF--
+Fatal error: Uncaught exception 'PharException' with message 'Non-string value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME' in %sfrontcontroller20.php:2
+Stack trace:
+#0 %sfrontcontroller20.php(2): Phar::mungServer(Array)
+#1 {main}
+ thrown in %sfrontcontroller20.php on line 2
diff --git a/ext/phar/tests/cache_list/frontcontroller21.phpt b/ext/phar/tests/cache_list/frontcontroller21.phpt
new file mode 100644
index 0000000..829f298
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller21.phpt
@@ -0,0 +1,25 @@
+--TEST--
+Phar front controller $_SERVER munging success [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller21.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller21.php
+REQUEST_URI=/frontcontroller21.php/index.php?test=hi
+PATH_INFO=/index.php
+QUERY_STRING=test=hi
+--FILE_EXTERNAL--
+files/frontcontroller12.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+%unicode|string%(10) "/index.php"
+string(10) "/index.php"
+string(%d) "phar://%sfrontcontroller21.php/index.php"
+string(18) "/index.php?test=hi"
+string(32) "/frontcontroller21.php/index.php"
+string(22) "/frontcontroller21.php"
+string(%d) "%sfrontcontroller21.php"
+string(40) "/frontcontroller21.php/index.php?test=hi" \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller22.phpt b/ext/phar/tests/cache_list/frontcontroller22.phpt
new file mode 100644
index 0000000..2769b01
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller22.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Phar front controller include from cwd test 1 [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller22.phpt
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller22.php
+REQUEST_URI=/frontcontroller22.php/index.php
+PATH_INFO=/index.php
+--FILE_EXTERNAL--
+files/frontcontroller13.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+%string|unicode%(4) "test"
+%string|unicode%(12) "oof/test.php"
+
+Warning: include(./hi.php): failed to open stream: No such file or directory in phar://%s/oof/test.php on line %d
+
+Warning: include(): Failed opening './hi.php' for inclusion (include_path='%s') in phar://%soof/test.php on line %d \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller23.phpt b/ext/phar/tests/cache_list/frontcontroller23.phpt
new file mode 100644
index 0000000..3da9631
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller23.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller with generic action router test [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller23.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller23.php
+REQUEST_URI=/frontcontroller23.php/hi/there
+PATH_INFO=/hi/there
+--FILE_EXTERNAL--
+files/frontcontroller14.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+string(9) "/hi/there"
+string(%d) "phar://%sfrontcontroller23.php/html/index.php" \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller24.phpt b/ext/phar/tests/cache_list/frontcontroller24.phpt
new file mode 100644
index 0000000..561826b
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller24.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller with custom 404 php script [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller24.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller24.php
+REQUEST_URI=/frontcontroller24.php/unknown/file
+PATH_INFO=/unknown/file
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+My 404 is rawesome \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller25.phpt b/ext/phar/tests/cache_list/frontcontroller25.phpt
new file mode 100644
index 0000000..a877939
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller25.phpt
@@ -0,0 +1,18 @@
+--TEST--
+Phar front controller with extra path_info [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller25.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller25.php
+REQUEST_URI=/frontcontroller25.php/a1.phps/extra/stuff
+PATH_INFO=/a1.phps/extra/stuff
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+string(42) "/frontcontroller25.php/a1.phps/extra/stuff"
+string(12) "/extra/stuff" \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller26.phpt b/ext/phar/tests/cache_list/frontcontroller26.phpt
new file mode 100644
index 0000000..86a1c14
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller26.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar front controller with unknown extension mime type [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller26.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller26.php
+REQUEST_URI=/frontcontroller26.php/unknown.ext
+PATH_INFO=/unknown.ext
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: application/octet-stream
+--EXPECTF--
+<?php var_dump("hi"); \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller27.phpt b/ext/phar/tests/cache_list/frontcontroller27.phpt
new file mode 100644
index 0000000..4a76e02
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller27.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller with no extension [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller27.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller27.php
+REQUEST_URI=/frontcontroller27.php/noext
+PATH_INFO=/noext
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/plain;charset=UTF-8
+--EXPECTF--
+hi \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller28.phpt b/ext/phar/tests/cache_list/frontcontroller28.phpt
new file mode 100644
index 0000000..80059a9
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller28.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller with huge file [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller28.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller28.php
+REQUEST_URI=/frontcontroller28.php/bigfile.txt
+PATH_INFO=/bigfile.txt
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/plain;charset=UTF-8
+--EXPECT--
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
diff --git a/ext/phar/tests/cache_list/frontcontroller29.phpt b/ext/phar/tests/cache_list/frontcontroller29.phpt
new file mode 100644
index 0000000..1cd8f96
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller29.phpt
@@ -0,0 +1,17 @@
+--TEST--
+Phar front controller with fatal error in php file [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller29.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller29.php
+REQUEST_URI=/frontcontroller29.php/fatalerror.phps
+PATH_INFO=/fatalerror.phps
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECTF--
+Fatal error: Call to undefined function oopsie_daisy() in phar://%sfatalerror.phps on line 1 \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller3.phpt b/ext/phar/tests/cache_list/frontcontroller3.phpt
new file mode 100644
index 0000000..1c1b479
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller3.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Phar front controller phps [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller3.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller3.php
+REQUEST_URI=/frontcontroller3.php/a.phps
+PATH_INFO=/a.phps
+--FILE_EXTERNAL--
+files/frontcontroller.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECT--
+<code><span style="color: #000000">
+<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
+</span>
+</code>
diff --git a/ext/phar/tests/cache_list/frontcontroller30.phpt b/ext/phar/tests/cache_list/frontcontroller30.phpt
new file mode 100644
index 0000000..5a63da8
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller30.phpt
@@ -0,0 +1,14 @@
+--TEST--
+Phar front controller with weird SCRIPT_NAME [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller30.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/huh?
+REQUEST_URI=/huh?
+--FILE_EXTERNAL--
+files/frontcontroller8.phar
+--EXPECTF--
+oops did not run
+%a \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller31.phpt b/ext/phar/tests/cache_list/frontcontroller31.phpt
new file mode 100644
index 0000000..9ef1221
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller31.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar front controller with invalid callback for rewrites [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller31.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller31.php
+REQUEST_URI=/frontcontroller31.php
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--FILE_EXTERNAL--
+files/frontcontroller16.phar
+--EXPECT--
+phar error: invalid rewrite callback \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller32.phpt b/ext/phar/tests/cache_list/frontcontroller32.phpt
new file mode 100644
index 0000000..5911690
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller32.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar front controller with valid callback that is not good [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller32.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller32.php
+REQUEST_URI=/frontcontroller32.php
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--FILE_EXTERNAL--
+files/frontcontroller17.phar
+--EXPECTF--
+%ahar error: failed to call rewrite callback \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller33.phpt b/ext/phar/tests/cache_list/frontcontroller33.phpt
new file mode 100644
index 0000000..9573854
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller33.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar front controller with valid callback that does not return any value [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller33.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller33.php
+REQUEST_URI=/frontcontroller33.php
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--FILE_EXTERNAL--
+files/frontcontroller18.phar
+--EXPECTF--
+phar error: rewrite callback must return a string or false \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller34.phpt b/ext/phar/tests/cache_list/frontcontroller34.phpt
new file mode 100644
index 0000000..83c22f5
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller34.phpt
@@ -0,0 +1,19 @@
+--TEST--
+Phar front controller with cwd [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller34.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller34.php
+REQUEST_URI=/frontcontroller34.php/start/index.php
+PATH_INFO=/start/index.php
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--FILE_EXTERNAL--
+files/frontcontroller19.phar
+--EXPECT--
+start/index.php
+start/another.php
+another.php
diff --git a/ext/phar/tests/cache_list/frontcontroller4.phpt b/ext/phar/tests/cache_list/frontcontroller4.phpt
new file mode 100644
index 0000000..5cf3682
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller4.phpt
@@ -0,0 +1,15 @@
+--TEST--
+Phar front controller index.php relocate (no /) [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller4.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller4.php
+REQUEST_URI=/frontcontroller4.php
+--FILE_EXTERNAL--
+files/frontcontroller.phar
+--EXPECTHEADERS--
+Status: 301 Moved Permanently
+Location: /frontcontroller4.php/index.php
+--EXPECT--
diff --git a/ext/phar/tests/cache_list/frontcontroller5.phpt b/ext/phar/tests/cache_list/frontcontroller5.phpt
new file mode 100644
index 0000000..2c738d7
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller5.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar front controller index.php relocate [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller5.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller5.php
+REQUEST_URI=/frontcontroller5.php/
+PATH_INFO=/
+--FILE_EXTERNAL--
+files/frontcontroller.phar
+--EXPECTHEADERS--
+Status: 301 Moved Permanently
+Location: /frontcontroller5.php/index.php
+--EXPECT--
diff --git a/ext/phar/tests/cache_list/frontcontroller6.phpt b/ext/phar/tests/cache_list/frontcontroller6.phpt
new file mode 100644
index 0000000..2480be4
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller6.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Phar front controller 404 [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller6.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller6.php
+REQUEST_URI=/frontcontroller6.php/notfound.php
+PATH_INFO=/notfound.php
+--FILE_EXTERNAL--
+files/frontcontroller.phar
+--EXPECTHEADERS--
+Status: 404 Not Found
+--EXPECT--
+<html>
+ <head>
+ <title>File Not Found</title>
+ </head>
+ <body>
+ <h1>404 - File /notfound.php Not Found</h1>
+ </body>
+</html> \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller7.phpt b/ext/phar/tests/cache_list/frontcontroller7.phpt
new file mode 100644
index 0000000..a8a88a9
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller7.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Phar front controller alternate index file [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller7.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller7.php
+REQUEST_URI=/frontcontroller7.php/
+PATH_INFO=/
+--FILE_EXTERNAL--
+files/frontcontroller2.phar
+--EXPECTHEADERS--
+Status: 301 Moved Permanently
+Location: /frontcontroller7.php/a.php
+--EXPECT--
diff --git a/ext/phar/tests/cache_list/frontcontroller8.phpt b/ext/phar/tests/cache_list/frontcontroller8.phpt
new file mode 100644
index 0000000..bf9b390
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller8.phpt
@@ -0,0 +1,23 @@
+--TEST--
+Phar front controller no index file 404 [cache_list]
+--INI--
+phar.cache_list={PWD}/frontcontroller8.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller8.php
+REQUEST_URI=/frontcontroller8.php/
+PATH_INFO=/
+--FILE_EXTERNAL--
+files/frontcontroller3.phar
+--EXPECTHEADERS--
+Status: 404 Not Found
+--EXPECT--
+<html>
+ <head>
+ <title>File Not Found</title>
+ </head>
+ <body>
+ <h1>404 - File /index.php Not Found</h1>
+ </body>
+</html> \ No newline at end of file
diff --git a/ext/phar/tests/cache_list/frontcontroller9.phpt b/ext/phar/tests/cache_list/frontcontroller9.phpt
new file mode 100644
index 0000000..1a8b916
--- /dev/null
+++ b/ext/phar/tests/cache_list/frontcontroller9.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Phar front controller rewrite array [cache_list]
+--INI--
+default_charset=UTF-8
+phar.cache_list={PWD}/frontcontroller9.php
+--SKIPIF--
+<?php if (!extension_loaded("phar")) die("skip"); ?>
+--ENV--
+SCRIPT_NAME=/frontcontroller9.php
+REQUEST_URI=/frontcontroller9.php/hi
+PATH_INFO=/hi
+--FILE_EXTERNAL--
+files/frontcontroller3.phar
+--EXPECTHEADERS--
+Content-type: text/html; charset=UTF-8
+--EXPECT--
+<code><span style="color: #000000">
+<span style="color: #0000BB">&lt;?php&nbsp;</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">hio</span><span style="color: #007700">(){}</span>
+</span>
+</code> \ No newline at end of file