Commit Graph

331 Commits

Author SHA1 Message Date
Greg Beaver
9e33e0cc5b add support for proper APC caching 2008-04-15 04:56:34 +00:00
Greg Beaver
2277396fe3 fix edge case where a new phar is created via mkdir(), add to dir.phpt test 2008-04-14 15:21:41 +00:00
Greg Beaver
b8865a63ae another attempt at fixing mac OS X compile, remove unused obsolete code 2008-04-14 04:47:34 +00:00
Greg Beaver
1c3097fcbe make built-in SplFileInfo->isWriteable() work for PharFileInfo as well, by ensuring phar->is_writeable is set/reset when phar.readonly is changed 2008-04-10 03:12:08 +00:00
Marcus Boerger
5b3560f069 - Ifdef out code that has if(0) and doesn't compile anyway 2008-03-27 12:54:23 +00:00
Greg Beaver
a090d45251 fix build on PHP 5.2, prepare release of 2.0.0a2 2008-03-27 06:38:53 +00:00
Marcus Boerger
7202434956 - Add documentation 2008-03-24 12:53:28 +00:00
Greg Beaver
1bda8cf708 a subtle plea for help to Marcus... 2008-03-24 03:05:24 +00:00
Greg Beaver
2e9fca4f0b fix read/write for PharData object, update tests to current API 2008-03-24 03:01:31 +00:00
Marcus Boerger
69c71f703e - Add .cvsignore 2008-03-23 16:51:52 +00:00
Greg Beaver
27ca45f898 don't disallow opening .tar/.zip files as Phar object if readonly is disabled, the whole idea is to be able to
add crap including an automatic stub or explicit stub
2008-03-23 06:59:59 +00:00
Greg Beaver
eea82226c1 fix potential segfault by misuse of phar_find_in_include_path 2008-03-23 05:39:58 +00:00
Greg Beaver
6cef8da201 move all blah++ to ++blah where possible for those with crapass compilers 2008-03-22 22:11:49 +00:00
Greg Beaver
01e5bbbaf5 fix memleak in php 5.2, simplify code slightly 2008-03-22 21:54:55 +00:00
Steph Fox
c0619c6523 Make versioning more standard 2008-03-22 17:09:24 +00:00
Marcus Boerger
1b286e1475 - If multiple possible exts are found use the first one.
This fixes an issue with: phar.phar info -f install-pear-nozlib.phar
  because that archive contains a .tar file
2008-03-22 00:15:45 +00:00
Marcus Boerger
e08556eb2e - Constify 2008-03-22 00:11:43 +00:00
Greg Beaver
d02dff1363 save work - sandbox is completely f**ed up, have to rm -rf and start again
This *SHOULD* fix issues, but I can't get run-tests to work reliably to be absolutely sure
2008-03-20 23:59:07 +00:00
Marcus Boerger
a1cbab9142 - Rewrite scanner to be based on re2c instead of flex
The full patch is available as:
  http://php.net/~helly/php-re2c-5.3-20080316.diff.txt
  This is against php-re2c repository version 98
  An older patch against version 97 is available under:
  http://php.net/~helly/php-re2c-97-20080316.diff.txt
2008-03-16 21:06:54 +00:00
Antony Dovgal
983ff657ba fix zts build 2008-03-13 09:57:49 +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
8343d7c139 - A bit more work on PharData creation/conversion.
- If readonly=0, why not $phardata->convertToPhar()?
- Known issue with directories creating 'as-file' copies within the archive (all formats)
@Greg/Marcus/Tony: This passes all tests on my box, 5.2/5.3/release_ts/debug_ts, and I can't find any more memleaks. Obviously this is too good to be true, so if conversion is still messy elsewhere please feel free to fix, or bug and assign to me.
2008-03-03 08:41:15 +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
Greg Beaver
ec7f89fe79 implement Phar::mount() for directories, add test
# opendir not yet implemented for mounted directories
2008-02-25 04:23:36 +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
Greg Beaver
f6862d4a33 fix unfreed value found in tempmanifest1.phpt 2008-02-23 19:44:51 +00:00
Greg Beaver
b3a266fca8 fix double error (this fixes frontcontroller22.phpt) 2008-02-23 19:26:18 +00:00
Steph Fox
6cc2426ff1 A much better solution for setDefaultStub(). The convertTo*() fixes should be trivial now. 2008-02-21 00:24:38 +00:00
Steph Fox
d8bebd7259 Implement $phar->setDefaultStub()
Note that Phar::createDefaultStub() still exists at this point
2008-02-20 19:22:12 +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
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
3234e78ca1 fix remaining broken tests broken by the addition of phar->fp closing 2008-02-12 05:28:06 +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
d659ce7a0c fix windows pathname issues 2008-02-11 07:33:20 +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
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
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
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
Antony Dovgal
a04bcdfcec remove old code leftover causing problems 2008-02-07 08:45:43 +00:00
Antony Dovgal
97c3dbaf56 this string should be freed later since path == free_path 2008-02-01 11:25:11 +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