1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

- Utilize new UNIX_PATHS flag in SPL

- Fix tests

@Jani: hold back on the bunny-killing, HEAD will be in sync later today
This commit is contained in:
Steph Fox
2008-07-24 09:22:35 +00:00
parent aa31988e43
commit 6895773aff
10 changed files with 48 additions and 48 deletions

View File

@@ -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);

View 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)

View 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

View 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===

View 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"

View 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===

View 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===

View File

@@ -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)

View 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===

View 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===