jdomenechb/reactphp-symfony-server 问题修复 & 功能扩展

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

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

jdomenechb/reactphp-symfony-server

最新稳定版本:0.1.7

Composer 安装命令:

composer require jdomenechb/reactphp-symfony-server

包简介

ReactPHP server over Symfony framework

README 文档

README

This library wraps a ReactPHP server over a Symfony 4 project installation.

Installation (using composer)

composer require jdomenechb/reactphp-symfony-server

After running this command, be sure to define an APP_PORT environment variable prior to running the server. If the Symfony project uses DotEnv in an specific environment, it will take the value from the .env file.

Usage

From the root of your project, run:

vendor/php/reactphp-server

The server will inform of the port it is running.

FAQ

Q. How does it work?

The library takes the public/index.php file from the project root, and reads it until the point the Symfony kernel is created. Then, from this point, it takes control in order to provide the ReactPHP server.

Once executed, requests are made directly to the server and translated to Symfony requests, which are dealt then by the Symfony Kernel. The Kernel provides afterwards a response, which is translated back to a response the ReactPHP server can understand.

Q. Which versions of PHP and Symfony are supported?

PHP >= 7.1 and Symfony 4.*.

Q. Does it serve static assets too?

Yes, the library has basic support for serving static assets, like images, CSS ans JS under the public folder of your project.

However, you might consider using another web server (like Nginx or Apache) to serve them, as they are more dedicated to this matter. This library focus mainly on serving PHP requests.

Q. Can I use another web server after I install this library?

Yes, the library is prepared to not modify at all your project, so you can run another server if needed in top of your code.

Q. Will it work with all kind of Symfony installations?

Unfortunately, there is no way to assure that. The library has been tested with a public/index.php file from a Symfony 4 skeleton, and the more a public/index.php has been modified, the most likely is the library to fail.

For this reason, I strongly encourage you to contribute to the project in whatever mean you can.

Q. Can I develop or modify code while using the server?

If you do so, you might encounter that your changes are not being displayed after refreshing the page. This is due to the fact that, once a class has been loaded in memory during server execution, it will remain unchanged in the app memory.

In order to see your changes, you should restart the server.

Contributing

Feel free to contribute to the project by submitting pull requests, or by opening issues you might find. I am eager to receive your feedback and improve the quality and features of the library.

统计信息

  • 总下载量: 3.44k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-09-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固