From 3a5401755608ee00d6f42f0dae0cf54c0518a5f9 Mon Sep 17 00:00:00 2001 From: Greg Beaver Date: Mon, 13 Oct 2008 04:21:09 +0000 Subject: [PATCH] add complete tests verifying copy-on-write for cached phars --- .../tests/cache_list/copyonwrite10.phar.phpt | 24 ++++++++++++++++ .../tests/cache_list/copyonwrite11.phar.phpt | 22 ++++++++++++++ .../tests/cache_list/copyonwrite12.phar.phpt | 24 ++++++++++++++++ .../tests/cache_list/copyonwrite13.phar.phpt | 15 ++++++++++ .../tests/cache_list/copyonwrite14.phar.phpt | 15 ++++++++++ .../tests/cache_list/copyonwrite15.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite16.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite17.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite18.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite19.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite20.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite21.phar.phpt | 15 ++++++++++ .../tests/cache_list/copyonwrite22.phar.phpt | 15 ++++++++++ .../tests/cache_list/copyonwrite23.phar.phpt | 17 +++++++++++ .../tests/cache_list/copyonwrite24.phar.phpt | 15 ++++++++++ .../tests/cache_list/copyonwrite4.phar.phpt | 15 ++++++++++ ext/phar/tests/cache_list/copyonwrite4a.phpt | 20 +++++++++++++ .../tests/cache_list/copyonwrite5.phar.phpt | 27 ++++++++++++++++++ .../tests/cache_list/copyonwrite6.phar.phpt | 27 ++++++++++++++++++ .../tests/cache_list/copyonwrite7.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite8.phar.phpt | 14 +++++++++ .../tests/cache_list/copyonwrite9.phar.phpt | 23 +++++++++++++++ ext/phar/tests/cache_list/files/write10.phar | Bin 0 -> 324 bytes .../tests/cache_list/files/write10.phar.inc | 18 ++++++++++++ ext/phar/tests/cache_list/files/write11.phar | Bin 0 -> 284 bytes .../tests/cache_list/files/write11.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write12.phar | Bin 0 -> 301 bytes .../tests/cache_list/files/write12.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write13.phar | Bin 0 -> 316 bytes .../tests/cache_list/files/write13.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write14.phar | Bin 0 -> 312 bytes .../tests/cache_list/files/write14.phar.inc | 18 ++++++++++++ ext/phar/tests/cache_list/files/write15.phar | Bin 0 -> 270 bytes .../tests/cache_list/files/write15.phar.inc | 16 +++++++++++ ext/phar/tests/cache_list/files/write16.phar | Bin 0 -> 327 bytes .../tests/cache_list/files/write16.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write17.phar | Bin 0 -> 258 bytes .../tests/cache_list/files/write17.phar.inc | 16 +++++++++++ ext/phar/tests/cache_list/files/write18.phar | Bin 0 -> 336 bytes .../tests/cache_list/files/write18.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write19.phar | Bin 0 -> 304 bytes .../tests/cache_list/files/write19.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write20.phar | Bin 0 -> 299 bytes .../tests/cache_list/files/write20.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write21.phar | Bin 0 -> 297 bytes .../tests/cache_list/files/write21.phar.inc | 16 +++++++++++ ext/phar/tests/cache_list/files/write22.phar | Bin 0 -> 293 bytes .../tests/cache_list/files/write22.phar.inc | 17 +++++++++++ ext/phar/tests/cache_list/files/write23.phar | Bin 0 -> 366 bytes .../tests/cache_list/files/write23.phar.inc | 16 +++++++++++ ext/phar/tests/cache_list/files/write24.phar | Bin 0 -> 326 bytes .../tests/cache_list/files/write24.phar.inc | 18 ++++++++++++ ext/phar/tests/cache_list/files/write3.phar | Bin 447 -> 447 bytes ext/phar/tests/cache_list/files/write4.phar | Bin 0 -> 388 bytes .../tests/cache_list/files/write4.phar.inc | 16 +++++++++++ ext/phar/tests/cache_list/files/write5.phar | Bin 0 -> 538 bytes .../tests/cache_list/files/write5.phar.inc | 27 ++++++++++++++++++ ext/phar/tests/cache_list/files/write6.phar | Bin 0 -> 572 bytes .../tests/cache_list/files/write6.phar.inc | 27 ++++++++++++++++++ ext/phar/tests/cache_list/files/write7.phar | Bin 0 -> 316 bytes .../tests/cache_list/files/write7.phar.inc | 18 ++++++++++++ ext/phar/tests/cache_list/files/write8.phar | Bin 0 -> 255 bytes .../tests/cache_list/files/write8.phar.inc | 18 ++++++++++++ ext/phar/tests/cache_list/files/write9.phar | Bin 0 -> 277 bytes .../tests/cache_list/files/write9.phar.inc | 18 ++++++++++++ 65 files changed, 764 insertions(+) create mode 100644 ext/phar/tests/cache_list/copyonwrite10.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite11.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite12.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite13.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite14.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite15.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite16.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite17.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite18.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite19.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite20.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite21.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite22.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite23.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite24.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite4.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite4a.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite5.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite6.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite7.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite8.phar.phpt create mode 100644 ext/phar/tests/cache_list/copyonwrite9.phar.phpt create mode 100644 ext/phar/tests/cache_list/files/write10.phar create mode 100644 ext/phar/tests/cache_list/files/write10.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write11.phar create mode 100644 ext/phar/tests/cache_list/files/write11.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write12.phar create mode 100644 ext/phar/tests/cache_list/files/write12.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write13.phar create mode 100644 ext/phar/tests/cache_list/files/write13.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write14.phar create mode 100644 ext/phar/tests/cache_list/files/write14.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write15.phar create mode 100644 ext/phar/tests/cache_list/files/write15.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write16.phar create mode 100644 ext/phar/tests/cache_list/files/write16.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write17.phar create mode 100644 ext/phar/tests/cache_list/files/write17.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write18.phar create mode 100644 ext/phar/tests/cache_list/files/write18.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write19.phar create mode 100644 ext/phar/tests/cache_list/files/write19.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write20.phar create mode 100644 ext/phar/tests/cache_list/files/write20.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write21.phar create mode 100644 ext/phar/tests/cache_list/files/write21.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write22.phar create mode 100644 ext/phar/tests/cache_list/files/write22.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write23.phar create mode 100644 ext/phar/tests/cache_list/files/write23.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write24.phar create mode 100644 ext/phar/tests/cache_list/files/write24.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write4.phar create mode 100644 ext/phar/tests/cache_list/files/write4.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write5.phar create mode 100644 ext/phar/tests/cache_list/files/write5.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write6.phar create mode 100644 ext/phar/tests/cache_list/files/write6.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write7.phar create mode 100644 ext/phar/tests/cache_list/files/write7.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write8.phar create mode 100644 ext/phar/tests/cache_list/files/write8.phar.inc create mode 100644 ext/phar/tests/cache_list/files/write9.phar create mode 100644 ext/phar/tests/cache_list/files/write9.phar.inc 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 0000000000..3d5b7fe784 --- /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-- + +--FILE_EXTERNAL-- +files/write10.phar +--EXPECTF-- +string(214) "getStub()); +$p2 = new Phar(__FILE__); +$a = fopen("phar://" . __FILE__ . "/test.txt", "r"); +$p->setStub($a); +echo $p2->getStub(),"\n"; +echo "ok\n"; +__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 0000000000..65388163dc --- /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-- + +--FILE_EXTERNAL-- +files/write11.phar +--EXPECTF-- +string(174) "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 0000000000..40b544191d --- /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-- + +--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 0000000000..fc47174d2b --- /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-- + + +--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 0000000000..11201ac989 --- /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-- + + +--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 0000000000..6e46289227 --- /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-- + +--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 0000000000..f17784c355 --- /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-- + +--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 0000000000..6e13088512 --- /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-- + +--FILE_EXTERNAL-- +files/write17.phar +--EXPECTF-- +NULL +string(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 0000000000..3e65f5a124 --- /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-- + +--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 0000000000..4870550c4d --- /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-- + +--FILE_EXTERNAL-- +files/write19.phar +--EXPECTF-- +string(2) "hi" +string(3) "hi2" +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 0000000000..acce57415c --- /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-- + +--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 0000000000..8960ea7171 --- /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-- + + +--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 0000000000..7cba216395 --- /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-- + + +--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 0000000000..292e5af668 --- /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-- + + +--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 0000000000..69197f2b4b --- /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-- + + +--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/copyonwrite4.phar.phpt b/ext/phar/tests/cache_list/copyonwrite4.phar.phpt new file mode 100644 index 0000000000..20ff78e282 --- /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-- + +--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 0000000000..1945e31f16 --- /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-- + +--FILE-- + +===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 0000000000..89990a7af1 --- /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-- + +--FILE_EXTERNAL-- +files/write5.phar +--CLEAN-- + +--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 0000000000..083a14178b --- /dev/null +++ b/ext/phar/tests/cache_list/copyonwrite6.phar.phpt @@ -0,0 +1,27 @@ +--TEST-- +Phar: copy-on-write test 6 [cache_list] +--INI-- +default_charset=UTF-8 +phar.cache_list={PWD}/copyonwrite6.phar.php +phar.readonly=0 +--SKIPIF-- + +--FILE_EXTERNAL-- +files/write6.phar +--CLEAN-- + +--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 \ No newline at end of file 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 0000000000..d6faded9cc --- /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-- + +--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 0000000000..7217d336e2 --- /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-- + +--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 0000000000..ffda9565bd --- /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-- + +--FILE_EXTERNAL-- +files/write9.phar +--EXPECTF-- +string(188) "getStub()); +$p2 = new Phar(__FILE__); +$p->setStub("getStub(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); ?> +" + + +ok \ No newline at end of file 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 0000000000000000000000000000000000000000..473f0a17ab82f3bd1e1e777d0567a4c8bfb04551 GIT binary patch literal 324 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRY(6viXEeS3u zP14W=N~jbV;n1Rz2$V?6FG$VPP$~c#XQi*Nq@bq&GZe^F(l1FZF3~HgC{fZ;P%2Ua z8>eem3^iUQ5h#$FoRO~pv;@gk9i^B&C8&&2em0mBAMfGl6B6(2?;8Mga*&3mwSv7J zFP9ku0|O%v3qoli1q2*G46|7R$ksmm$pb{MJkamD4Wt|hY(U`wbS%2D%{%sPVT%3u ZSzGef_VAZ1lNkSeOJ)M9cX#r20svSUS$F^d literal 0 HcmV?d00001 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 0000000000..a23b5e5ebc --- /dev/null +++ b/ext/phar/tests/cache_list/files/write10.phar.inc @@ -0,0 +1,18 @@ +setStub('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'] = " 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 0000000000000000000000000000000000000000..bb8d33f2acca343742b7745cb690bef81260f772 GIT binary patch literal 284 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRY(6viXEeS3u zP14W=N~jbV;m`t7S)5wplA4xSngi8f&6S#*k*`o(Qk0XL2Qw@3Z?vP zFeg6V!_g-s-r3(b0O*t;4NYqWdplk(GX@3*Mj#f1(m)CbIDoh$wYWsDq@qLu$ewZR zlLv@id7$5Q8%Q}2*ns@0fN5-3mVNK}!P$=3-0F@aAb literal 0 HcmV?d00001 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 0000000000..d2552642b4 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write11.phar.inc @@ -0,0 +1,17 @@ +setStub('getStub()); +$p2 = new Phar(__FILE__); +$p->setDefaultStub(); +echo strlen($p2->getStub()),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..bff145627350c04153ec54bb3de652eaa38136fb GIT binary patch literal 301 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRY(6viXEeXy{ z&r2*RElSnU1j?!u7~#+dQeKRt+%YFTzbLaLBUb}tgO!!9izz|VQ}1? literal 0 HcmV?d00001 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 0000000000..f0c01eb28a --- /dev/null +++ b/ext/phar/tests/cache_list/files/write12.phar.inc @@ -0,0 +1,17 @@ +setStub('getSignature()); +$p2 = new Phar(__FILE__); +$p->setSignatureAlgorithm(Phar::MD5); +var_dump($p->getSignature()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..46ca14df1a4cbbdb220bf4c4c54ed23f6cf1448d GIT binary patch literal 316 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRYh*l~|EiTb3 zsVGs3)wRnkcFxZ&C`v6ZPEFC!1gcaiFv4MmN`bCjGE}i!W=?9c2FMmGEB7dpEJ#hx z$X8Ix&yLAcvgV49_i*$HiFfw*4FEbdNJGHNI4MLfWkom)7W?I4dK~4jSl%=uy0NYxZ8Nyb@2-(pn7*FUnc+| CJzYxx literal 0 HcmV?d00001 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 0000000000..e8b6f33f37 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write13.phar.inc @@ -0,0 +1,17 @@ +setStub('isCompressed()); +$p2 = new Phar(__FILE__); +$p->compressFiles(Phar::GZ); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..448275256724d9356351f11532a00ff52429be11 GIT binary patch literal 312 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRYh*l~|EiTb3 zsVGs3)wRnkcFxZ&C`v6ZPEFC!1gcaiFv4MmN`bCjN@_Axxm#vVYOw}MMyDoc&`o9-^;p{B`_MP{`mqOl47q+l5setStub('isCompressed()); +$p2 = new Phar(__FILE__); +$p->decompressFiles(); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "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 0000000000000000000000000000000000000000..c6190b731559d36106aa3ec49973617975d3226e GIT binary patch literal 270 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEzrm;E>11cP$`I3 zO3p9HOifXW)dWhb6zJLk`IQ<setStub('copy("test.txt","copied"); +var_dump(isset($p["copied"])); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..05106ea9ef514663bca832c837d3cb5ab47947e4 GIT binary patch literal 327 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEzrm;E>11cP$`I3 zDoHIa(JQGaQHs?BDk#mvB2I+9)Z~nO1*QD#m^>wGuK0KlN1u>*XMf)Spv6HNn$`;T zcD!8C3=9lRKr9Hvj6e(l96$=@1_>a0;)zclAbRD2e%EbKWt>noMj(gcQe*@2x&o%% ixWpskwB&D2^Ix2~bsj^=;ox(OcN$_q&U1J2bpilReq0X# literal 0 HcmV?d00001 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 0000000000..b7a1b386af --- /dev/null +++ b/ext/phar/tests/cache_list/files/write16.phar.inc @@ -0,0 +1,17 @@ +setStub(''); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..52ddb5e0e1f3e478ca644ad8634f79d254d7a689 GIT binary patch literal 258 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRY(6viXE%8k) zNlZyBNz~8;N`l0Sk;IfTGL;DFNlnhkS5V5&j>%K9=8BK^aP$d@clP%U09qKNp=qsP zZ^z4J#=yY92*iR=8b|>F2N0K}7MJLiRFp^n+22om@&M5*5A?fk11Sdr8<1}lFpaHa eYfdV7&nF~*e4}6K2L=bdIWnsetStub('getMetadata()); +$p->setMetadata("hi"); +var_dump($p->getMetadata()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..3fc9fe14014b5d97a4ea7623fd9cfc2bb41ffdfd GIT binary patch literal 336 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~=1NV@$X7^7P0mj)(MZe8Ni9e% z$}QGVDgY|8($`l~&{KdZ1~QfOOHzwV^hzp9lr%MUlw$Iftbry+E5Su$b?uTfa`RI( z3`|T+s9`$Tc}n@&V5{QeJsf>P;+_3{1AxvC($KV4u(#voGGkz1U<6`8C=H~5fCGqO z?venqx19Xs0istP=y%-)QVs+*ps)dY5Z%}-$5ir9EkD2DUcgInhuf!L?s(04g9)hK I-O1Mp08Lq8Z2$lO literal 0 HcmV?d00001 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 0000000000..fca867d551 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write18.phar.inc @@ -0,0 +1,17 @@ +setStub('chmod(0444); +echo decoct(fileperms("phar://" . __FILE__ . "/test.txt")),"\n"; +echo "ok\n"; +__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 0000000000000000000000000000000000000000..9e8b7eec8bd059934e90e8099d42b090b78e5067 GIT binary patch literal 304 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRYh*l~|EiTb3 zsVGs3)wN4cE%8k)NlZyBNz~8;DnyqrMv_;`$TU(S#jw=mjC=*9{Op)KC2Owucn?RP zka%Z*-vFSif;2R(73}SJx$GGj7#M+A5K03nAm9LEm@_4SZ2nW9JV5ly1O2YsfXX?6 w>|!e;E1;8m3jhEB literal 0 HcmV?d00001 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 0000000000..55115ad713 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write19.phar.inc @@ -0,0 +1,17 @@ +setStub('getMetadata()); +$p["test.txt"]->setMetadata("hi2"); +var_dump($p["test.txt"]->getMetadata()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$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 0000000000000000000000000000000000000000..61092645b6a5373b77809d28337b7ae9e63c6347 GIT binary patch literal 299 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRYh*l~|EiTb3 zsVGs3)wN4cE%8k)NlZyBNz~8;Dnyr0NzFmXlVDD2az?&_Qhs(!o{}|Je7uLFPe{D8 zzi$B0K|vat)(ZA^yj=DS3=E7wEC{866cBI#G0cS$K(_a(PaYt8<$-?JZ9wImKz6Z} tk(E+LrjoS{$lD5-<{NM7(SEP$QyeaPG$WbIqw&LrQZ^=_Mt3J)Cjd;#RQ><} literal 0 HcmV?d00001 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 0000000000..d356bfbb44 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write20.phar.inc @@ -0,0 +1,17 @@ +setStub('getMetadata()); +$p["test.txt"]->delMetadata(); +var_dump($p["test.txt"]->getMetadata()); +echo "ok\n"; +__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 0000000000000000000000000000000000000000..fad2165daa7408c76148f6a37d0e493a46e10501 GIT binary patch literal 297 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRYh*l~|EiTb3 zsVGs3)wRnkcFxZ&C`v6ZPEFC!1gb<=kPMa902ygz`3g$;*)e%a)?D%N z9*#aC@y`Cf0YG;JX=qw2*xT`PnK3XhFaoh4lm=2jzyZWChe`n1)u%prfasM6`dzny qlmmec$kPg##+F*0+t3%vdiHrulyAqG<+67!v}|Dls&{wtbpimd3|J5V literal 0 HcmV?d00001 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 0000000000..79bfb20067 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write21.phar.inc @@ -0,0 +1,16 @@ +setStub('isCompressed()); +$p["test.txt"]->compress(Phar::GZ); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..c3c5ce1e299a3cd5e543a4a40f1754dd021c7eb8 GIT binary patch literal 293 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRYh*l~|EiTb3 zsVGs3)wRnkcFxZ&C`v6ZPEFC!1gb<=kdm4VRiHtVIjPAR`3g$;*)e%a)?D%N9*#aC z@y`Cf0YDc80Zme{x8vn9V_;xl1Y$u31_2Na0USUI=0ph~`^BkG9#TMh<$-?JZ9t_U zuz92Y35|e`{_h1}I6KR~edqn~rI7d1g)M9h0&AYc)ZJT{(6)As;cJ7aU4PH)iedul JaCh=`0sv-JUP}M~ literal 0 HcmV?d00001 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 0000000000..861cabbc6c --- /dev/null +++ b/ext/phar/tests/cache_list/files/write22.phar.inc @@ -0,0 +1,17 @@ +setStub('isCompressed()); +$p["test.txt"]->decompress(); +var_dump($p["test.txt"]->isCompressed()); +echo "ok\n"; +__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 0000000000000000000000000000000000000000..2246f61c0c4ff6728ef3b8e4c90da5a68587b51b GIT binary patch literal 366 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEzrm;E>11cP$`I3 zDoHIa(JQGaQHs^nQ9uX-b>}7KrUFHQ+KN&^Yz?IXpmA3E`br9V3NS-~OeKA|89E9$ z)xZoS-xaCJ8TkrI`PngfO4eNQ@g9yoA@R=sz5zhb1!-tnE7;rda+xtOFfanKAe07D zK)?aSFgHp7*}kVgd4TAZ2l`#Nfs_M*4JhP*-asetStub(''); +$phar['test.txt'] = " 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 0000000000000000000000000000000000000000..d726ceef76978279915bc8a8a8d95be0dc885c3a GIT binary patch literal 326 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEzrm;E>11cP$`I3 z0xHW(%uQ8_)db3`q=9s%EMgmGogcbQF}zm4KSk%8N2f zQZ;~jfg%~1V4>uk{9>>W5tgPVXXGm=0Vr0RaaPm!uY#=#^BINC4RjVHfURn_V literal 0 HcmV?d00001 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 0000000000..ac96731960 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write24.phar.inc @@ -0,0 +1,18 @@ +setStub(''); +$phar['test.txt'] = " diff --git a/ext/phar/tests/cache_list/files/write3.phar b/ext/phar/tests/cache_list/files/write3.phar index c5be7daceb9b4c018e3dccf8117b6bfee2009e06..5ce4a95f79b7011a6766c6ce4a07d26e1093d27a 100644 GIT binary patch delta 66 zcmdnbyq|eP5+l>^{gYD|HH?4n|Kz~{1^*c#jEqdK^wv)z@>z-1OW(`phVAb4P#@=PaX_V@ShRF$jIb+TW&dvefp+dD$Cwof75v)H`85= Mp9v`I?&RwP0AdakLjV8( 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 0000000000000000000000000000000000000000..c267babb42398893e15bca63945f0136eb4d6dd2 GIT binary patch literal 388 zcmcDqFUTn1DoZSiPbtkU&`8V7NsUjf$Sf`?)=(P0_rE%F**uh*QckJ#3$$Hm89ko?T6IljC=*9{Op)KC2Owucn?RPka%Z*-vFSO zgMdC#u(#vovSeUjU<6`8C=H~5fE$QQ5YA@;a#wVH@&M6mv?kx!2GRip8JU|73CgXM a==&Y9`RcI%x7&IT{|gy|RJl9(IspJbxN`mg literal 0 HcmV?d00001 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 0000000000..5b476ed0a3 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write4.phar.inc @@ -0,0 +1,16 @@ +setStub(''); +$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 0000000000000000000000000000000000000000..b3a318b5a2e99d3c40b83b76130d1c4e5e5c100e GIT binary patch literal 538 zcmah`O-lnY5UqM@K#C`?VTrIs>&Jo@Yq!{Ht_~Mt5m>R3eb zCr{U@wc)8`q~f6tQ@L%GNz?_H&3tIO344+!gOqzJPGy|-A#GZ)uw|`L%UmvF>p!sb z4R$i{ozUDLM2T%Qm)z??*z+4&Mf;(aUaIs66`*ePes zeag@k|TD1tFQNET6XXA8+hsdi+>eoqVdD0yZ7i+O;nQxt&q~ literal 0 HcmV?d00001 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 0000000000..04a4dfe18d --- /dev/null +++ b/ext/phar/tests/cache_list/files/write5.phar.inc @@ -0,0 +1,27 @@ +setStub('buildFromDirectory($d)); +$phar2 = new Phar(__FILE__); +$arr = array(); +foreach ($phar2 as $name => $file) { + $arr[$name] = $file->getContent(); +} +asort($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 0000000000000000000000000000000000000000..68a4a8674dd0d42b44cab553a35506613609c57a GIT binary patch literal 572 zcmah`%}T>S5UzT1K|%2D5^_kP^(O}}wJEl>w$f@TUPNWtCaYQ6WW#3Dl8X2ozJ>=u zM0_GIK7q4IReBH?W@nlC=I8tNpceTNG9#Z#T*V=q;yyerLRy{f5h2A2GCfFmT!u7Y zzj3^cjU87+sR*Z%E4FV`P%r|RWqMF_!^ez7i6X8D6$@1i;jBa__KXrXvd2|u{0Fwb z!FCRwP)WQbh^%bqvNKHh*lS4hh!o2HgtQbsetStub('buildFromIterator(new RecursiveDirectoryIterator($d),$d)); +$phar2 = new Phar(__FILE__); +$arr = array(); +foreach ($phar2 as $name => $file) { + $arr[$name] = $file->getContent(); +} +asort($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 0000000000000000000000000000000000000000..e5854ec0579286cefc6fc01c5f6d8f2b1ed5333c GIT binary patch literal 316 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEzn5I%t?(;t;j4c zDb`Rb0IIUm*H==|Q-G-jGL`g8Qj1IUN-9c}G=W-G3UuvKQgc#EQZVB3K8FfaI6dNL N-^2uza(D7|0ss|(TNVHS literal 0 HcmV?d00001 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 0000000000..ef5b8b2dd0 --- /dev/null +++ b/ext/phar/tests/cache_list/files/write7.phar.inc @@ -0,0 +1,18 @@ +setStub('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 0000000000000000000000000000000000000000..d5d63be13221b63f7692a84f768099971b954550 GIT binary patch literal 255 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRY(6viXEpg1r zOf1&W1j?us7~#+ZQd$gCs+5tb1XP`xoRO~p)Pih?j#5mX5>!elKO4-6kN0r&35j?1 z_YD9#AxJ~hTEX6qm&=TSfq@Z-1)(&M0s;;oE=ese(JQGaVFs}eeDVO%RaNsetStub('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 0000000000000000000000000000000000000000..c012c177ce836b515e3778681941255278b78dc8 GIT binary patch literal 277 zcmcDqFUTn1QYlcdRme*%R|v>REYgUNck}ddjgQx~<|<1piccxcEznRY(6viXEeS3u zP14W=N~jbV;m`t7SqxRFWCJo@AwJ&2(I-SnPbuEn-!}kgc94dqwGz;j)Z~nO1)xz# zX6q=$setStub('getStub()); +$p2 = new Phar(__FILE__); +$p->setStub("getStub(),"\n"; +echo "ok\n"; +__HALT_COMPILER(); +?>'); +$phar['test.txt'] = "hi +"; +?> -- 2.40.0