What is Swoft?
Swoft is a PHP microservices coroutine framework based on the Swoole extension. Like Go, Swoft has a built-in coroutine web server and a common coroutine client and is resident in memory, independent of traditional PHP-FPM. There are similar Go language operations, similar to the Spring Cloud framework flexible annotations, powerful global dependency injection container, comprehensive service governance, flexible and powerful AOP, standard PSR specification implementation and so on.
Through three years of accumulation and direction exploration, Swoft has made Swoft the Spring Cloud in the PHP world, which is the best choice for PHP's high-performance framework and microservices management.
Swoft has entered the official 2.0 version from this version.
We have made a lot of improvements and optimizations in this version, and the http server has better performance. It also fixes the bugs left over from the previous ones.
Two new development tools have been added and improved for developers to use:
swoft/swoole-trackercan help developers resolve link tracking, memory leaks, blocking checks, and performance analysis
swoft-clinow supports basic application skeleton and component structure creation, as well as class file generation
The Swoft debug tool helps developers address link tracking, memory leaks, blocking checks, and performance analysis.
composer require swoft/swoole-tracker
return [ // ... 'httpDispatcher' => [ // Add global http middleware 'middlewares' => [ // ... \Swoft\Swoole\Tracker\Middleware\SwooleTrackerMiddleware::class, ], ], // ... ];
swoft-cli Added scene function class generation (controller, middleware, tasks, etc.);
provides tools for creating project skeletons and component skeleton scaffolding..
php swoftcli.phar gen:http-ctrl user --prefix /users
Creating a new project
It is now possible to quickly create a new project with swoft-cli. By default, 5 sets of template repositories are provided, which is convenient for users to initialize different project skeletons.
php swoftcli.phar create:application --help
Creating new component
You can also create new components with swoft-cli and help you quickly complete the initial configuration:
php swoftcli.phar create:component --help
- Repair the client that uses the current fd as the response message by default when the ws server receives the message 3a8890cf
- Fixed all connections that the ws server got through the swoole server. The type of fd may not be an integer and cause an error. 0fa79d7
- Fix stdlib SystemHelper will be deleted by Defender in Windows 10 71c2893
increment/decrementand get a more connection 94c7171
- Fix Model property
$modelTimestampsis closed invalid 94c7171
- Fix The log was called before initialization, which may cause the context loss error during the startup phase 5a27704f
- Fix ws server handshake and open use the same top-level coroutine ID. If one is executed first, it may cause subsequent session loss c2cd17a
aftertimer passing parameter bug 8ed609a
- Fixed timing task memory leaks and log print data loss issues aa6bc32
- Optimized Http server
sgoprocessing flow e60d92e
- Fixed database inconsistency caused by reconnection in the case of things c2e87f2
- Fixed Aop extreme case return
BeanFactory::createBean()method creation problem c2e2c89
- Fix RPC error data is a string problem 3a34658
redisClusterinitialization problem 3a60c06
setterhump judgment errors for
Aggregateaggregate, return string forcibly convert
- Repair model
updateCountersmethod does not synchronize entity data after update 967d6f8
- Adjust ws server to automatically close the connection when the worker exits, add switch configuration, you can choose whether to open. 3a8890c
- ws server new event:
- Add new logs to cut by time f649df2
- Added log support to pass additional parameters 55d5533
- Adjusted and added some ws server related events for users to use e1b0583
- Model pair
- Added connection pool (mysql/redis/rpc) to initiate initial connection a367173
- tcp server supports custom header data packaging and unpacking format when using length packetization a6fbe932
- RPC call error message adjustment d9226b1
- Added operation
Databaseexception, print console error
- New operational data migration
intseries Length support 967d6f8
- Added the original sql method
updateOrCreateto support self-incrementing parameters 967d6f8
Swoftclialready supports basic application skeleton and component structure creation, as well as class file generation functions.
SwoftTrackersupport for easy developer debugging