Download the PHP package feehi/yii2-swoole without Composer

On this page you can find all versions of the php package feehi/yii2-swoole. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package yii2-swoole

yii2 swoole

让yii2运行在swoole上,不用修改一句代码。

演示站点

可以参考cms系统FeehiCMS

前置说明

  1. 有yii2-advanced-app的使用经验
  2. 了解并使用过swoole, 如果没有请先阅读swoole的doc
  3. 强烈建议先按照这篇文章阅读并实践理解yii2和swoole结合的两种方式 https://www.jianshu.com/p/9c2788ccf3c0
  4. 当你做完123 并且使用过yii2-swoole之后 可以去了解一下swoft 对比一下为协程而设计的框架和yii2这种的区别

安装

  1. 使用composer composer的安装以及国内镜像设置请点击此处

配置yii2

打开console/config/main.php,在顶层配置中加入如下配置。(注意:并不是配置在components里面,而应该在最外层,即与components同级)。完整示例

启动命令

* 启动 /path/to/php /path/to/yii swoole-backend/start
* 关闭 /path/to/php /path/to/yii swoole-backend/stop
* 重启 /path/to/php /path/to/yii swoole-backend/restart

使用systemd管理yii2-swoole的启动关闭

像管理apache一样使用service httpd start和service httpd stop以及service httpd restart来启动、关闭、重启yii2 swoole服务了。

1. 复制feehi.service和feehi-backend.service到/etc/systemd/system目录
2. 分别修改feehi.service和feehi-backend.service中[Service]部分的 /path/to/yii2app为你的目录,/path/to/php为你的php命令绝对路径
3. 运行systemctl daemon-reload

加入开机自动启动


方法一

    1. 使用systemd管理服务
    2. 运行systemctl enable feehi以及systemctl enable feehi-backend设置开机自动启动

方法二

    在/etc/rc.local中加入
    /path/to/php /path/to/yii2app/yii swoole-backend/start

Nginx配置

虽然swoole从1.9.17版本以后底层支持作为静态资源web服务器,但毕竟没有完全实现http协议,强烈推荐配合nginx使用,把swoole仅作为应用服务器。

调试

debug

   var_dump、echo都是输出到控制台,不方便调试。可以使用\feehi\swoole\Util::dump(),输出数组、对象、字符串、布尔值到浏览器

log

   已经修复
   关于logger为何要替换的原因参见这篇文章详解: https://zguoqiang.com/2018/12/17/swoole%E5%9F%BA%E7%A1%80-%E4%B8%8E%E4%BC%A0%E7%BB%9FMVC%E6%A1%86%E6%9E%B6%E7%9A%84%E6%95%B4%E5%90%88/

All versions of yii2-swoole with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package feehi/yii2-swoole contains the following files

Loading the files please wait ....