Commit Graph

139 Commits

Author SHA1 Message Date
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
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
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
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
b2412c4568 fix problems found while documenting. Throw consistent exceptions, chmod is not allowed on
temporary directories, but is allowed on regular ones
allow uncompressAllFiles() to decompress a gzip/bzipped tar archive
fix some protos
2008-01-21 05:28:09 +00:00
Greg Beaver
117f5e2639 add web-based support for default stub, now phars written with webPhar() will work
out of the box regardless of server configuration with phar file format
split up stub.h strings into 2046 byte chunks because MS VC 6 is friggin stupid
2008-01-20 00:49:45 +00:00
Greg Beaver
d583fae0cc add Phar::createDefaultStub(), which can take as an argument the filename
that should be loaded as a "bootstrap" for the phar archive
2008-01-19 04:26:22 +00:00
Greg Beaver
9a59e60657 remove HAVE_ZIP defines just as we removed HAVE_BZ2 defines and for the same reason
update outdated description of phar in config.m4
make zip extension mandatory on windows for compiling purposes
2008-01-17 03:59:07 +00:00
Greg Beaver
a3718dcfa3 no need to use conditional defines for bz2, we don't call it except indirectly through stream wrappers.
After removing HAVE_BZ2 conditionals, phar works even if bz2 is not present on installation through pecl
2008-01-17 03:48:29 +00:00
Greg Beaver
0e934c70d7 add optional whole-file compression to convertToTar/convertToPhar 2008-01-16 21:09:32 +00:00
Greg Beaver
31ed60001c fix build on windows 2008-01-16 20:17:47 +00:00
Greg Beaver
d1eda9c8ac add Phar::convertToTar(), Phar::convertToZip(), and Phar::convertToPhar() 2008-01-16 07:24:39 +00:00
Greg Beaver
cb40b39b5b add support for creation of gzipped and bzipped tar-based phars 2008-01-15 23:41:44 +00:00
Greg Beaver
ab99c77a5e add a whole slew of missing returns after throwing an exception, and remove 1 spurious return after RETURN_TRUE 2008-01-14 05:12:46 +00:00
Greg Beaver
f5e4ff21dd fix segfault in Phar::mungServer() found in frontcontroller20.phpt 2008-01-12 22:21:50 +00:00
Greg Beaver
56e84a390c fix segfault in Phar::webPhar() if file is in root directory, found in frontcontroller16.phpt 2008-01-12 22:16:00 +00:00
Greg Beaver
4df43510b9 make zip optional 2008-01-12 05:17:12 +00:00
Greg Beaver
e9ee7dbfc5 fix compile on windows
remove internal libzip
add required dep on zip (will make optional in a few minutes)
2008-01-12 04:32:19 +00:00
Greg Beaver
36f3d80779 stupid windows doesn't allow varargs macros, so remove it. remove unused variable 2008-01-11 07:39:02 +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
a38e4ff9a7 always mung PATH_INFO and PATH_TRANSLATED, fix segfault if tar-based phar has no stub 2008-01-11 02:52:13 +00:00
Greg Beaver
ab4c2caf4b add interception of is_dir(), file_exists() and file_get_contents() - will make these optional shortly 2008-01-10 15:13:00 +00:00
Greg Beaver
f6b16061d1 implement whole-file compression of phars for phar/tar-based phars
still not 100% working, add failing test
add Phar::isCompressed(), which returns either 0, Phar::GZ, or Phar::BZ2
[DOC]
2008-01-09 07:09:04 +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
b93b48663d complete set of new tests for zip-based phars (need to test compression for zip-based phars)
fix a whole bunch of zip-related bugs
tar tests need some naming
add phar information to error messages, fix existing tests to reflect this
2008-01-08 07:08:46 +00:00
Greg Beaver
36efc2a907 eliminate potential double-free of alias
major improvement of zip/tar-based phar stub execution, now __FILE__ says it is the phar, and not phar/.phar/stub.php,
so that the same stub can be used for phar or tar/zip-based phars
ridiculous speedup of rename() within a phar (something like 1000%)
last of the tar-based phar fixes
new tests for tar-based phars, fix existing tests to use new format of __FILE__
2008-01-07 22:21:10 +00:00
Greg Beaver
71f6ae0be5 fix segfault (now all existing tests pass 2008-01-07 17:31:53 +00:00
Greg Beaver
ed312a7a05 fix segfault (duh, can't free something that was not initialized) 2008-01-07 17:28:45 +00:00
Greg Beaver
8a46146f37 fix stat of directory in tar/zip
improve phar recognition of tar/zip-based phars in phar_compile_file
fix segfault in Phar::webPhar() with invalid redirect
add Phar->isTar()/isZip()/isPhar() to determine internal file format
fix creation of tar-based phars from filename in some circumstances
fix read of corrupted file contents from a tar if the tar had been opened readonly and then modified
ensure directories are marked with is_dir in tar file format entries
copy fp_refcount logic into phar_tar_flush() from phar_flush()
fix segfault when flushing a tar with a new stub/alias
2008-01-07 05:41:09 +00:00
Greg Beaver
bd0d9e8de3 remove mung server list hash destroy, this is done in shutdown 2008-01-05 22:48:06 +00:00
Greg Beaver
2410cc96b6 complete tests for Phar::mungServer 2008-01-05 22:02:33 +00:00
Greg Beaver
efc22a3726 new tests, fix mime type overrides (all web front controller primary features are now tested and working for regular phar files) 2008-01-05 06:14:43 +00:00
Greg Beaver
e864f512bb new test, free resources on error in webPhar() (thanks new test\!) 2008-01-05 05:47:47 +00:00
Greg Beaver
dd11d4f64e new test 2008-01-05 05:12:44 +00:00
Greg Beaver
b859c9dd4b beautify 404 error handler, and note missing file.
throw exception if webPhar() is attempted with an extracted file, as webPhar() makes no sense on-disk
2008-01-05 04:03:33 +00:00
Greg Beaver
08b7b76418 fix Location header for index if request has a /, 2 new tests, add index.php to frontcontroller phar 2008-01-05 03:49:01 +00:00
Greg Beaver
653dc9e8ce fix front controller tests (requires patch to run-tests.php posted to internals a little while ago)
allow phars to have extension .php as last resort
fix phar-based phars for MIME_OTHER type
2008-01-05 03:41:43 +00:00
Marcus Boerger
4aec466e95 - Pendantic changes 2008-01-04 14:06:50 +00:00
Greg Beaver
e8a5b20514 replace crappy $_SERVER munging with explicit munging via
Phar::mungServer().  This static method takes an array with one of these 4 indices (case-sensitive):
'PHP_SELF', 'SCRIPT_NAME', 'SCRIPT_FILENAME', 'REQUEST_URI'
and removes any reference to the actual path on the server.  This allows older apps to function unmodified inside a phar.
the variables are re-registered as PHAR_PHP_SELF and company to allow access from clever script files
[DOC]
2008-01-04 04:57:11 +00:00
Greg Beaver
8e18f1cae1 Phar::webPhar() and various problems relating to shutdown in an apache process fixed 2008-01-04 01:45:37 +00:00
Greg Beaver
8ee4266b3f initial tar support - a few kinks to work on in phar creation, but read works 2008-01-03 04:45:00 +00:00
Greg Beaver
652d39c330 add zip-based phar support. not quite working is webPhar(), not sure why yet 2007-12-31 22:42:40 +00:00
Greg Beaver
b8592e228d make blah.phar/ access indexfile just like blah.phar 2007-12-29 02:40:49 +00:00
Greg Beaver
f56865ad4d fix redirects and s/redirects/rewrites/ 2007-12-29 02:38:29 +00:00
Greg Beaver
9320ac9893 remove FIXME - it's been fixed 2007-12-29 02:04:09 +00:00
Greg Beaver
3dcee1c8c7 fix index/custom 404 page 2007-12-29 02:01:12 +00:00