itscaro/react-bundle 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

itscaro/react-bundle

最新稳定版本:1.1.0

Composer 安装命令:

composer require itscaro/react-bundle

包简介

ReactPHP Bundle for Symfony2

README 文档

README

Run Symfony apps under React-PHP.

This module adds enable the usage of ReactPHP server for Symfony.

No configuration is needed. Follow the Installation instructions and read Usage section to know how to start using ReactPHP with your Symfony APP.

Installation

Composer

To install the bundle through Composer, run the following command in console at your project base path:

php composer.phar require itscaro/react-bundle

Register bundle

Then register the new bundle in your AppKernel.

<?php
    
    // #app/AppKernel.php
    $bundles = array(
        ...
        new Itscaro\ReactBundle\JogaramReactBundle(),
        ...
    );
    

Usage

To start using ReactPHP with Symfony, open console, go to your project root path and execute the following command:

php app/console react:server:run --standalone

Available options

--host=127.0.0.1 Selects IP to run server at. Defaults to 127.0.0.1. --port=1337 Selects port to run server at, use comma to separate ports. Defaults to 1337. --standalone If passed, React server will serve static files directly. (Use this if you don`t have Apache or Nginx running in you local machine. Static file serving is not designed for production environments) --cache If passed, class loader will be enabled. --apc If passed, APC class loader will be enabled. This option requires --cache option. --sessionleader Available for background server, promote the forked process to be session leader

Background server

  • To start the server execute the following:
php app/console react:server:start
  • To stop the server, run:
php app/console react:server:stop

Note: If host and port are specified when starting the server, they must be specified for the stop command.

  • To restart the server:
php app/console react:server:restart

Using with web server as load balancer

Apache

<Proxy balancer://mycluster>
BalancerMember http://<ip:port of ReactPHP server>
BalancerMember http://<ip:port of ReactPHP server>
</Proxy>
ProxyPass / balancer://mycluster

Apache Document

Nginx

http {
    upstream mycluster {
        server <ip:port of ReactPHP server>;
        server <ip:port of ReactPHP server>;
    }

    server {
        listen 80;

        location / {
            proxy_pass http://mycluster;
        }
    }
}

Nginx Document

Credits

Blackshawk

统计信息

  • 总下载量: 287
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: CSS

其他信息

  • 授权协议: proprietary
  • 更新时间: 2015-10-12