All Projects → limingxinleo → swoft-project

limingxinleo / swoft-project

Licence: Apache-2.0 license
基于Swoft的项目结构

Programming Languages

PHP
23972 projects - #3 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to swoft-project

swoft-ddz
基于swoft框架开发斗地主
Stars: ✭ 70 (+311.76%)
Mutual labels:  swoole, swoft
swoole-ide-helper
💪 IDE helper for Swoft and Swoole
Stars: ✭ 42 (+147.06%)
Mutual labels:  swoole, swoft
made-in-cameroon
A curated list of awesome tools and projects built by Cameroonian developers
Stars: ✭ 14 (-17.65%)
Mutual labels:  project
github-project-todo-md
A Tool that sync between GitHub Project Board <-> Todo Markdown text.
Stars: ✭ 17 (+0%)
Mutual labels:  project
slim-swoole
Slim 3 MVC Skeleton With Swoole
Stars: ✭ 52 (+205.88%)
Mutual labels:  swoole
sdebug
Xdebug — Step Debugger and Debugging Aid for PHP
Stars: ✭ 263 (+1447.06%)
Mutual labels:  swoole
tidyweek
Repo dedicated to #tidyweek & Mentorship pilot
Stars: ✭ 25 (+47.06%)
Mutual labels:  project
Self-Driving-Car-Steering-Simulator
The aim of this project is to allow a self driving car to steer autonomously in a virtual environment.
Stars: ✭ 15 (-11.76%)
Mutual labels:  project
ChatRoom
一个在线聊天室demo,基于PHP SWOOLE,需要SWOOLE拓展的支持
Stars: ✭ 26 (+52.94%)
Mutual labels:  swoole
swoole mqtt
一个基于swoole的异步mqtt 客户端库,可用于接收或者发送mqtt协议的消息。支持QoS 0、QoS 1、QoS 2。支持MQTT 3.1和3.1.1版本。 参考workerman-mqtt
Stars: ✭ 41 (+141.18%)
Mutual labels:  swoole
ATtiny13-TinySolder
T12 Quick Heating Soldering Station
Stars: ✭ 45 (+164.71%)
Mutual labels:  project
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+723.53%)
Mutual labels:  project
yafcms
基于yaf+swoole的高效率,快如闪电的博客cms系统!
Stars: ✭ 17 (+0%)
Mutual labels:  swoole
swoole-demo
This is a simple swoole usage demo
Stars: ✭ 26 (+52.94%)
Mutual labels:  swoole
Awesome Python Scripts
🚀 Curated collection of Awesome Python Scripts which will make you go wow. Dive into this world of 360+ scripts. Feel free to contribute. Show your support by ✨this repository.
Stars: ✭ 198 (+1064.71%)
Mutual labels:  project
mcnp
📊复杂网络建模课程设计. The project of modeling of complex networks course.
Stars: ✭ 69 (+305.88%)
Mutual labels:  project
node-js-project-structure
No description or website provided.
Stars: ✭ 21 (+23.53%)
Mutual labels:  project
destructible terrain demo
A simple demo on how to create destructible terrain on Godot.
Stars: ✭ 23 (+35.29%)
Mutual labels:  project
laravel-binlog
Add mysql binlog event listening for Laravel ( 为Laravel框架添加Mysql Binlog事件监听 )
Stars: ✭ 19 (+11.76%)
Mutual labels:  swoole
IoT
A repository dedicated to IoT(internet of things ) and python scripts
Stars: ✭ 24 (+41.18%)
Mutual labels:  project

    swoft

Latest Version Build Status Build Status Php Version Swoole Version Hiredis Version Swoft Doc Swoft License

简介

首个基于 Swoole 原生协程的新时代 PHP 高性能协程全栈组件化框架,内置协程网络服务器及常用的协程客户端,常驻内存,不依赖传统的 PHP-FPM,全异步非阻塞 IO 实现,以类似于同步客户端的写法实现异步客户端的使用,没有复杂的异步回调,没有繁琐的 yield,有类似 Go 语言的协程、灵活的注解、强大的全局依赖注入容器、完善的服务治理、灵活强大的 AOP、标准的 PSR 规范实现等等,可以用于构建高性能的Web系统、API、中间件、基础服务等等。

  • 基于 Swoole 扩展
  • 内置协程 HTTP, TCP, WebSocket 网络服务器
  • 强大的 AOP (面向切面编程)
  • 灵活完善的注解功能
  • 全局的依赖注入容器
  • 基于 PSR-7 的 HTTP 消息实现
  • 基于 PSR-14 的事件管理器
  • 基于 PSR-15 的中间件
  • 基于 PSR-16 的缓存设计
  • 可扩展的高性能 RPC
  • 完善的服务治理,熔断,降级,负载,注册与发现
  • 数据库 ORM
  • 通用连接池
  • 协程 Mysql, Redis, RPC, HTTP 客户端
  • 协程和同步阻塞客户端无缝自动切换
  • 协程、异步任务投递
  • 自定义用户进程
  • RESTful 支持
  • 国际化(i18n)支持
  • 高性能路由
  • 快速灵活的参数验证器
  • 别名机制
  • 强大的日志系统
  • 跨平台热更新自动 Reload

文档

中文文档

QQ 交流群: 548173319

环境要求

  1. PHP 7.0 +
  2. Swoole 2.1.1 +, 需开启协程和异步Redis
  3. Hiredis
  4. Composer

安装

手动安装

  • Clone 项目
  • 安装依赖 composer install

Composer 安装

  • composer create-project swoft/swoft swoft

Docker 安装

  • docker run -p 80:80 swoft/swoft

Docker-Compose 安装

  • cd swoft
  • docker-compose up

配置

若在执行 composer install 的时候由程序自动复制环境变量配置文件失败,则可手动复制项目根目录的 .env.example 并命名为 .env,注意在执行 composer update 时并不会触发相关的复制操作

# Server
PFILE=/tmp/swoft.pid
PNAME=php-swoft
TCPABLE=true
CRONABLE=false
AUTO_RELOAD=true

# HTTP
HTTP_HOST=0.0.0.0
HTTP_PORT=80

# WebSocket
WS_ENABLE_HTTP=true

# TCP
TCP_HOST=0.0.0.0
TCP_PORT=8099
TCP_PACKAGE_MAX_LENGTH=2048
TCP_OPEN_EOF_CHECK=false

# Crontab
CRONTAB_TASK_COUNT=1024
CRONTAB_TASK_QUEUE=2048

# Settings
WORKER_NUM=1
MAX_REQUEST=10000
DAEMONIZE=0
DISPATCH_MODE=2
LOG_FILE=@runtime/swoole.log
TASK_WORKER_NUM=1

管理

帮助命令

[root@swoft]# php bin/swoft -h
 ____                __ _
/ ___|_      _____  / _| |_
\___ \ \ /\ / / _ \| |_| __|
 ___) \ V  V / (_) |  _| |_
|____/ \_/\_/ \___/|_|  \__|

Usage:
  php bin/swoft {command} [arguments ...] [options ...]

Commands:
  entity  The group command list of database entity
  gen     Generate some common application template classes
  rpc     The group command list of rpc server
  server  The group command list of http-server
  ws      There some commands for manage the webSocket server

Options:
  -v, --version  show version
  -h, --help     show help

HTTP Server启动

是否同时启动RPC服务器取决于.env文件配置

// 启动服务,根据 .env 配置决定是否是守护进程
php bin/swoft start

// 守护进程启动,覆盖 .env 守护进程(DAEMONIZE)的配置
php bin/swoft start -d

// 重启
php bin/swoft restart

// 重新加载
php bin/swoft reload

// 关闭服务
php bin/swoft stop

WebSocket Server启动

启动WebSocket服务器,可选是否同时支持http处理

// 启动服务,根据 .env 配置决定是否是守护进程
php bin/swoft ws:start

// 守护进程启动,覆盖 .env 守护进程(DAEMONIZE)的配置
php bin/swoft ws:start -d

// 重启
php bin/swoft ws:restart

// 重新加载
php bin/swoft ws:reload

// 关闭服务
php bin/swoft ws:stop

RPC Server启动

启动独立的RPC服务器

// 启动服务,根据 .env 配置决定是否是守护进程
php bin/swoft rpc:start

// 守护进程启动,覆盖 .env 守护进程(DAEMONIZE)的配置
php bin/swoft rpc:start -d

// 重启
php bin/swoft rpc:restart

// 重新加载
php bin/swoft rpc:reload

// 关闭服务
php bin/swoft rpc:stop

更新日志

更新日志

协议

Swoft 的开源协议为 Apache-2.0,详情参见LICENSE

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].