search
HomePHP FrameworkThinkPHPThink-Swoole tutorial hot update

Think-Swoole tutorial hot update

Sep 16, 2020 am 09:25 AM
think-swoole

I recently started to contact and develop Swoole. When I first came into contact with it, I was really confused and I searched for a lot of information to understand it. Recently, I have been working on some advanced functions of Swoole. I have summarized some experience of integrating Swoole with the Thinkphp6.0 framework based on actual projects, and compiled and shared it with some information on the Internet.

Recommended tutorials: "thinkphp" "swoole tutorial"

Since the PHP file is resident in the memory during the running of the Swoole service, so It can avoid repeatedly reading the disk and repeatedly interpreting and compiling PHP in order to achieve the highest performance. Therefore, after changing the business code, you must manually reload or restart it to take effect.

The think-swoole extension provides a hot update function. It will automatically reload after detecting that the files in the relevant directories have been updated. This eliminates the need for manual reload operations and facilitates development and debugging.

If your application has debug mode enabled, hot update is enabled by default. In principle, it is not recommended to turn on file monitoring in deployment mode. On the one hand, there will be performance losses, and on the other hand, any modifications made to the files need to be confirmed before update deployment can be carried out.

ThinkPHP 6 has a .example.env file by default in the root directory of the application. Copy this file and rename it to .env. When this special .env environment variable file is defined and APP_DEBUG = true is set in it, hot update will be enabled by default. In addition, you can also directly set enable in the hot_update configuration in /app/config/swoole.php to true.

.env

Think-Swoole tutorial hot update

config/swoole.php

Think-Swoole tutorial hot update

The above is the detailed content of Think-Swoole tutorial hot update. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:阿dai哥. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools