Swoft is a new era PHP framework based on Swoole and PHP 7.1+, which is:

Fully resident memory running

Full coroutine processing request logic

Reduce application configuration based on annotations

Built-in database connection pool

Also supported as Http, WebSocket, RPC server

GitHub

Resident memory

Resident Memory Lets the application not have to load the parsing file every time it requests, and directly enters the logical processing and scheduling process to improve the performance of the application.

Full coroutine operation

Unlike the traditional PHP-FPM framework, in Swoft, the request logic is processed in a full coroutine environment (like Golang), scheduling IO operations, and your application can easily increase processing power by more than 10 times.

Based on annotations

Swoft provides annotations to quickly configure object instances (we call them Beans), register routes, listen for events, etc. You can run a Swoft application without having to configure too many things.

Everything is automatic, swoft will automatically scan and collect annotation information, automatically configure the corresponding classes, and create their instances in advance into the IOC container. You can easily get the objects you need from the container and use them.

<?php declare(strict_types=1); namespace App\Http\Controller; Use Swoft\Http\Server\Annotation\Mapping\Controller;

Use Swoft\Http\Server\Annotation\Mapping\RequestMapping; /**

* @Controller()

*/

Class SiteController

{

/**

* @RequestMapping(route="index")

*/

public function index(): string

{

return 'hello, welcome!';

}

}

OK, no need to do anything, restart server. access http://127.0.0.1:18306/site/index will see: hello, welcome!

Built-in connection pool

Swoft has built-in connection pooling feature, which makes it very convenient for you to use database, redis. And in the use of a highly compatible community-famous framework Laravel. You don’t have to worry about connection usage, Swoft will automatically connect to db and reclaim the connection after use.

Using PHP

PHP-based coroutine extensions Swoole, you can enjoy the huge resources of the PHP community, you do not need to learn to learn new languages in order to improve application performance. With a little learning, you can migrate your app to swoft and easily get a performance boost of 10x times over the original program.

Http & WebSocket & RPC

Swoft is more than just an HTTP application framework, it also supports you very well in developing WebSocket applications. And with built-in support for RPC servers, you can use Swoft to build large applications with great ease.

More Features

Built-in high performance network server(Http/WebSocket/RPC/TCP)

Flexible componentization

Flexible annotation function

Diversified command terminal(Console)

Powerful Aspect Oriented Programming（AOP）

Perfect Container management, Dependency Injection(DI) based on PSR-11

Flexible event mechanism

Implementation of HTTP message based on PSR-7

Event Manager Based on PSR-14

Middleware based on PSR-15

Internationalization(i18n) support

Simple and efficient parameter validator

High performance connection pool(Mysql/Redis/RPC)，Automatic reconnection

Database is highly compatible Laravel

Cache Redis highly compatible Laravel

Efficient task processing

Flexible exception handling

Powerful log system

Please star swoft by Github

Core Components

Extension Components

Resources