Skip to content

Commit 9a6ff1d

Browse files
committed
Update README.md and LICENSE
1 parent 00bf8ee commit 9a6ff1d

File tree

3 files changed

+70
-74
lines changed

3 files changed

+70
-74
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2010-2014 Pierrick Charron
1+
Copyright (c) 2010-2019 Pierrick Charron
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

README

Lines changed: 0 additions & 73 deletions
This file was deleted.

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# PHP FastCGI Client
2+
3+
[![License](https://poser.pugx.org/adoy/fastcgi-client/license)](https://packagist.org/packages/adoy/fastcgi-client)
4+
[![Latest Stable Version](https://poser.pugx.org/adoy/fastcgi-client/v/stable)](https://packagist.org/packages/adoy/fastcgi-client)
5+
[![Total Downloads](https://poser.pugx.org/adoy/fastcgi-client/downloads)](https://packagist.org/packages/adoy/fastcgi-client)
6+
7+
*PHP FastCGI Client* is a lightweight single file **FastCGI** client for PHP.
8+
9+
## How can I use it ?
10+
11+
```php
12+
<?php
13+
14+
require 'vendor/autoload.php';
15+
16+
use Adoy\FastCGI\Client;
17+
18+
// Existing socket, such as Lighttpd with mod_fastcgi:
19+
$client = new Client('unix:///path/to/php/socket', -1);
20+
21+
// Fastcgi server, such as PHP-FPM:
22+
$client = new Client('localhost', '9000');
23+
$content = 'key=value';
24+
echo $client->request(
25+
array(
26+
'GATEWAY_INTERFACE' => 'FastCGI/1.0',
27+
'REQUEST_METHOD' => 'POST',
28+
'SCRIPT_FILENAME' => 'test.php',
29+
'SERVER_SOFTWARE' => 'php/fcgiclient',
30+
'REMOTE_ADDR' => '127.0.0.1',
31+
'REMOTE_PORT' => '9985',
32+
'SERVER_ADDR' => '127.0.0.1',
33+
'SERVER_PORT' => '80',
34+
'SERVER_NAME' => 'mag-tured',
35+
'SERVER_PROTOCOL' => 'HTTP/1.1',
36+
'CONTENT_TYPE' => 'application/x-www-form-urlencoded',
37+
'CONTENT_LENGTH' => strlen($content)
38+
),
39+
$content
40+
);
41+
```
42+
43+
## Command line tool
44+
45+
Run a call through a network socket:
46+
47+
```
48+
./fcgiget.php localhost:9000/status
49+
```
50+
51+
Run a call through a Unix Domain Socket
52+
53+
```
54+
./fcgiget.php unix:/var/run/php-fpm/web.sock/status
55+
```
56+
57+
> **Note:** This command line tool is provided for debuging purpose.
58+
59+
## Authors
60+
61+
* _**[Pierrick Charron](https://github.com/adoy)** (pierrick@php.net) - Initial work_
62+
* _**[Remi Collet](https://github.com/remicollet)**_
63+
64+
## License
65+
66+
This project is licensed under the MIT License - for the full copyright and license information, please view the [LICENSE](LICENSE) file that was distributed with this source code.
67+
68+
---
69+
_Copyrights 2010-2019 Pierrick Charron Inc. All rights reserved._

0 commit comments

Comments
 (0)