Commit Graph

673 Commits

Author SHA1 Message Date
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
Marcus Boerger
d339ebc10f - WS 2007-11-23 13:50:20 +00:00
Greg Beaver
2d13f86703 MFB fixes to phar.phar 2007-11-23 05:51:59 +00:00
Greg Beaver
b21f49c7c7 MFB fixes for tests 2007-11-22 05:47:28 +00:00
Marcus Boerger
5be76b1a85 - Add phar.phar to package 2007-11-20 15:55:37 +00:00
Greg Beaver
43c7e6fa3b fix faulty logic on verification of phar 2007-11-20 05:34:35 +00:00
Greg Beaver
be023d6f62 much better fix for the problem of phar://c:\path\to\blah.phar
don't use php_parse_url() at all, and always unixify paths on copied strings.
our modification was modifying the zval original string, so a user would pass in
phar://c:\path\to\blah.phar

and their string would change to phar://c:/path/to/blah.phar - bad.

Now using

include 'phar://' . __FILE__ . '/index.php';

works on both unix and windows seamlessly, as well as $a = new Phar(__FILE__)

for use in the loader stub
2007-11-19 23:10:05 +00:00
Greg Beaver
a9af692645 make phar use this build's PHP instead of global PHP [gopal] 2007-11-17 05:50:00 +00:00
Greg Beaver
9d7d44d60c typo 2007-11-16 04:17:37 +00:00
Greg Beaver
4a86b3d6ea Ensure that the same phar can be referenced in multiple logical ways:
1) full path, with \ or / path separator
2) relative path to getcwd()

This should fix the last remaining windows-related quirks as well as similar problems
on unix
2007-11-15 05:21:11 +00:00
Greg Beaver
999961f080 begin win32 fixes for Phar object - still have a problem I can't track down yet, but it's only a matter of time before it is killed too
when passing in a full path with drive letter to the Phar object, we were
then passing "phar://C:/path/to/blah.phar" to php_parse_url(), which
thinks it is getting a valid url scheme "phar", host "C" path "/path/to/blah.phar"

we now pass "phar:///C:/path/to/blah.phar" to make it fail, and then properly
parse the url inside phar
2007-11-13 05:57:14 +00:00
Marcus Boerger
0e83c5c37a - fix more variable stuff 2007-11-06 14:49:15 +00:00
Marcus Boerger
74fe7a1e20 - fix tests 2007-11-06 14:47:11 +00:00
Greg Beaver
6d98d843af fix TSRM, a couple of compile warnings on windows, and test 2007-10-18 19:47:24 +00:00
Greg Beaver
eb67969b73 fix Bug #12124: Phar object cannot be iterated over
remove unused variables
fix jit file open sprintf calls
2007-10-04 03:33:21 +00:00
Greg Beaver
07c509935c fix phar to work with PHP 5.3 2007-10-04 02:24:49 +00:00
Greg Beaver
33347b19f2 when opening an internal file read-only, recycle the phar archive's fp. This makes phar twice as fast (2.21x according to callgrind) 2007-08-30 02:30:16 +00:00
Greg Beaver
ccb840fb92 add missing /* }}} */ 2007-08-25 01:36:21 +00:00
Greg Beaver
543ad01efd move to 1.3.0 development
add Phar::delete()
2007-08-25 01:32:35 +00:00
Greg Beaver
0a13146bbe prepare release 2007-08-25 01:04:49 +00:00
Greg Beaver
5178a94545 add test for pre-existing alias failure, fix source to fail if alias already exists 2007-08-23 23:23:26 +00:00
Greg Beaver
0bd0d85673 implement Phar->setAlias() 2007-08-23 04:49:39 +00:00
Greg Beaver
5d8919938d fix issue with large number of open file handles killing php with large phars on creation
- close file handles that have no references for entries
- add just-in-time re-processing of file handles
- make sure file size is set in renaming
- add old_flags to phar_entry_info so we can decompress when flushing a modified entry whose fp is closed
2007-08-17 04:47:50 +00:00
Greg Beaver
a7d7b956f9 fix dump_entry 2007-08-17 04:46:04 +00:00
Greg Beaver
c6fee51126 add dump_entry 2007-08-16 19:56:02 +00:00
Greg Beaver
d43eaabd1e add docs 2007-08-15 23:37:13 +00:00
Greg Beaver
417b2cfb5e make pharglobals hidden func 2007-08-15 23:35:27 +00:00
Greg Beaver
2211e8e14f add fp and refcount display 2007-08-15 23:34:37 +00:00
Greg Beaver
46db4d3f65 add helper functions for gdb debugging phar reference counting (needs more work, but a good start) 2007-08-15 03:49:44 +00:00
Greg Beaver
d3426be1c3 fix several mis-spelled 'temporary's add missing space in comment, and change 'script end' to 'stub end' in manifest read error messages 2007-06-01 03:48:17 +00:00
Marcus Boerger
7ecc0f7fad - Fix memory issue 2007-05-31 06:55:14 +00:00
Marcus Boerger
177af83fa9 - Add -p to stub-set command 2007-05-30 17:25:41 +00:00
Marcus Boerger
afb43b7110 - Need to readd this but do it as a echo 2007-05-30 17:13:17 +00:00
Marcus Boerger
6dc9be0590 - Minor fix 2007-05-30 17:00:06 +00:00
Marcus Boerger
6b8f480c45 - This is not needed here 2007-05-30 16:50:22 +00:00
Marcus Boerger
bd93265e8f - Skip precommand 'phar.php' and keep a pre-built phar.phar in cvs 2007-05-30 16:45:23 +00:00
Marcus Boerger
4098ac4c25 - Fix test 2007-05-29 09:13:57 +00:00
Marcus Boerger
490e076b22 - Improve header of pharcommand 2007-05-29 09:08:41 +00:00
Marcus Boerger
387c82fc87 - Precise dependencies 2007-05-29 08:50:17 +00:00
Marcus Boerger
3a21fe9ab3 - Add make target for precommand 2007-05-28 21:20:06 +00:00
Marcus Boerger
7c9d3a5745 - Provide ascriptto build phar.php from phar directory
- Fix minor issues
- Make pack -p also add phar/phar.incto the generated package
2007-05-28 21:13:58 +00:00
Marcus Boerger
38bb8cb5af - Fix invalid efree() call 2007-05-28 21:04:42 +00:00
Marcus Boerger
17feef6b6c - Turn the loader into a stream wrapper if necessary 2007-05-28 19:04:08 +00:00
Marcus Boerger
511bd55758 - Make compatible with PEAR/PHP_Archive CVS 2007-05-28 18:07:49 +00:00
Marcus Boerger
c5bf6e8cc4 - Add 'Stub-size' to info command 2007-05-28 16:00:41 +00:00
Marcus Boerger
57c5921389 - Oops 2007-05-28 15:58:21 +00:00
Marcus Boerger
f1faa5d558 - It is more unlikely to be looking for files named '0' or '1' and those
are also quite intuitive if seeing them as return value of the search.
2007-05-28 15:52:36 +00:00
Marcus Boerger
287bb49cc8 - Actually allow pack -p optional for precommand 2007-05-28 15:38:29 +00:00
Marcus Boerger
90fa848671 - Notice about missing class file when using pack -p optional 2007-05-28 15:32:21 +00:00
Marcus Boerger
0dd84bb275 - Notice about missing class file when using pack -p optional 2007-05-28 15:26:26 +00:00
Marcus Boerger
a8f99022ef - WS 2007-05-28 15:21:53 +00:00
Marcus Boerger
54c83b037c - Implement auto/optional for pack -p 2007-05-28 15:20:31 +00:00
Marcus Boerger
79a4814f0e - Add target pharcmd as shortcut for ...phar.phar 2007-05-28 10:09:44 +00:00
Marcus Boerger
72b487894f - Update 2007-05-27 16:58:23 +00:00
Marcus Boerger
096e123f2d - Verify stub
- Automatically cut off stub after __HALT_COMPILER();
- Always write longest stub ending, so there is no issue with length field
- Add test for setStub from file
- Fix tests
2007-05-27 16:54:37 +00:00
Marcus Boerger
1ffeecf6fa - Update 2007-05-27 15:50:23 +00:00
Marcus Boerger
ac05df4759 - For errors "internal corruption of phar ... (truncated manifest)" be more
precise about reason of failure, seperating all error strings
- Fix issue with writing compressed entries
- Fix issue with uncompressing entries
2007-05-27 15:47:52 +00:00
Marcus Boerger
4518f74102 - Fix stub file 2007-05-25 09:33:54 +00:00
Marcus Boerger
b2a18cc7db - Type was meant to be named typ on purpose - change back 2007-05-24 22:07:45 +00:00
David Coallier
0a38b81885 - Fixed few bugs
- Made sure that the word type[s] is correctly written and not typ*
2007-05-24 08:42:23 +00:00
David Coallier
147390b2d2 -- Added the cli_cmd_inf_meta_del function back in. 2007-05-24 08:40:40 +00:00
David Coallier
ca5eae898b - Added comments to each functions
- Fixed all the typ[s]*_ to type[s]*_
2007-05-24 08:36:13 +00:00