GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - zybgod/swoft: Modern High performance AOP and Coroutine PHP Framework, base on Swoole 2

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

665 Commits
665 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
app
app
 
 
bin
bin
 
 
config
config
 
 
public
public
 
 
resources
resources
 
 
runtime
runtime
 
 
test
test
 
 
.editorconfig
.editorconfig
 
 
.env.example
.env.example
 
 
.gitignore
.gitignore
 
 
.php_cs
.php_cs
 
 
.travis.yml
.travis.yml
 
 
Dockerfile
Dockerfile
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
changelog.md
changelog.md
 
 
composer.json
composer.json
 
 
docker-compose.yml
docker-compose.yml
 
 
phpunit.xml
phpunit.xml
 
 

Repository files navigation

    swoft

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

简介

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

  • 基于 Swoole 扩展
  • 内置协程网络服务器
  • 强大的 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.0.12 +, 需开启协程和异步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

# 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 bin]# php swoft -h
 ____                __ _
/ ___|_      _____  / _| |_
\___ \ \ /\ / / _ \| |_| __|
 ___) \ V  V / (_) |  _| |_
|____/ \_/\_/ \___/|_|  \__|

Usage:
  php swoft -h

Commands:
  entity  the group command list of database entity
  rpc     the group command list of rpc server
  server  the group command list of http-server

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

HTTP启动

是否同时启动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

RPC启动

启动独立的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

About

Modern High performance AOP and Coroutine PHP Framework, base on Swoole 2

www.swoft.org

Resources

Readme
License
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.