Compose Arrangement nginx+php

What should I do when the previous manual operation of running nginx+php in multiple containers was cumbersome?Docker Compose follows Delete the containers and networks you created in the previous section first. If you do not, there will be conflicts when you complete this chapter docker stop nginx docker stop fpm docker network rm lnmp Take ...

Posted by Najjar on Thu, 07 Nov 2019 11:21:04 -0800

How to develop a WebSocket online chat communication system?Swoole and TP are good

ThinkPHP using Swoole requires the think-swoole Composer package to be installed, provided the Swoole PECL extension is installed on the system Install think-swoole by executing the composer command in the project root directory of tp5: composer require topthink/think-swoole Say nothing but code directly: Create a new WebSocket.php controller: ...

Posted by mark_h_uk on Thu, 07 Nov 2019 10:37:32 -0800

git upgrade project version and generate changelog

Semantic Version Control SpecificationContract SubmissionNode.jsNPMTaobao NPM MirrorCommitizenconventional-changelog-cli introduce Semantic Version Control Contract Submission Noun Interpretation Demonstration Plug-in unit 1. Install Node.js 2. Install cnpm (Taobao NPM mirror) $ npm install -g cnpm --registry=https://registry.npm.taobao.org 3 ...

Posted by p2003morris on Thu, 07 Nov 2019 07:24:22 -0800

PHP dynamically hides API fields in Laravel

I recently saw a problem in the Laravel Brasil community that turned out to be more interesting than it seemed.Imagine that you have a UsersResource implemented with the following: 1 <?php 2 namespace App\Http\Resources; 3 use Illuminate\Http\Resources\Json\Resource; 4 class UsersResource extends Resource 5 { 6 /** 7 * Transform the ...

Posted by ozzysworld on Thu, 07 Nov 2019 05:49:54 -0800

php interprocess communication semaphores and shared memory

Why interprocess communication is needed When a process accesses critical resources, it is possible for multiple processes to access critical resources at the same time in the same time, resulting in unexpected errors due to the uncertainty of who executes first between processes (which depends on the process scheduling algorithm of the kernel, ...

Posted by oh_maestro on Thu, 07 Nov 2019 00:22:33 -0800

Data structures: SplPriorityQueue

A normal queue is a first in, first out data structure in which elements are appended at the end of the queue and taken out from the queue head. In the priority queue, elements are given priority. When accessing an element, the element with the highest priority is taken out first. Priority queues have the behavior characteristics of largest in, ...

Posted by big-dog on Wed, 06 Nov 2019 15:13:03 -0800

php interprocess communication message queuing

Why process is needed Process is the basic unit of resource allocation and scheduling. As the carrier of the independent operation of the program, the process ensures the normal execution of the program. The existence of processes makes the utilization of operating system resources greatly improved. Message queue Message queuing is a container ...

Posted by bronzemonkey on Wed, 06 Nov 2019 06:02:32 -0800

Analysis of memory leak when Yii2 framework runs script

phenomenon When running the archiving of edu OCR img table, every tens of thousands of data runs out of memory PHP Fatal error:  Allowed memory size of 134217728 bytesexhausted (tried toallocate 135168 bytes) Trace code discovery is caused by the following code at insert time: EduOCRTaskBackup::getDb()->createCommand()->batchInsert(EduOCR ...

Posted by johncox on Tue, 05 Nov 2019 11:52:40 -0800

Using swoole+websocket and redis to realize web one-to-one chat

Redis implements that each service connected to websocket is bound to a unique user. Save to redis through user account = websocket fd. mysql implements the offline message pool. If a user is not online, messages sent to him by other users are temporarily stored in mysql. When the user is online, it is taken out from the offline message pool an ...

Posted by Eal on Tue, 05 Nov 2019 06:13:55 -0800

A summary of the use of generics in Android in actual projects

Preface Why summarize the use of generics? How does generics represent value in a project? Don't talk about it. Summarize it. From practice to theory, finally return to generic nature. 1. What is generics? Why generics? Definition: Generics: the "broad data type", any data type. Effect: Generics can solve the security problem of data ...

Posted by baselinej on Tue, 05 Nov 2019 02:15:53 -0800