Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennis Hotson committed Jan 11, 2010
0 parents commit 291bd2a
Showing 9 changed files with 1,866 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README
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.

8 changes: 8 additions & 0 deletions ext/config.m4
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

Loading

0 comments on commit 291bd2a

Please sign in to comment.