Download the PHP package bingcool/swoolefy without Composer

On this page you can find all versions of the php package bingcool/swoolefy. 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 swoolefy

swoolefy

一、简介

swoolefy是一个基于swoole实现的轻量级高性能的常驻内存型的协程级应用服务框架, 高度支持httpApi,websocket,udp服务器,以及基于tcp实现可扩展的rpc服务,worker多进程消费模型
同时支持composer包方式安装部署项目。基于实用主义设计出发,swoolefy抽象Event事件处理类, 实现与底层的回调的解耦,支持协程单例调度,同步|异步调用,全局事件注册,心跳检查,异步任务,多进程(池),连接池等, 内置等常用组件等.

二、建议版本

1、swoolefy-6.x.x 版本:
目前主分支,最低要求

2、swoolefy-4.8-lts 版本:
长期维护分支,最低要求

选择哪个版本?
1、如果确定项目是使用php81+的,那么直接选择 安装,然后选择 作为项目分支安装最新稳定版本

2、如果确定项目是使用 的,那么选择 swoole-v4.8+ 版本来进行编译安装(不能直接使用 swoole-cli-v4.8+ 了, 因为其内置的是php8.1,与你的项目的php7不符合) 所有只能通过编译swoole源码的方式来生成swoole扩展,然后选择 作为项目分支稳定版本

3、依赖编译: ./configure --enable-openssl --enable-sockets --enable-swoole-curl --enable-swoole-pgsql

4、若不希望自己编译构建,也可以直接使用本目录下的Dockerfile来构建镜像:

三、实现的功能特性

基础特性

高级特性

四、适配协程环境组件

组件名称 安装 说明
predis composer require predis/predis:~1.1.7 predis组件、或者Phpredis扩展
mongodb composer require mongodb/mongodb:~1.3 mongodb组件,需要使用mongodb必须安装此组件
rpc-client composer require bingcool/rpc-client:dev-master swoolefy的rpc客户端组件,当与rpc服务端通信时,需要安装此组件,支持在php-fpm中使用
cron-expression composer require dragonmantank/cron-expression:~3.3.0 crontab计划任务组件,类似Linux的crobtab
redis lock composer require malkusch/lock Redis锁组件
amqp composer require php-amqplib/php-amqplib:~3.5.0 amqp php原生实现amqp协议客户端
ffmpeg composer require php-ffmpeg/php-ffmpeg:~1.1.0 php proc-open 调用ffmpeg处理音视频
validate composer require vlucas/valitron validate数据校验组件
guzzlehttp composer require guzzlehttp/guzzle guzzlehttp 组件
oauth 2.0 composer require league/oauth2-server oauth 2.0 授权认证组件
bingcool/library composer require bingcool/library library组件库

五、bingcool/library 是swoolefy require 内置库,专为swoole协程实现的组件库

实现了包括:

github: https://github.com/bingcool/library

六、安装

1、先配置环境变量(必须设置)

2、创建项目

七、添加项目入口启动文件cli.php,并定义你的项目目录,命名为App

八、执行创建你定义的App项目

九、启动http应用项目

十、访问

默认端口是9502,可以通过 http://localhost:9502 访问默认控制器

至此一个最简单的http的服务就创建完成了,更多例子请参考项目下Test的demo

十一、定义组件

1、应用层配置文件:Config/app.php

2、组件Component.php

十二、使用组件

十三、默认协议层全局配置文件 Protocol/conf.php

开发者可以根据实际使用适当调整配置项

十四、路由文件(类似laravel路由)

1、Router/api.php

十五、数据库操作

十六、协程单例,协程并发

  1. 协程单例

  2. 协程并发

十七、swagger接口文档生成

在Test/Module/Order/Validation下,每个文件对应一个Controller的方法,可以使用php8的attribute注解定义好接口,然后执行 php swag.php Test 即可自动生成openapi.yaml文件 在浏览器直接访问: http:127.0.0.1:9501/swagger.html

License

MIT
Copyright (c) 2017-2025 zengbing huang


All versions of swoolefy with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-swoole Version >=5.1.0
ext-json Version *
ext-curl Version *
psr/log Version *
ext-pcntl Version *
ext-posix Version *
ext-pdo Version *
ext-redis Version *
ext-sockets Version *
ext-mbstring Version *
ext-openssl Version *
dragonmantank/cron-expression Version ~3.3.3
vlucas/phpdotenv Version ~5.6
symfony/console Version ~6.4.2
symfony/translation Version 6.4.x-dev
zircote/swagger-php Version 4.8.7
bingcool/library Version dev-master
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 bingcool/swoolefy contains the following files

Loading the files please wait ....