From 6895773affe2fc5f3ef0b45350c2d8a957fdf2fa Mon Sep 17 00:00:00 2001 From: Steph Fox Date: Thu, 24 Jul 2008 09:22:35 +0000 Subject: [PATCH] - Utilize new UNIX_PATHS flag in SPL - Fix tests @Jani: hold back on the bunny-killing, HEAD will be in sync later today --- ext/phar/phar_object.c | 4 ++-- ext/phar/tests/cached_manifest_1.phpt | 8 ++++---- ext/phar/tests/mounteddir.phpt | 6 +++--- ext/phar/tests/phar_dir_iterate.phpt | 6 +++--- ext/phar/tests/phar_extract.phpt | 14 +++++++------- ext/phar/tests/phar_extract2.phpt | 14 +++++++------- ext/phar/tests/phar_extract3.phpt | 4 ++-- ext/phar/tests/phar_oo_002.phpt | 18 +++++++++--------- ext/phar/tests/zip/odt.phpt | 16 ++++++++-------- ext/phar/tests/zip/unixzip.phpt | 6 +++--- 10 files changed, 48 insertions(+), 48 deletions(-) diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 1388c8fd11..2fc16df876 100755 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -1057,7 +1057,7 @@ PHP_METHOD(Phar, __construct) #else char *fname, *alias = NULL, *error, *arch = NULL, *entry = NULL, *save_fname; int fname_len, alias_len = 0, arch_len, entry_len, is_data; - long flags = SPL_FILE_DIR_SKIPDOTS, format = 0; + long flags = SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS, format = 0; phar_archive_object *phar_obj; phar_archive_data *phar_data; zval *zobj = getThis(), arg1, arg2; @@ -1601,7 +1601,7 @@ PHP_METHOD(Phar, buildFromDirectory) INIT_PZVAL(&arg); ZVAL_STRINGL(&arg, dir, dir_len, 0); INIT_PZVAL(&arg2); - ZVAL_LONG(&arg2, SPL_FILE_DIR_SKIPDOTS); + ZVAL_LONG(&arg2, SPL_FILE_DIR_SKIPDOTS|SPL_FILE_DIR_UNIXPATHS); zend_call_method_with_2_params(&iter, spl_ce_RecursiveDirectoryIterator, &spl_ce_RecursiveDirectoryIterator->constructor, "__construct", NULL, &arg, &arg2); diff --git a/ext/phar/tests/cached_manifest_1.phpt b/ext/phar/tests/cached_manifest_1.phpt index f656e98dd8..2a1949744d 100644 --- a/ext/phar/tests/cached_manifest_1.phpt +++ b/ext/phar/tests/cached_manifest_1.phpt @@ -26,10 +26,10 @@ string(1) "b" string(1) "d" string(9) "index.php" string(7) "web.php" -string(%d) "phar://%snophar.phar%cb%cc.php" -string(%d) "phar://%snophar.phar%cd" -string(%d) "phar://%snophar.phar%cindex.php" -string(%d) "phar://%snophar.phar%cweb.php" +string(%d) "phar://%snophar.phar/b/c.php" +string(%d) "phar://%snophar.phar/d" +string(%d) "phar://%snophar.phar/index.php" +string(%d) "phar://%snophar.phar/web.php" bool(true) bool(false) bool(false) diff --git a/ext/phar/tests/mounteddir.phpt b/ext/phar/tests/mounteddir.phpt index 51a42695d7..bae1839fd1 100644 --- a/ext/phar/tests/mounteddir.phpt +++ b/ext/phar/tests/mounteddir.phpt @@ -105,9 +105,9 @@ Mounting of .phar/stub.php to %sextfile.php within phar %stests/tempmanifest1.ph directory extfile.php extfile2.php -phar://%stempmanifest1.phar.php/testit%cdirectory -phar://%stempmanifest1.phar.php/testit%cextfile.php -phar://%stempmanifest1.phar.php/testit%cextfile2.php +phar://%stempmanifest1.phar.php/testit/directory +phar://%stempmanifest1.phar.php/testit/extfile.php +phar://%stempmanifest1.phar.php/testit/extfile2.php Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php failed Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed diff --git a/ext/phar/tests/phar_dir_iterate.phpt b/ext/phar/tests/phar_dir_iterate.phpt index 2ee2cb5529..bb7eb50042 100644 --- a/ext/phar/tests/phar_dir_iterate.phpt +++ b/ext/phar/tests/phar_dir_iterate.phpt @@ -26,7 +26,7 @@ unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php') __halt_compiler(); ?> --EXPECTF-- -string(%d) "phar://%sphar_dir_iterate.phar.php%canother.file.txt" -string(%d) "phar://%sphar_dir_iterate.phar.php%csub%ctop.txt" -string(%d) "phar://%sphar_dir_iterate.phar.php%ctop.txt" +string(%d) "phar://%sphar_dir_iterate.phar.php/another.file.txt" +string(%d) "phar://%sphar_dir_iterate.phar.php/sub/top.txt" +string(%d) "phar://%sphar_dir_iterate.phar.php/top.txt" ===DONE=== diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index 851beb8f51..321dd3c4f0 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -19,7 +19,7 @@ $a->addEmptyDir('one/level'); $a->extractTo(dirname(__FILE__) . '/extract', 'mount'); $a->extractTo(dirname(__FILE__) . '/extract'); $out = array(); -foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract', 0x00001000), RecursiveIteratorIterator::CHILD_FIRST) as $p => $b) { +foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract', 0x00003000), RecursiveIteratorIterator::CHILD_FIRST) as $p => $b) { $out[] = $p; } sort($out); @@ -107,12 +107,12 @@ $e = dirname(__FILE__) . '/extract2/'; @rmdir($e); ?> --EXPECTF-- -%sextract%cfile1.txt -%sextract%cfile2.txt -%sextract%cone -%sextract%csubdir -%sextract%csubdir%cectory -%sextract%csubdir%cectory%cfile.txt +%sextract/file1.txt +%sextract/file2.txt +%sextract/one +%sextract/subdir +%sextract/subdir/ectory +%sextract/subdir/ectory/file.txt string(2) "hi" string(3) "hi3" string(3) "hi2" diff --git a/ext/phar/tests/phar_extract2.phpt b/ext/phar/tests/phar_extract2.phpt index 180d6ff4a5..c4130fb1b5 100644 --- a/ext/phar/tests/phar_extract2.phpt +++ b/ext/phar/tests/phar_extract2.phpt @@ -23,7 +23,7 @@ $phar->extractTo(dirname(__FILE__) . '/extract', 'mount'); $phar->extractTo(dirname(__FILE__) . '/extract'); $out = array(); -foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract', 0x00001000), RecursiveIteratorIterator::CHILD_FIRST) as $path => $file) { +foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(dirname(__FILE__) . '/extract', 0x00003000), RecursiveIteratorIterator::CHILD_FIRST) as $path => $file) { $extracted[] = $path; } @@ -51,10 +51,10 @@ $dir = dirname(__FILE__) . '/extract1/'; @rmdir($dir); ?> --EXPECTF-- -%sextract%cfile1.txt -%sextract%cfile2.txt -%sextract%cone -%sextract%csubdir -%sextract%csubdir%cectory -%sextract%csubdir%cectory%cfile.txt +%sextract/file1.txt +%sextract/file2.txt +%sextract/one +%sextract/subdir +%sextract/subdir/ectory +%sextract/subdir/ectory/file.txt ===DONE=== diff --git a/ext/phar/tests/phar_extract3.phpt b/ext/phar/tests/phar_extract3.phpt index df85211a23..52936a8847 100644 --- a/ext/phar/tests/phar_extract3.phpt +++ b/ext/phar/tests/phar_extract3.phpt @@ -41,6 +41,6 @@ $dir = dirname(__FILE__) . '/test/'; ?> --EXPECTF-- Invalid argument, %sfiles/bogus.zip cannot be found -phar://%sfiles/notbogus.zip%cnonsense.txt -phar://%sfiles/notbogus.zip%cstuff.txt +phar://%sfiles/notbogus.zip/nonsense.txt +phar://%sfiles/notbogus.zip/stuff.txt ===DONE=== diff --git a/ext/phar/tests/phar_oo_002.phpt b/ext/phar/tests/phar_oo_002.phpt index 71ec0d7012..5378755540 100755 --- a/ext/phar/tests/phar_oo_002.phpt +++ b/ext/phar/tests/phar_oo_002.phpt @@ -51,7 +51,7 @@ unlink(dirname(__FILE__) . '/files/phar_oo_test.phar.php'); __halt_compiler(); ?> --EXPECTF-- -string(42) "phar://*/files/phar_oo_test.phar.php%ca.php" +string(42) "phar://*/files/phar_oo_test.phar.php/a.php" string(5) "a.php" int(32) string(4) "file" @@ -64,7 +64,7 @@ bool(false) int(%d) int(%d) int(%d) -string(38) "phar://*/files/phar_oo_test.phar.php%cb" +string(38) "phar://*/files/phar_oo_test.phar.php/b" string(1) "b" int(0) string(3) "dir" @@ -77,7 +77,7 @@ bool(false) int(%d) int(%d) int(%d) -string(42) "phar://*/files/phar_oo_test.phar.php%cb.php" +string(42) "phar://*/files/phar_oo_test.phar.php/b.php" string(5) "b.php" int(32) string(4) "file" @@ -90,7 +90,7 @@ bool(false) int(%d) int(%d) int(%d) -string(42) "phar://*/files/phar_oo_test.phar.php%ce.php" +string(42) "phar://*/files/phar_oo_test.phar.php/e.php" string(5) "e.php" int(32) string(4) "file" @@ -104,31 +104,31 @@ int(%d) int(%d) int(%d) ==RECURSIVE== -string(42) "phar://*/files/phar_oo_test.phar.php%ca.php" +string(42) "phar://*/files/phar_oo_test.phar.php/a.php" string(5) "a.php" int(32) bool(false) NULL int(0) -string(44) "phar://*/files/phar_oo_test.phar.php%cb%cc.php" +string(44) "phar://*/files/phar_oo_test.phar.php/b/c.php" string(5) "c.php" int(34) bool(false) NULL int(0) -string(44) "phar://*/files/phar_oo_test.phar.php%cb%cd.php" +string(44) "phar://*/files/phar_oo_test.phar.php/b/d.php" string(5) "d.php" int(34) bool(false) NULL int(0) -string(42) "phar://*/files/phar_oo_test.phar.php%cb.php" +string(42) "phar://*/files/phar_oo_test.phar.php/b.php" string(5) "b.php" int(32) bool(false) NULL int(0) -string(42) "phar://*/files/phar_oo_test.phar.php%ce.php" +string(42) "phar://*/files/phar_oo_test.phar.php/e.php" string(5) "e.php" int(32) bool(false) diff --git a/ext/phar/tests/zip/odt.phpt b/ext/phar/tests/zip/odt.phpt index 317c581a56..4271fc6741 100644 --- a/ext/phar/tests/zip/odt.phpt +++ b/ext/phar/tests/zip/odt.phpt @@ -23,13 +23,13 @@ try { ?> ===DONE=== --EXPECTF-- -phar://%sodt.odt%cConfigurations2%caccelerator%ccurrent.xml -phar://%sodt.odt%cMETA-INF%cmanifest.xml -phar://%sodt.odt%cThumbnails%cthumbnail.png -phar://%sodt.odt%ccontent.xml -phar://%sodt.odt%cmeta.xml -phar://%sodt.odt%cmimetype -phar://%sodt.odt%csettings.xml -phar://%sodt.odt%cstyles.xml +phar://%sodt.odt/Configurations2/accelerator/current.xml +phar://%sodt.odt/META-INF/manifest.xml +phar://%sodt.odt/Thumbnails/thumbnail.png +phar://%sodt.odt/content.xml +phar://%sodt.odt/meta.xml +phar://%sodt.odt/mimetype +phar://%sodt.odt/settings.xml +phar://%sodt.odt/styles.xml Cannot create phar '%sodt.odt', file extension (or combination) not recognised ===DONE=== diff --git a/ext/phar/tests/zip/unixzip.phpt b/ext/phar/tests/zip/unixzip.phpt index 1d3ef6b044..c653d2b46e 100644 --- a/ext/phar/tests/zip/unixzip.phpt +++ b/ext/phar/tests/zip/unixzip.phpt @@ -20,10 +20,10 @@ if (isset($a['notempty/hi.txt'])) { ?> ===DONE=== --EXPECTF-- -dir phar://%s/zip.zip%cempty -phar://%s/zip.zip%chi.txt +dir phar://%s/zip.zip/empty +phar://%s/zip.zip/hi.txt hi there -dir phar://%s/zip.zip%cnotempty +dir phar://%s/zip.zip/notempty phar://%s/zip.zip/notempty/hi.txt ===DONE=== -- 2.40.0