2017 © Pedro PelĂĄez
 

library reactphp-symfony

Bridge to use Symfony Framework with ReactPHP

image

teknoo/reactphp-symfony

Bridge to use Symfony Framework with ReactPHP

  • Tuesday, July 18, 2017
  • by frenchcomp
  • Repository
  • 3 Watchers
  • 12 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 8 Versions
  • 4 % Grown

The README.md

Teknoo Software - ReactPHP Symfony Bridge

Installation & Requirements

To install this library with composer, run this command :, (*1)

composer require react/http:dev-master
composer require teknoo/reactphp-symfony

This library requires :, (*2)

* PHP 7+
* Composer
* Symfony 3.2+
* ReactPHP 0.6+

Execution

Via the Symfony Console :, (*3)

#Env prod
bin/console reactphp:run -i 0.0.0.0 -p 8080

#End dev
bin/console reactphp:run -i 0.0.0.0 -p 8080 -e dev

Via a PHP file :, (*4)

#!/usr/bin/env php
<?php

use React\EventLoop\Factory as LoopFactory;
use React\Socket\Server as SocketServer;
use React\Http\Server as HttpServer;
use Teknoo\ReactPHPBundle\Bridge\RequestBridge;
use Teknoo\ReactPHPBundle\Bridge\RequestListener;
use Teknoo\ReactPHPBundle\Service\DatesService;
use Symfony\Bridge\PsrHttpMessage\Factory\HttpFoundationFactory;
use Symfony\Bridge\PsrHttpMessage\Factory\DiactorosFactory;

require __DIR__.'/../app/autoload.php';
if (\file_exists(__DIR__.'/../var/bootstrap.php.cache')) {
    include_once __DIR__ . '/../var/bootstrap.php.cache';
}

$kernel = new AppKernel('prod', false);
$kernel->loadClassCache();

$requestBridge = new RequestBridge(
    $kernel,
    new DatesService(),
    new HttpFoundationFactory(),
    new DiactorosFactory()
);
$requestListener = new RequestListener($requestBridge);

//React Loop
$loop = LoopFactory::create();
//Create front socket server
$socket = new SocketServer(8080, $loop);

//Enable HTTP server
$server = new HttpServer($requestListener);
$server->listen($socket);

//Start loop and so the server
$loop->run();

Credits

Richard Déloge - richarddeloge@gmail.com - Lead developer. Teknoo Software - http://teknoo.software, (*5)

About Teknoo Software

Teknoo Software is a PHP software editor, founded by Richard Déloge. Teknoo Software's DNA is simple : Provide to our partners and to the community a set of high quality services or software, sharing knowledge and skills., (*6)

License

ReactPHP Symfony Bridge is licensed under the MIT License - see the licenses folder for details, (*7)

Contribute :)

You are welcome to contribute to this project. Fork it on Github, (*8)

The Versions

04/05 2017
29/03 2017

0.0.1-alpha3

0.0.1.0-alpha3 http://teknoo.software/symfony-react

Bridge to use Symfony Framework with ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Déloge

https server http symfony reactphp

05/03 2017

0.0.1-alpha2

0.0.1.0-alpha2 http://teknoo.software/symfony-react

Bridge to use Symfony Framework with ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Déloge

https server http symfony reactphp

04/03 2017

0.0.1-alpha1

0.0.1.0-alpha1 http://teknoo.software/symfony-react

Bridge to use Symfony Framework with ReactPHP

  Sources   Download

MIT

The Requires

 

The Development Requires

by Richard Déloge

https server http symfony reactphp