dev-master
9999999-devPHP bindings for mongrel2
BSD-3
The Requires
- php >=5.3.0
- ext-zmq *
by Igor Wiedler
by Florian Anderiasch
zeromq mongrel2 mongrel
Wallogit.com
2017 © Pedro Peláez
PHP bindings for mongrel2
The recommended way to install m2php is through composer., (*1)
Just create a composer.json file for your project:, (*2)
{
"require": {
"winks/m2php": "dev-master"
}
}
And run these two commands to install it:, (*3)
$ curl -sS https://getcomposer.org/installer | php $ php composer.phar install
Now you can add the autoloader, and you will have access to the library:, (*4)
<?php require 'vendor/autoload.php';
<?php
use Mongrel2\Connection;
$sender_id = "82209006-86FF-4982-B5EA-D1E29E55D481";
$conn = new Connection($sender_id, "tcp://127.0.0.1:9997", "tcp://127.0.0.1:9996");
while (true) {
$req = $conn->recv();
if ($req->is_disconnect()) {
continue;
}
$conn->reply_http($req, 'Hello World');
}
Before running the example, you need to have composer set up an autoloader:, (*5)
$ curl -sS https://getcomposer.org/installer | php $ php composer.phar install
Now you can run the example., (*6)
$ cd example $ m2sh load $ m2sh start # in a separate shell $ php hello.php # in a separate shell or browser $ curl http://localhost:6767/hello
Before running the tests you need to have composer set up an autoloader:, (*7)
$ curl -sS https://getcomposer.org/installer | php $ php composer.phar install
Now you can run the unit tests., (*8)
$ phpunit
New BSD, see LICENSE., (*9)
PHP bindings for mongrel2
BSD-3
zeromq mongrel2 mongrel