Commit Graph

123 Commits

Author SHA1 Message Date
Greg Beaver
5af0cbef65 MFB: fix Bug #48257: PharData throws exception with non-phar tar 2009-05-13 20:26:18 +00:00
Greg Beaver
31f3c2ad47 MFPECL: fix PECL bug #16338, php_stream_copy_to_stream{,_ex}() 2009-04-29 03:24:09 +00:00
Sebastian Bergmann
7f4dc8702a Bump copyright year, 3 of 3. 2008-12-31 11:12:40 +00:00
Greg Beaver
c448cb165c MFB: add tests for copy-on-write support
- fix metadata handling with cached phars
 - fix virtual_dirs with rmdir
 - ensure that after copy-on-write, all existing Phar objects link to the newly copied phar data
2008-10-12 19:40:30 +00:00
Greg Beaver
a4f39f7fa4 MFB: fix bug #45907: undefined reference to PHP_SHA512Init 2008-10-09 00:51:27 +00:00
Greg Beaver
2f54ca9c7a MFB: increase code coverage, fix bzip2-compressed alias in zip 2008-09-14 06:32:52 +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
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
Steph Fox
bdca5a12b0 - MFB fix offset detection in tar files 2008-05-24 13:59:56 +00:00
Greg Beaver
11fb7561f0 enable by default statically instead of shared
this is done by removing zlib/bz2 explicit dependencies because they are unnecessary
we only ever use the stream filter, and the check for existence has
been moved to runtime where it is after startup
2008-05-17 20:07:38 +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
Greg Beaver
f134a909c3 optimize phar filename extension detection to first search through known phars. This eliminates several stat/realpath calls for archives with lots of files 2008-05-07 17:24:22 +00:00
Greg Beaver
549bf83bd1 [DOC]
remove phar.extract_list
remove Phar::getExtractList()
2008-05-07 05:38:31 +00:00
Greg Beaver
5ba8ca70a4 fix alias overloading handling for archives that are not in use 2008-05-06 21:14:53 +00:00
Greg Beaver
ab1d8adb96 fix default format conversion, increase code coverage 2008-04-23 18:44:43 +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
027180d6ee new test for bad checksum, fix tar.c to catch tar archives with a corrupted first entry, fix memleak on bad checksum 2008-04-20 17:28:54 +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
dc837b5f53 rename is_zip parameter of phar_parse_metadata to more accurately reflect what it is 2008-04-16 04:01:33 +00:00
Greg Beaver
859bd13d09 add interception for readfile [DOC] 2008-04-15 03:36:57 +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
c0d82e966f refactor compress/convertToTar/convertToPhar/convertToZip/convertToExecutable/convertToData
into 2 methods:
convertToExecutable/convertToData.  Both methods accept 3 optional parameters
1 archive type, Phar::PHAR, Phar::TAR, or Phar::ZIP
2 compression Phar::NONE, Phar::GZ, or Phar::BZ2
3 file extension.  Default is <format>.<compression> where .phar.tar is executable .tar
convertToExecutable always returns a Phar object
convertToData always returns a PharData object
also added Phar::PHAR, Phar::TAR, and Phar::ZIP class constants
[DOC]
2008-04-11 04:20:15 +00:00
Greg Beaver
b4b890cb8f check for invalid aliases, add tests for this and direct setting of stub/alias 2008-03-24 01:33:30 +00:00
Greg Beaver
95eeee9156 not all tests have been converted over to the new API, but it works
conversion is now split into 3 separate methods
1\) convertToZip\(\) convertToTar\(\) and convertToPhar\(\) exclusively change file format
2\) compress\(\) sets compression, accepting Phar::GZ, Phar::BZ2, or Phar::NONE
3\) convertToExecutable\(\) allows stub creation in tar/zip, convertToData\(\) prevents it

all methods return either Phar or PharData objects, allowing fluent interface.

only 1 test has been converted to the new format, but the API works
2008-03-23 22:42:45 +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
Steph Fox
1feb9b581a Satisfy Greg's inertia 2008-03-22 21:54:15 +00:00
Steph Fox
c0619c6523 Make versioning more standard 2008-03-22 17:09:24 +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
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
3ee08069a6 Rename archive during compressAllFiles*()
Note: this only works for tar archives at present pending a fix for bug #13352
2008-03-09 04:46:16 +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
1cdade809b Going back to square one ("it works on Scott's box" - OSX 10.5, gcc version 4.0.1 (Apple Inc. build 5465)). Thanks ScottMac, David C and Philip for testing...
Possibly a gcc version issue?
2008-03-02 00:42:29 +00:00
Steph Fox
5c2be9551b Should work on all platforms now. (Testing.) 2008-03-01 22:38:10 +00:00
Steph Fox
d4cf7e47f6 Right problem, wrong solution. Also missed an '= 1' , thanks Marcus 2008-03-01 22:28:33 +00:00
Steph Fox
f96cd8fbc3 Tested this time. All's fine here, MacOSX still complaining @ present. 2008-03-01 22:04:19 +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
a5a246e876 add missing declaration of phar_rename_archive 2008-02-24 23:40:14 +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
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
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
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
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