From the official documentation, we know that swoole can do a lot of things, but we are used to the way we thought when writing web before. We only understand the business logic and don’t understand two things:
1 How to get started and how to apply different modes according to different business needs?
2 Combining with the framework, like zphp has a built-in swoole module, what if I use thinkphp?
From the official documentation, we know that swoole can do a lot of things, but we are used to the way we thought when writing web before. We only understand the business logic and don’t understand two things:
1 How to get started and how to apply different modes according to different business needs?
2 Combining with the framework, like zphp has a built-in swoole module, what if I use thinkphp?
Someone has already combined thinkphp with swoole, you can search it on github
Let me tell you my understanding. swoole
itself is a socket library
. The essence of its integration with any framework is how to use the classes in the framework in the swoole application
.
Then you need to understand how to automatically load the classes you need.
The easiest way is to use composer
to manage your class library.
Then in the swoole application
go include_once '/path/to/vendor/autoload.php';
So you find that any class can be used in swoole. It's that simple.
All frameworks are php, just in php way!