From 51967b91d50905de072646e0fc90e16c061e5086 Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Sat, 24 May 2008 13:13:47 +0000 Subject: [PATCH] "We shouldn't need a full path to the mount" - Fixed under Windows, cleaned up test --- ext/phar/phar_object.c | 4 ++++ ext/phar/tests/config.xml | 0 ext/phar/tests/files/blog.phar | Bin 513 -> 468 bytes ext/phar/tests/files/blog.phar.inc | 20 ++++++++++++++++++++ ext/phar/tests/files/config.xml | 9 +++++++++ ext/phar/tests/front.phar.phpt | 11 ++++++++++- 6 files changed, 43 insertions(+), 1 deletion(-) delete mode 100644 ext/phar/tests/config.xml create mode 100644 ext/phar/tests/files/blog.phar.inc create mode 100644 ext/phar/tests/files/config.xml diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index f7f4f80728..8f0a3f90e9 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -456,6 +456,10 @@ PHP_METHOD(Phar, mount) fname = zend_get_executed_filename(TSRMLS_C); fname_len = strlen(fname); +#ifdef PHP_WIN32 + phar_unixify_path_separators(fname, fname_len); +#endif + if (fname_len > 7 && !memcmp(fname, "phar://", 7) && SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len, 2, 0 TSRMLS_CC)) { efree(entry); entry = NULL; diff --git a/ext/phar/tests/config.xml b/ext/phar/tests/config.xml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/ext/phar/tests/files/blog.phar b/ext/phar/tests/files/blog.phar index 16f8f7d5900e0218c2bfd8e16e2a078570641a64..58c8a3bca7b8bcbce975a0ac0b94622fbdd62d45 100644 GIT binary patch literal 468 zcmcDqFUTlR$V}5n%gjlQPp!x-E-BVX$t=oC%uUsZk9YI*agC4HRM1mU(g&$1)=$pQ zOUq2xtH{k!($rL_=28HHfQ-ZT?XW^{W13d(M2a!yS72qaf1~Vmn7!ofGm-MDg)7?Mr-%Ml-WSTNkKyqIi!$% z3l0v>%)I2B(v(z?yWxf^S#xm$gSG_Z%d*6x_>|Jz0!VN*PQnRzLx6?#C& zsB2nt#m9R%`h>(g`}+oX`nU#ZXj&`S+wpS6F)%PN0kI$uGXgOLZ~`f~?v+5!vMmN4 zAlmV6h|V^sI&QF{;*!Li9FQftP-P(6^>ke)OqmThI5N`|G!&7817~O`RC94=<|XHp zrlg{HIx`P$mAW+-Cooh?Kz`TP;!;3DTKZgNiAC`#rMU%=&`(b-i3bK`NopQ24&at5 zA;o}_CNOyH?YJNg#WasAH8~?+K?!QV5?C$QM~}7oXT`P6d#kod-aQj+{C>v17oc!- Ick*=t05$QBO#lD@ diff --git a/ext/phar/tests/files/blog.phar.inc b/ext/phar/tests/files/blog.phar.inc new file mode 100644 index 0000000000..62d86c5c3f --- /dev/null +++ b/ext/phar/tests/files/blog.phar.inc @@ -0,0 +1,20 @@ +setStub(''); +$phar['index.php'] = ''; +$phar['install.php'] = ''; + +?> diff --git a/ext/phar/tests/files/config.xml b/ext/phar/tests/files/config.xml new file mode 100644 index 0000000000..cf0dbc5cda --- /dev/null +++ b/ext/phar/tests/files/config.xml @@ -0,0 +1,9 @@ + + + + localhost + squirrel + nuts + hoard + + diff --git a/ext/phar/tests/front.phar.phpt b/ext/phar/tests/front.phar.phpt index 83c6a42284..da444e8b17 100644 --- a/ext/phar/tests/front.phar.phpt +++ b/ext/phar/tests/front.phar.phpt @@ -13,4 +13,13 @@ Content-type: text/html --FILE_EXTERNAL-- files/blog.phar --EXPECT-- -string(0) "" \ No newline at end of file +string(167) " + + + localhost + squirrel + nuts + hoard + + +" -- 2.40.0