-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dennis Hotson
committed
Jan 11, 2010
0 parents
commit 291bd2a
Showing
9 changed files
with
1,866 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
=== Http Parser extension for PHP | ||
A PHP extension for the C http parser from Ruby's Mongrel web server. | ||
|
||
=== Installation | ||
|
||
To install, you'll need an environment set up to compile PHP extensions. | ||
On Ubuntu, I think you'll need to install the php5-dev package. | ||
|
||
cd ext | ||
phpize | ||
./configure | ||
make | ||
sudo make install | ||
|
||
Also add the following to your php.ini file: | ||
|
||
extension=httpparser.so | ||
|
||
=== Usage | ||
|
||
$parser = new HttpParser(); | ||
$parser->execute("GET http://example.com/ HTTP/1.1\r\nHost: example.com\r\n\r\n", 0); | ||
var_dump($parser->getEnvironment()); | ||
|
||
.. or see simple_server.php for a better example. | ||
|
||
|
||
=== Credits | ||
|
||
The http parser is from Mongrel http://mongrel.rubyforge.org by Zed Shaw. | ||
Mongrel Web Server (Mongrel) is copyrighted free software by Zed A. Shaw | ||
<zedshaw at zedshaw dot com> You can redistribute it and/or modify it under | ||
either the terms of the GPL. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
PHP_ARG_ENABLE(httpparser, | ||
[Whether to enable the "httpparser" extension], | ||
[ --enable-httpparser Enable "httpparser" extension support]) | ||
|
||
if test $PHP_HTTPPARSER != "no"; then | ||
PHP_NEW_EXTENSION(httpparser, httpparser.c http11_parser.c, $ext_shared) | ||
fi | ||
|
Oops, something went wrong.