Commit Graph

40 Commits

Author SHA1 Message Date
Greg Beaver
f232c7f945 MFB: fix bug #47085:rename() returns true even if the file in PHAR does not exist 2009-02-03 18:29:46 +00:00
Sebastian Bergmann
7f4dc8702a Bump copyright year, 3 of 3. 2008-12-31 11:12:40 +00:00
Greg Beaver
692222f12a MFB: fix links for fseek as well 2008-10-11 22:21:07 +00:00
Greg Beaver
44cb95a53d MFB: fix reading links from streams (works with PharFileInfo->getContent()) 2008-10-11 22:12:18 +00:00
Greg Beaver
ae98beaf02 MFB: fix 017.phpt in streams.c, and very dangerous intercepting of file functions in all cases introduced in multi-threaded fix 2008-09-26 23:35:11 +00:00
Greg Beaver
8db86ad19e MFB: fix minor issues found by ICC (unused variables and the like) 2008-09-13 22:31:18 +00:00
Steph Fox
cd011d1e9a - MFB 2008-08-31 20:54:28 +00:00
Steph Fox
1c36e772b7 - Merge Dmitry's changes from PHP_5_3 branch 2008-08-01 16:28:19 +00:00
Steph Fox
c6aa379d74 - This is as good as it gets in HEAD at present (~30% tests fail here) 2008-08-01 13:45:06 +00:00
Greg Beaver
ca6d36efb8 MFB: refactor function names for clarity. No functionality change 2008-05-30 22:39:33 +00:00
Greg Beaver
144e472967 MFB: plug security hole of unfettered creation access to .phar magic directory 2008-05-15 16:09:21 +00:00
Steph Fox
c1ae13b985 - Make internal code back-compatible. This included a binary cast in the default stub, hence many test updates.
- Just over a third of tests pass. Test manifests are broken currently.
2008-05-14 21:27:31 +00:00
Steph Fox
247d91e780 - 'It builds on my box'.
- Don't expect any tests to pass.
2008-05-13 18:35:25 +00:00
Greg Beaver
549bf83bd1 [DOC]
remove phar.extract_list
remove Phar::getExtractList()
2008-05-07 05:38:31 +00:00
Greg Beaver
3d858f4aa9 implement symbolic link support within a tar-based phar archive
this also resulted in a major fix for mounted directories, which were recycling the 'link' field which
could cause stupid conflicts with actual links, so move that to new 'tmp' field.
2008-04-21 06:17:51 +00:00
Greg Beaver
c4f502fae0 COMPLETELY rework filename extension detection. Now the only requirements are:
1 - executable phars must contain '.phar' in the filename
2 - non-executable phars must not contain '.phar' and must have an extension of at least 1 character

In addition, phar filenames must exist if opened for read, and the directory containing the phar must exist if opened for creation
if opened for creation, the file must not already exist
[DOC]
2008-04-18 04:13:13 +00:00
Greg Beaver
023d1c96ea fix invalid variable access 2008-04-14 22:39:27 +00:00
Greg Beaver
24b6df944d complete rename code coverage tests, completely re-do errors (why are the streams funcs so dang inconsistent in error handling/return values?) 2008-04-14 18:33:12 +00:00
Greg Beaver
567870d4ef remove unused file 2008-04-14 18:16:51 +00:00
Greg Beaver
0c9fcac767 remove redundant check for file existence, add another unlink edgecase test 2008-04-14 18:03:57 +00:00
Greg Beaver
bf701fe74f disallow unlink() on extracted phars (the idea is that it is a read-only for execute thing), add tests for unlink edge cases 2008-04-14 17:54:38 +00:00
Greg Beaver
3703d9195d nuke potential segfault in phar_open_url, remove mem leaks due to error logging in phar_wrapper_stat, add to test case 2008-04-14 17:36:48 +00:00
Steph Fox
ef203ea793 - Kill doze compiler warning 2008-04-14 17:23:25 +00:00
Greg Beaver
f3f9f52af9 minor re-factoring of phar_open_url to remove one nested brackets, put fopen edge cases in its own test, tweak test phar file names 2008-04-14 17:18:58 +00:00
Greg Beaver
2e9fca4f0b fix read/write for PharData object, update tests to current API 2008-03-24 03:01:31 +00:00
Greg Beaver
62ed0adcca fix memleak found by valgrind 2008-03-23 00:05:53 +00:00
Greg Beaver
3fcc6565b7 with stream wrappers in include_path, and after marcus's last fix, only 1 failing test (tar/tar_makegz.phpt)
add mounted file/dir to url stat
2008-03-21 18:50:22 +00:00
Greg Beaver
0262e844c4 implement full support and usage of phar stream in include_path, for both 5.2 and 5.3.
5.3 code expects the proposed patch for stream wrapper in include_path to be committed
5.2 code only supports phar stream wrapper in include_path.
this is a 2-step process.  After this, more magic, particularly in funcinterceptors.c will be
converted to use phar_resolve_path, which is far safer than the current implementation.

this needs windows and 5.2 testing unix/windows
2008-03-12 03:55:12 +00:00
Steph Fox
001ffec19f Initial support for PharData object.
Note: two tests currently fail. IMHO we should be throwing E_ERROR on encountering a corrupted archive, not trying to throw a trail of exceptions...
New tests still to be written, not all functionality is in place yet.
2008-02-27 21:34:26 +00:00
Steph Fox
8513db73bb A bunch of stuff to do with filename conversion. Hopefully it won't sink the ship. 2008-02-24 22:29:06 +00:00
Marcus Boerger
2f29db8333 - Fix logic 2008-02-23 13:04:59 +00:00
Greg Beaver
f72ce59e95 remove refcount hack to workaround zlib memleak fixed in zlib
intercepted file functions now fall through if the file is not found in the phar, this allows access to external libraries
actually use include_path for locating files for inclusion and in file_get_contents/fopen when include_path is requested.
This allows applications like Zend Framework MVC implementation to function properly
2008-02-13 15:00:31 +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
Greg Beaver
7540adf058 major improvement:
the new default stub allows creation of phars that run identically
1) with Phar extension
2) without Phar extension
3) extracted to disk from the phar
this makes the default phar format quite interesting as it eliminates the only drawback of the extension
2008-01-18 05:42:16 +00:00
Greg Beaver
8fb4205a8d add Phar::interceptFileFuncs()
To intercept fopen(), file_get_contents(), opendir(), and all the stat-based functions so that
code like "if (is_readable('./config.inc.php'))" actually works inside of a phar
[DOC]
2008-01-11 07:30:03 +00:00
Greg Beaver
abde85c420 add rmdir() support, add rmdir to dir test
fix *extremely* ancient problem where phar_wrapper_stat always returned success indicating the file existed
rename phar_destroy_manifest to phar_destroy_manifest_entry
2008-01-09 03:47:22 +00:00
Greg Beaver
9f5b3a229f fix empty directories in phar, add test 2008-01-09 00:58:37 +00:00
Greg Beaver
1a3624494e implement mkdir (compiles, not yet tested), support for empty directories in phar (not yet tested)
revert last commit of efree(), it's necessary.
2008-01-08 22:14:16 +00:00
Greg Beaver
70ce6b77d0 remove invalid free if opening a phar file in plain_map fails 2008-01-08 21:40:48 +00:00
Greg Beaver
4bce48417b split stream file handlers into stream.c and directory handlers into dirstream.c 2008-01-08 20:31:54 +00:00