]> granicus.if.org Git - php/commitdiff
- Utilize new UNIX_PATHS flag in SPL
authorSteph Fox <sfox@php.net>
Thu, 24 Jul 2008 09:22:35 +0000 (09:22 +0000)
committerSteph Fox <sfox@php.net>
Thu, 24 Jul 2008 09:22:35 +0000 (09:22 +0000)
- Fix tests

@Jani: hold back on the bunny-killing, HEAD will be in sync later today

ext/phar/phar_object.c
ext/phar/tests/cached_manifest_1.phpt
ext/phar/tests/mounteddir.phpt
ext/phar/tests/phar_dir_iterate.phpt
ext/phar/tests/phar_extract.phpt
ext/phar/tests/phar_extract2.phpt
ext/phar/tests/phar_extract3.phpt
ext/phar/tests/phar_oo_002.phpt
ext/phar/tests/zip/odt.phpt
ext/phar/tests/zip/unixzip.phpt

index 1388c8fd115c24d73a48096e3b27591a8757017e..2fc16df876b9846a95e1846a559003474427c4e0 100755 (executable)
@@ -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);
index f656e98dd8f9926ec6646cda480d50545db76014..2a1949744db5cb0306e068e2b939539b6a8b1dc4 100644 (file)
@@ -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)
index 51a42695d71c4ca51ede4e9b5798948fc72b5ac6..bae1839fd100faea44a73d775582b54d535d84db 100644 (file)
@@ -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
index 2ee2cb5529f58f916a028d7f3aec0c0feb939f8d..bb7eb500423f353d4411d89940a5548cbb30437a 100644 (file)
@@ -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===
index 851beb8f512aea3efa92cbf8a8c821c027d69c9d..321dd3c4f0018a9deeb813ca58577e00919e2e20 100644 (file)
@@ -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"
index 180d6ff4a5e42f5abb2a5505e9cf1d4c3b173083..c4130fb1b59b795002c1886340e9a4b993d086df 100644 (file)
@@ -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===
index df85211a239201c0675b802f5d5235d26bfcedb1..52936a88476ef6e40e7f390872f32d282af77ff9 100644 (file)
@@ -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===
index 71ec0d7012b6b4fb2044da087638ce1adc0748a1..53787555404ac64d56df16113750c007484150d1 100755 (executable)
@@ -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)
index 317c581a56f38e44e20af34b725f42c5f0d05cb5..4271fc6741f32074a17bc279029cd547224e7fd5 100644 (file)
@@ -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===
index 1d3ef6b044f5920f5cc1d5d7a87245613249f292..c653d2b46e32cbc3e7ebd63b6a99d608fdc6566d 100644 (file)
@@ -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===