Commit Graph

703 Commits

Author SHA1 Message Date
Greg Beaver
d388ec586f move creation of phar archive to the point at which it is committed to disk, instead of
at the moment it is attempted access. (making some real progress now, all tests pass on unix)
2008-02-11 06:53:56 +00:00
Greg Beaver
de5238a3bc minor refactoring to remove 1 call to zend_get_executed_filename() 2008-02-11 06:49:22 +00:00
Greg Beaver
1a6fb65c83 new test for special tar-based app and more iteration test 2008-02-11 06:47:26 +00:00
Greg Beaver
78e8eb3900 major refactoring of internal handling of aliases.
1) rename is_explicit_alias to is_temporary_alias for clarity and flip the value
2) fix setAlias so that it sets a permanent to-be-saved alias, and restores the old one on error
3) fix Phar constructor to work with sub-directories in RecursiveDirectoryIterator
2008-02-11 06:46:44 +00:00
Greg Beaver
3874e12ee5 fix 5.2 build 2008-02-11 04:48:58 +00:00
Greg Beaver
3ade59e537 update test phars 2008-02-11 01:07:53 +00:00
Antony Dovgal
6d9453aa91 add ifdefs and fix folding 2008-02-08 09:25:02 +00:00
Antony Dovgal
271e0394d7 fix 5_3 build 2008-02-08 09:21:24 +00:00
Greg Beaver
19df8a4d7f fix issues in opendir() with empty directories within a phar archive, port filterparams fix to tar.c 2008-02-08 05:57:40 +00:00
Greg Beaver
15410a4f66 make maximum manifest size 100MB for phar archives, simple apps are hitting the 1 MB limit quite easily. 2008-02-08 05:56:26 +00:00
Greg Beaver
5b5c86df9f better fix for double free - ensure that SEPARATE_ZVAL() inside
zlib_filter.c actually separates the zval, then we can zval_dtor() it
properly
2008-02-08 05:41:59 +00:00
Greg Beaver
4e42110f3e remove test accidentally added 2008-02-08 05:08:18 +00:00
Greg Beaver
fa7a1779a1 remove unnecessary INIT_ZVAL(filterparams) that causes unfreed value 2008-02-08 05:05:13 +00:00
Greg Beaver
e3c64bd53b fix memory leaks. There are some leaks in libz that I can't fix, but none triggered in the current tests 2008-02-08 04:26:41 +00:00
Greg Beaver
c31f04b5f3 SEPARATE_ZVAL does not work for this situation. We always want
to duplicate and copy, so do it manually and reset refcount to 1
2008-02-08 03:53:17 +00:00
Greg Beaver
a3c910739f fix flipped logic 2008-02-08 01:08:02 +00:00
Greg Beaver
67a9fd8783 fix mem leaks
strip trailing slash if present in a directory entry.  This code assumes that
tar_type is directory, as it must be to be a valid directory.
2008-02-08 01:06:12 +00:00
Greg Beaver
43f2638634 better fix for invalid mem access 2008-02-08 00:58:39 +00:00
Greg Beaver
7575b012f2 fix invalid read/write if strstr() returns NULL 2008-02-08 00:55:38 +00:00
Greg Beaver
e67c584348 [DOC]
refactor the $rewrites parameter in Phar::webPhar.  Now it is a callback
that accepts the path requested.  This callback should return the actual filename
requested as a string, or false to deny access as HTTP 403.
Also fix incorrect munging of SCRIPT_NAME variable in mungServer
More importantly, Phar::webPhar now finds the filename hidden in:
http://localhost/myphar.phar/internal/file.php/extra/stuff
as 'internal/file.php' in phar 'myphar.phar' with REQUEST_URI '/internal/file.php/extra/stuff'
this will allow pharring up apps that use REQUEST_URI for front controller stuff.
2008-02-07 23:42:03 +00:00
Antony Dovgal
a04bcdfcec remove old code leftover causing problems 2008-02-07 08:45:43 +00:00
Greg Beaver
1cac0aa8e2 fix webPhar() in CGI sapi, update tests to reflect reality of how these ENV vars are passed 2008-02-07 04:24:58 +00:00
Greg Beaver
2b9a4279dd fix logic of path redirection. always prepend index_php with "/" if it doesn't have it,
and then if path_info ends with "/" just use entry + 1
2008-02-02 05:20:37 +00:00
Greg Beaver
9af8b12b2b move to in between BEGIN_EXTERN_C() block, to avoid breakage with C++ (i.e. windows)
# david, can you check on mac to be sure this doesn't break?
2008-02-01 22:23:37 +00:00
David Coallier
d4d8f3d412 - OSX "extern" compatibility fix. 2008-02-01 22:13:14 +00:00
Greg Beaver
47320359e9 remove unused variable, eliminate an invalid read reported by valgrind 2008-02-01 19:50:06 +00:00
Steph Fox
b5e8315e80 ws 2008-02-01 14:40:57 +00:00
Steph Fox
3e6d9e72d4 Generate newline at end of stub.h 2008-02-01 14:38:45 +00:00
Antony Dovgal
e493059f55 check for empty/null path
still some leaks are left
2008-02-01 11:36:45 +00:00
Antony Dovgal
addf32d7d9 we don't want to modify the pointer contents, we just want to change the pointer itself 2008-02-01 11:25:59 +00:00
Antony Dovgal
97c3dbaf56 this string should be freed later since path == free_path 2008-02-01 11:25:11 +00:00
Antony Dovgal
f6238ee664 fix compile warning (No newline at end of file) 2008-02-01 11:09:34 +00:00
Marcus Boerger
7d3758fa08 - SPL has been changed 2008-01-30 23:50:23 +00:00
Marcus Boerger
33dc86c435 - Fixed glob:// stream handling in (Recursive)DirectoryIterator. 2008-01-30 20:31:09 +00:00
Steph Fox
ed2785e2a5 OK so let's kill the bug-hider 2008-01-30 00:53:56 +00:00
Steph Fox
76640a615f - One last tweak (so Phar and no-phar work the same again now)
- Bunch of test fixes
- Note: I added a silencer to the unlink() call in zip/tarmaker to avoid system warnings here. If this messes up tests elsewhere we'll need to re-think.
2008-01-29 11:58:27 +00:00
Steph Fox
182519877b Job done. 2008-01-29 09:45:11 +00:00
Steph Fox
7e85b150a6 Rock'n'roll... just php includes to figure out now. 2008-01-29 07:10:22 +00:00
Steph Fox
a6abbfd55d 'It works on my box'.
Please test.
2008-01-28 21:23:02 +00:00
Greg Beaver
f4e4ad0cd1 fix PharFileInfo->setAlias (was wildly broken)
fix directory creation in zip archives
update zip tests to use phar to create the zip, and then copy to a new file
2008-01-28 20:18:15 +00:00
Steph Fox
618a29411d Get rid of zip requirement in the last few tests
@Greg: zip/tarmaker.inc needs a rewrite
2008-01-28 16:49:28 +00:00
Steph Fox
975a1b87af Get rid of zip requirement 2008-01-28 16:31:56 +00:00
Steph Fox
9fd5c0b438 - Moved phar_unixify_path_separators() to a single central point
- The last two VC 6 compiler warnings gone. Please test under *nix.
2008-01-28 14:39:17 +00:00
Greg Beaver
6cdabede4c remove ext/zip dependency entirely, write better native zip support
re-organize, create util.c, move entry_info/archive_data/entry_data access methods to this file
refactor entry->fp, now this is abstracted with phar_get_efp() and phar_seek_efp(), fixes all weird dependency issues
permanently solve the "millions of file pointers" issue for read access.  All compressed files are read into a single
temporary stream, and their constraints are controlled by the entry->fp abstraction

Improvements in this zip implementation over ext/zip:
 * full read/write support for bzip2 compressed files
 * much more efficient access for accessing only a few files within large zip files, as crc/header validation is
   done just-in-time
 * full stream support for opendir/rename/rmdir/mkdir as well as all of the other stream funcs
 * full support for setting file perms via Phar::chmod(), stored as zip-standard extra field
 * no problem with large zips and many open file pointers

# TODO: add big-endian system support for tar/zip file format headers, otherwise the implementation is complete
# TODO: test on windows and fix any windows-specific issues
# TODO: verify zips created work with unzip/winzip/windows explorer and so on
2008-01-28 08:52:08 +00:00
Steph Fox
6f95353e77 - Added is_writable() check on temp directory
- Regenerated stub and tests/nophar.phar
- Fixed tests
2008-01-26 00:12:00 +00:00
Steph Fox
ddc051cebe - Rewrite stub to take up slightly less space
- Fix tests
- Test phars should probably be regenerated, although only one fails here currently (nophar.phar in web context)
2008-01-25 17:26:18 +00:00
Steph Fox
69afbc1099 "What helly said" 2008-01-25 16:05:26 +00:00
Steph Fox
61c3a60815 Make all possible build combinations work under doze (external zip library) 2008-01-25 15:00:24 +00:00
Greg Beaver
29c5c804d0 initial work on more efficient zip implementation, read support working, write not implemented yet
This implementation will support read/write of extra field headers, both zlib/bzip2 compression read/write
it will also delay header comparison/crc32 check until file open, making opening a single file
within the zip much more efficient for large zip files
it also uses emalloc/php streams and is therefore less likely to leak.
this code is not yet built in config.m4/config.w32
2008-01-23 23:19:03 +00:00
Greg Beaver
47a60c4f16 fix 2 tests, add phar.readonly checks to rmdir/mkdir 2008-01-22 20:24:52 +00:00