/PHP-FastCGI-Client

This PHP class handles the communication with a FastCGI (FCGI) application using the FastCGI protocol and non-blocking sockets.

Primary LanguagePHP

                       _________________________
  
                       PHP FastCGI Client README
                       _________________________
                         

AUTHOR & CONTACT
================

Charron Pierrick
    - pierrick@webstart.fr

    
DOCUMENTATION & DOWNLOAD
========================

Latest version is available on github at :
    - http://github.com/adoy/PHP-FastCGI-Client/

Documentation can be found on : 
    - http://github.com/adoy/PHP-FastCGI-Client/


LICENSE
=======

This Code is released under the GNU LGPL

Please do not change the header of the file(s).

This library is free software; you can redistribute it and/or modify it 
under the terms of the GNU Lesser General Public License as published 
by the Free Software Foundation; either version 2 of the License, or 
(at your option) any later version.

This library is distributed in the hope that it will be useful, but 
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU Lesser General Public License for more details.


How can I use it ?
==================

require('fastcgi.php');

$client = new FCGIClient('localhost', '9000');
$content = 'key=value';
$client->request(
	array(       
		'GATEWAY_INTERFACE' => 'FastCGI/1.0',
		'REQUEST_METHOD' => 'POST',
		'SCRIPT_FILENAME' => 'test.php',
		'SERVER_SOFTWARE' => 'php/fcgiclient',
		'REMOTE_ADDR' => '127.0.0.1',
		'REMOTE_PORT' => '9985',
		'SERVER_ADDR' => '127.0.0.1',
		'SERVER_PORT' => '80',
		'SERVER_NAME' => 'mag-tured',
		'SERVER_PROTOCOL' => 'HTTP/1.1',
		'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
		'CONTENT_LENGTH' => strlen($content)
	),
	$content
);
echo $client->response();