Commit Graph

934 Commits

Author SHA1 Message Date
Steph Fox
9752739cf2 Let's have reflection reflect reality... 2008-02-20 17:58:56 +00:00
Steph Fox
3285ceba7e Take some of the pain out of stub rewrites. (Full default stub is tested elsewhere.) 2008-02-20 14:28:49 +00:00
Steph Fox
8febc7fd54 Fix 'clean' sections 2008-02-20 13:33:00 +00:00
Steph Fox
6306029051 Move supporting files to their own directory (toplevel tests) 2008-02-20 13:11:40 +00:00
Steph Fox
89217ae543 Fix clean section 2008-02-19 03:24:18 +00:00
Steph Fox
76b02cca40 Update tests to match new stub length 2008-02-19 03:12:11 +00:00
Steph Fox
7bb00d024e Allow createDefaultStub() to accept 0, 1 or 2 parameters. Default for both CLI and web is 'index.php'.
@Greg: this breaks a handful of tests due to the change in stub.h - will fix in a bit. The only one that's interesting is you can't do strlen(Phar::createDefaultStub()) and expect anything other than an exception now.
2008-02-18 21:45:02 +00:00
Steph Fox
335e57e443 Fix ZTS build (again), kill unused var 2008-02-18 04:51:04 +00:00
Greg Beaver
ba9fcf62fc add initial support for hashing mounted directories. Actual matching of mounted directories is not yet supported. 2008-02-18 04:45:42 +00:00
Steph Fox
87626d56d2 Fix ZTS build *nicely* 2008-02-18 04:42:04 +00:00
Greg Beaver
6798dc44ed add Phar::mount() to manually mount a file or directory
# TODO: implement directory mounting.  Involves scanning paths that are not exact matches for a partial match.
# this also means maintaining a per-phar hash of mounted directories for quick matching
2008-02-18 04:32:50 +00:00
Greg Beaver
9c62ef1124 add externally parsed files to temporary manifest (this will be made
optional and must be explicitly enabled per-phar)
2008-02-18 03:37:51 +00:00
Steph Fox
6acac494ab Fix ZTS build 2008-02-18 00:46:07 +00:00
Greg Beaver
54ff8c3a8f begin work on ability to mount files from external locations as if they were inside of a phar archive 2008-02-15 05:01:40 +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
Steph Fox
2a5f1ba3a6 Add missing SKIPIF, rename vars for readability 2008-02-12 16:55:50 +00:00
Steph Fox
2ad96985c7 - it helps if you add the new files :) 2008-02-12 16:42:35 +00:00
Steph Fox
85e641ebb4 Make tests/tar in line with tests/zip. 2008-02-12 16:39:59 +00:00
Greg Beaver
592635d0c0 fix TSRM build 2008-02-12 05:38:01 +00:00
Greg Beaver
97484e0b95 update TODO to reflect must-haves prior to 2.0 2008-02-12 05:36:02 +00:00
Greg Beaver
22d05677c1 fix test (all tests pass on unix now) 2008-02-12 05:30:59 +00:00
Greg Beaver
3234e78ca1 fix remaining broken tests broken by the addition of phar->fp closing 2008-02-12 05:28:06 +00:00
Greg Beaver
2f1ec934af fix some of the failing tests due to non-reopened phar fp 2008-02-12 05:16:53 +00:00
Steph Fox
b1ed2e8059 There's a difference between 'BORKED' and 'FAILED'... 2008-02-11 21:05:47 +00:00
Steph Fox
ef46f3e3a2 Funnily enough those frontcontroller tests still pass here! Investigating... 2008-02-11 20:55:44 +00:00
Steph Fox
914c94d497 kill a couple of msvc warnings 2008-02-11 20:53:05 +00:00
Greg Beaver
ba002c5b9c revert last commit to phar_object.c
fix open file pointers issue on windows
2008-02-11 17:13:18 +00:00
Greg Beaver
4c68617106 add destructor for Phar object to decrease refcount 2008-02-11 16:49:53 +00:00
Greg Beaver
d659ce7a0c fix windows pathname issues 2008-02-11 07:33:20 +00:00
Greg Beaver
8cd58822c3 fix TSRM and 5.2 build 2008-02-11 06:58:56 +00:00
Greg Beaver
ca7ae5d190 update TODO 2008-02-11 06:54:46 +00:00
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
Greg Beaver
f51bf6118c fix tests to match CVS 2008-01-22 05:26:38 +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
34c1e6e112 s/1.3.0/2.0.0/ 2008-01-19 20:13:31 +00:00
Greg Beaver
d5fd042872 bump 1.3.0 to 2.0.0, this is a big feature addition release 2008-01-19 19:51:14 +00:00
Greg Beaver
d7ff13cf9a update package.xml 2008-01-19 18:39:49 +00:00
Greg Beaver
a5358c0725 bump API version if the created phar has directories in it, so that it won't load with older phar versions 2008-01-19 18:30:30 +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
Nuno Lopes
dc84b8b767 fix gcov build 2008-01-18 20:12:45 +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
109cbc9f50 add needed define back into config.w32, make zip required mod on win32, remove lib/.cvsignore 2008-01-18 00:11:37 +00:00
Greg Beaver
ad23787e0c remove unneeded define, zip is required on windows 2008-01-17 20:21:55 +00:00
Greg Beaver
5689f3c9c6 add new test for opening a zip-based phar with no zip ext, update skipif for phar_convert test 2008-01-17 20:17:40 +00:00
Greg Beaver
e4c02a6b96 do fancy-shmancy zip dependency validation because ZEND_MOD_OPTIONAL_EX doesn't do any version validation 2008-01-17 05:52:18 +00:00
Greg Beaver
86fc96d86b update package.xml 2008-01-17 04:56:40 +00:00
Greg Beaver
fa6027041d refine config.m4 to use the newly found zip headers 2008-01-17 04:04:30 +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
535865e908 give up on gpg signing because of non-existent windows support for gpg signing lib 2008-01-17 03:19:44 +00:00
Greg Beaver
ff076eb3cc update m4 to make zip support always enabled so zip headers must be installed, add dep to package.xml 2008-01-17 02:03:59 +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
Marcus Boerger
9fe2dd5697 - cleanup and make build with HEAD 2008-01-14 18:06:05 +00:00
Greg Beaver
ba707bad4c fix test (make OS-agnostic) 2008-01-14 06:25:22 +00:00
Greg Beaver
505247b6ef fix test to be OS-agnostic
# steph - this is a different test from the one I fixed earlier, I think that's the confusion :)
2008-01-14 06:23:10 +00:00
Greg Beaver
34bb2d7e76 unixify path separators in tar-based phars, always use this value for duping alias
# found by delete.phpt unit test.  I love unit tests
2008-01-14 06:19:43 +00:00
Greg Beaver
0df060f18b add missing skip sections in zip tests 2008-01-14 05:25:11 +00:00
Greg Beaver
b4eecadd7c fix test (make OS-agnostic) 2008-01-14 05:19:23 +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
611da7a5c1 fix test (make OS-agnostic) 2008-01-14 05:03:02 +00:00
Greg Beaver
3fd137c88f fix build on windows (Steph Fox) 2008-01-14 02:47:55 +00:00
Greg Beaver
9131f152ba new test for inclusion within phar that takes CWD into account 2008-01-12 22:25:40 +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
64cb8c8111 fix conflict on win32 if phar compiled statically 2008-01-12 16:18:26 +00:00
Greg Beaver
9bcbbce5bf add definitions for MAX_WBITS in case it isn't defined 2008-01-12 16:15:17 +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
67a15e332f add missing defines, s/filename_len/filename_length/ (thanks steph) - now over to the windows box and debug this properly 2008-01-12 02:13:52 +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
aae1442ee3 update package.xml 2008-01-11 07:33:32 +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
7e65f56264 MAPPHAR_ALLOC_FILE slipped in there somehow 2008-01-10 22:05:30 +00:00
Greg Beaver
74df58d255 fix tsrm build, fix various problems with initialization and zlib/bz2-compressed phars 2008-01-10 21:21:38 +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
aeda51223c update package.xml 2008-01-09 08:49:58 +00:00
Greg Beaver
7def324a80 new tests for bz2-compressed tar or phar-based phars (wow, worked on first try, how about that) 2008-01-09 08:48:56 +00:00
Greg Beaver
21ab2ca8e9 fix gzipped phars in phar file format, add test 2008-01-09 08:45: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
59da946283 add tests to package.xml, note new empty directory feature 2008-01-09 03:53:42 +00:00
Greg Beaver
6961da0811 add tests for directory creation and management for tar and zip-based phars, add isPhar() to phar-based test
to confirm it is indeed a phar-based archive
2008-01-09 03:51:38 +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
88bdd12803 update package.xml so this can be installed 2008-01-08 20:36:32 +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
Greg Beaver
63adb98f78 split out zip functions 2008-01-08 19:40:23 +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
0c346d9aec add tar-based to 2 tests 2008-01-07 22:22:27 +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
e78819fc01 new tests 2008-01-07 18:07:10 +00:00
Greg Beaver
5767e570b4 make test OS-agnostic 2008-01-07 18:05:23 +00:00
Greg Beaver
d9d91f424b fp must be nulled on every write also when == phar->fp or we get stale fp and problems. add new test that unearthed this problem 2008-01-07 17:58:31 +00:00
Greg Beaver
4a59f700f1 add tar-based to test names 2008-01-07 17:41:30 +00:00
Greg Beaver
b18b960e17 new tests 2008-01-07 17:40:43 +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
3dca799fbb fix extension detection for aliases with no extension 2008-01-07 17:18:41 +00:00
Greg Beaver
9e179e4b93 fix test 2008-01-07 05:46:12 +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
ff1c8b2beb new tests for tar format 2008-01-07 05:35:18 +00:00
Greg Beaver
826e98be83 eliminated memleak, now to make it recognize "dir" as a directory 2008-01-06 05:28:27 +00:00
Greg Beaver
99922cb729 fix typo in phar.c if bz2 is disabled 2008-01-06 05:16:20 +00:00
Greg Beaver
0f94226b71 new test, exposes some memleaks, but not yet sure where they are (done for today) 2008-01-05 23:26:24 +00:00
Greg Beaver
632a633154 fix segfault, add separate tar test for readonly=0 on corrupted tar 2008-01-05 23:02:23 +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
2fa568b7b0 do not attempt to create a new phar if a file exists and is corrupted or is not a phar archive,
i.e. require a clean slate - a non-existent file or a valid phar archive - to muck around with phar contents
add the first tar-based phar test
2008-01-05 22:46:54 +00:00
Greg Beaver
ec0cd27f0d modify test to ensure that query string is preserved when munging server vars 2008-01-05 22:04:58 +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
41762671c8 new test 2008-01-05 04:30:30 +00:00
Greg Beaver
8f79663143 new test 2008-01-05 04:27:01 +00:00
Greg Beaver
3a27729fd8 new test 2008-01-05 04:12:24 +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
2fd9f17353 clarify test names 2008-01-05 03:50:13 +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
1549f54264 clarify test name 2008-01-05 03:42:05 +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
Greg Beaver
67688371f7 use zip_free() instead of zip_close(), and don't add a stub if it already exists in phar_zip_flush(), update TODO 2008-01-04 17:04:41 +00:00
Marcus Boerger
2eecfbf94e - Change 'print' to 'die' for skip notices 2008-01-04 16:26:44 +00:00
Marcus Boerger
95a9f1faf6 - Fix module info for bz2
- Differentiate enabled, disabled and unavailable
2008-01-04 16:10:49 +00:00
Marcus Boerger
4aec466e95 - Pendantic changes 2008-01-04 14:06:50 +00:00
Greg Beaver
7babdcfe59 fix windows build (hopefully :) 2008-01-04 04:59:12 +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
f589855093 fix tar-based phars creation and loading 2008-01-03 18:13:27 +00:00
Greg Beaver
c83b566218 commit missing files (helps if you cvs add, don't it?) for tar implementation 2008-01-03 05:35:19 +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
Greg Beaver
06a98d96c7 update proto, arginfo for webPhar 2007-12-29 01:37:12 +00:00
Greg Beaver
acc44900de add vastly improved 404 handling 2007-12-29 01:35:46 +00:00
Greg Beaver
60dc8e5ff4 fix redirect to index file 2007-12-28 23:33:15 +00:00
Greg Beaver
e1a41da652 fix on windows
# it works! it works!
2007-12-26 16:59:01 +00:00
Greg Beaver
e861913e39 fix windows build
# there HAS to be a better way to do this...
2007-12-24 21:40:54 +00:00
Greg Beaver
4ae47c1df9 remove unused variable 2007-12-24 20:48:12 +00:00
Greg Beaver
5200481aaf fix mem leak 2007-12-24 20:30:44 +00:00
Greg Beaver
02c7ff1343 complete re-factoring of front controller. Now it is done with
Phar->webPhar():
<?php
Phar::webPhar();
__HALT_COMPILER();

With the above stub, the default front controller will kick in.  An array of mime type overrides, and another
array mapping phar file entry -> redirected entry can be used to further customize
[DOC]
2007-12-23 21:12:42 +00:00
Greg Beaver
d443c76bed new test for front controller 2007-12-22 07:47:15 +00:00
Greg Beaver
8e4cc4b3dd first attempt at major new feature: default front controller for web
Currently, an entire phar entry is leaked for no obvious reason, otherwise it works.  Sample code:
The phar has to be created using Phar->useFrontController(); and the stub performs actual resolution of which file to load:
<?php
Phar::mapPhar();
include 'phar://' . __FILE__ . '/' . substr($_SERVER['REQUEST_URI'], strlen(basename(__FILE__)));
__HALT_COMPILER();
?>

Phar automatically determines mime type from the file extension and either parses or displays the file.  Modification of REQUEST_URI
and other variables should happen in the stub
[DOC]
2007-12-22 07:46:53 +00:00
Greg Beaver
245ca069c8 same fix we used in linux to make all extension deps optional 2007-12-21 19:02:20 +00:00
Greg Beaver
185a4a8309 on second thought, hooking into getcwd() is a bad idea, who uses this for code loading, anyways? 2007-12-21 04:49:25 +00:00
Greg Beaver
0d830a27ea implement cleaning of crap paths - major functionality boost 2007-12-20 23:12:40 +00:00
Greg Beaver
0bfc046eac remove minor (and unnecessary I might add) windows compile warnings 2007-12-20 04:12:23 +00:00
Greg Beaver
d4eccb4471 holy cow - include/fopen/cwd magic fully working on unix now for windows testing 2007-12-19 04:37:25 +00:00
Greg Beaver
2222da9493 making progress (include magic works) 2007-12-19 03:17:05 +00:00
Greg Beaver
0c51d58138 [unfinished] magically handle getcwd() and fopen() with include_path inside phar
this work is incomplete, but compiles and existing tests pass
2007-12-18 17:01:24 +00:00
Greg Beaver
d757f6ee5e oops, need to make these things optional, not required 2007-12-18 05:32:11 +00:00
Greg Beaver
7fa0b43518 fully implement Phar->copy(), fix test 2007-12-16 06:31:00 +00:00
Greg Beaver
427e54dcd9 add failing test 2007-12-16 01:11:50 +00:00
Greg Beaver
f11103a9a1 Phar::copy() [not yet working] 2007-12-16 00:57:39 +00:00
Greg Beaver
bb4096ff29 Phar->buildFromIterator now can also accept a stream handle as a value in addition
to a file path (string) or SplFileInfo object
[DOC]
2007-12-14 19:45:22 +00:00
Greg Beaver
f01adb0048 fix test 2007-12-14 18:54:54 +00:00
Greg Beaver
47cef85c22 fix alias overloading detection on windows 2007-12-14 18:42:57 +00:00
Greg Beaver
052dcfcbae fix test 2007-12-14 18:37:49 +00:00
Greg Beaver
4fb3122b16 fix terrible logic discovered in windows testing (not sure how it ever worked on unix) 2007-12-14 18:34:12 +00:00
Greg Beaver
708569029c windows fixes #2 (thanks Steph you rule) 2007-12-14 05:45:48 +00:00
Greg Beaver
c6fe26af37 windows fixes (thanks Steph you rule) 2007-12-14 05:39:20 +00:00
Greg Beaver
16c8adf0c1 fix test 2007-12-14 05:22:53 +00:00
Greg Beaver
38bf150e4d remove stupid*$(# debug code 2007-12-14 05:00:59 +00:00
Greg Beaver
2c77090174 better fix, revert unintentional commit to Makefile.frag 2007-12-14 04:10:14 +00:00
Greg Beaver
63f3d5958d fix build on windows, fix segfault in tsrm by uninitialized pointer 2007-12-14 04:08:34 +00:00
Greg Beaver
3b356d5ed8 new test
now, SplDirectoryIterator can be used directly with Phar->buildFromIterator() in order to populate the
files in a phar archive.  When combined with a RegexIterator and other filters, it becomes very easy to create
a phar archive with 1 line of code
[DOC]
2007-12-13 05:22:06 +00:00
Greg Beaver
6e78306595 new test 2007-12-13 01:20:25 +00:00
Greg Beaver
d243f9ff99 code re-organize to make it more logical 2007-12-13 01:16:56 +00:00
Greg Beaver
4f2d1674ca new test 2007-12-13 01:14:13 +00:00
Greg Beaver
c1a6037cf2 fix test, new test 2007-12-13 01:12:10 +00:00
Greg Beaver
38b35f1448 Phar->buildFromIterator: fix another mem leak, fix test 2007-12-13 01:05:59 +00:00
Greg Beaver
5051732d4c kill 1 memleak 2007-12-13 01:01:27 +00:00
Greg Beaver
463731e2de Phar->buildFromIterator: use spl_iterator_apply(), add 4 tests (mem leaks not yet fixed in the 4th) 2007-12-13 00:54:15 +00:00
Greg Beaver
5af85b4f8f implement Phar::buildFromIterator()
first argument is an iterator that returns as values paths to files to add to the phar archive
the key should be the path that the file should be saved as within the phar archive
if the optional second parameter is passed, then the key is ignored and substr(value, strlen(base_directory)) is
used as the save path within the phar archive
[DOC]
2007-12-12 18:01:40 +00:00
Greg Beaver
8a614e30db use thread-safe global var to store zend_compile_file, and restore the current zend_compile_file, not the one we
found in MINIT
2007-12-11 19:28:35 +00:00
Greg Beaver
47d859ced2 use stream_copy_to_stream again, figured out how to make the stupid filters work 2007-12-11 19:21:01 +00:00
Greg Beaver
f8fc8fbd69 fix test in 5.3+ 2007-12-11 19:19:47 +00:00
Greg Beaver
30fa2bda71 add note about new include functionality 2007-12-11 03:12:42 +00:00
Greg Beaver
688aef57f8 add the ability to automatically resolve includes inside a phar to files within that phar, so
no code modification is needed to include/require
2007-12-09 21:57:44 +00:00
Greg Beaver
84c3c96754 add helper phars for test 2007-11-25 05:25:04 +00:00
Greg Beaver
48ca9c876c new test to verify signature algo parsing works 2007-11-25 05:24:50 +00:00
Greg Beaver
38fc1fbc35 new test for dir iteration (covers some code missing in gcov tests) 2007-11-25 05:15:50 +00:00
Greg Beaver
4bcb68a4e8 fix errors found in delMetaData(), add get/delMetaData() to MetaData read test 2007-11-25 05:04:40 +00:00
Greg Beaver
4f34a69ad0 new test for Phar::getModified() 2007-11-25 04:54:36 +00:00
Greg Beaver
6b3562c107 new test for no signature 2007-11-25 04:52:49 +00:00
Greg Beaver
634edbe97a fix test expected output 2007-11-25 04:49:53 +00:00
Greg Beaver
8fa1a31626 MFB fix to test 2007-11-25 04:48:14 +00:00
Greg Beaver
0a4d447b28 add new tests for Phar::getSupportedCompression 2007-11-25 04:43:01 +00:00
Greg Beaver
e34be4f8bc preliminary work on using gnupg to verify/create signatures - no implementation, just phpinfo() output and build rules 2007-11-24 04:30:08 +00:00
Greg Beaver
bdff161e87 WS (spaces instead of tabs) 2007-11-24 04:09:01 +00:00
Greg Beaver
0034b47c83 experimental support for optional bz2 extension - should make windows users a whole lot happier (forgot w32) 2007-11-24 04:07:07 +00:00
Greg Beaver
a72251be6e experimental support for optional bz2 extension - should make windows users a whole lot happier 2007-11-24 04:06:44 +00:00
Marcus Boerger
4b18c23fd1 - Improve make pharcmd
- Add -b to pack and stub-set commands of phar.phar
2007-11-23 16:44:04 +00:00