Home > Backend Development > PHP Tutorial > About swoole and php framework

About swoole and php framework

WBOY
Release: 2016-09-01 00:20:18
Original
1236 people have browsed it

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?

Reply content:

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template