Commit Graph

68 Commits

Author SHA1 Message Date
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
44cb95a53d MFB: fix reading links from streams (works with PharFileInfo->getContent()) 2008-10-11 22:12:18 +00:00
Greg Beaver
a4f39f7fa4 MFB: fix bug #45907: undefined reference to PHP_SHA512Init 2008-10-09 00:51:27 +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
Greg Beaver
a32388a9dc MFB: fix Bug #46060: addEmptyDir() breaks 2008-09-13 20:57:15 +00:00
Greg Beaver
a2fdf4bbcc remove weird relic of development past that somehow made it in here on the last commit 2008-09-11 03:33:10 +00:00
Greg Beaver
6391270b85 MFPHP5: fix Bug #46032: PharData::__construct wrong memory read 2008-09-11 03:29:42 +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
Steph Fox
76a9ec377b - MFB major fixes
* found felipe's segfault in util.c and fixed the segfault (3 tests fail due to odd behavior of . and .. on this machine)
   * fixed serious flaws in the setting/resetting of is_data - now it works properly.  Assume
     all new PharData are tar-based, and allow passing Phar::ZIP to PharData constructor to override this
   * fix broken earlier commit, introduced segfault that broke 20 tests here
2008-05-24 14:18:31 +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
82dc03941a fix weird alias issues, add tests to check for new-found problems 2008-05-12 20:42:07 +00:00
Greg Beaver
51a1d6a3b7 increase code coverage in util.c 2008-05-12 00:43:11 +00:00
Greg Beaver
24efbb759b simplify phar_get_link_location and increase its coverage to 100% 2008-05-11 23:03:56 +00:00
Greg Beaver
70d0a4c045 increase code coverage and fix tiny bug in handling of absolute links 2008-05-11 22:59:16 +00:00
Greg Beaver
38d5943ee6 increase code coverage of funcinterceptors to 90%+, fix many bugs, fix errant wrong test condition in fgc_edgecases 2008-05-11 19:17:51 +00:00
Greg Beaver
a919e2f858 fix serious logic error and potential security issue with phar_compiled_file and
phar_find_in_include_path.  We were allowing data-based phars to be executed, and actually marking phar-based phar archives
without '.phar' in the name as data-based phars, which would allow modifying them even if phar.readonly=0.  Add test for this sinister case
2008-05-08 00:49:37 +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
2b8a56779b fix cwd test in php 5.2, now all tests pass in 5.2 on unix 2008-04-30 23:06:57 +00:00
Greg Beaver
d16f86f528 fix Bug #13786 on unix (Steph can you verify?) 2008-04-30 22:16:25 +00:00
Greg Beaver
5f4c42d301 fix double free 2008-04-30 20:17:27 +00:00
Greg Beaver
fbb2e8ce60 more fixes for PHAR_G(cwd) 2008-04-28 06:03:33 +00:00
Greg Beaver
62f824b6e1 fix crash (this area really needs code coverage) 2008-04-28 04:38:07 +00:00
Greg Beaver
c5fc383cb7 finish code coverage work (whew) 2008-04-26 05:28:56 +00:00
Steph Fox
9bf8d7429e - implemented Phar::buildFromDirectory
@Greg: There are two (identical) recurring memleaks I can't seem to kill, both marked FIXME. Would you please take a look?

[DOC] $phar->buildFromDirectory(dirname[, regex]). Return value is an array pairing each file in the archive index with the original path on the filesystem.
2008-04-25 21:37:41 +00:00
Greg Beaver
2bf5042d74 finish code coverage testing of phar_object.c (except for iterator building, which Steph is doing) and fix segfault in error message for directory getcontent if it is a temp directory 2008-04-25 16:10:59 +00:00
Steph Fox
28459132cb - Fix Windows build 2008-04-24 16:03:40 +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
26e10f8cca fix compression zip tests 2008-04-16 20:26:22 +00:00
Greg Beaver
eb252c5c92 fix potential segfault if some idiot tries to remove the root directory of a phar, add creation of root directory to test 2008-04-14 16:26:01 +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
abfc228f36 add addFile/addFromString/addEmptyDir. API is identical to ext/zip
[DOC]
2008-04-09 19:23:31 +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
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
Greg Beaver
01e5bbbaf5 fix memleak in php 5.2, simplify code slightly 2008-03-22 21:54:55 +00:00
Marcus Boerger
f022bca16b - Fix build for PHP < 5.3 2008-03-22 16:33:33 +00:00
Greg Beaver
891067c975 fix the memleak - but this breaks the \*compressAllFiles\*() methods because of fatal flaw
in renaming implementation - see pecl-dev email for details
2008-03-21 19:54:07 +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
Greg Beaver
70e30449bb fix leaked var, fixes all tests for me 2008-03-12 03:12:35 +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
66d3abac02 Untested. Killing remaining warnings under MacOSX (thanks again Philip). 2008-03-01 21:44:32 +00:00
Steph Fox
15fefd3692 All tests pass here now. Thanks Philip for reporting compiler errors that don't show on my setup. 2008-03-01 21:31:03 +00:00
Steph Fox
9e61358eda Allow alias for phar.tar/phar.zip 2008-02-28 01:08:34 +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
1a3bf3619f Leftover from experimenting with zend_hash_del... 2008-02-25 11:37:08 +00:00