PHP+swoole to realize the function of chatting and mass sending

This article mainly introduces PHP+swoole to realize the function of chatting and mass sending. I hope it can be helpful for you if you are interested in it. php code: $serv = new swoole_websocket_server("127.0.0.1",3999); //Basic settings of service $serv->set(array( 'worker_num' => 2, 'reactor_num'=>8, 'task_worker_num'=>1, ...

Posted on Mon, 06 Jan 2020 03:35:49 -0800 by kaitan

Laravel 5.5 source notes (3. facade)

Last time I said provider, this time I said facade The first is the source of startup. From the $bootstrappers array in the kernel class of laravel, we can see some of its system boot methods. The registerfacies is used to register the facade class. protected $bootstrappers = [ \Illuminate\Foundation\Bootstrap\LoadEnvironmentVariab ...

Posted on Tue, 10 Dec 2019 10:40:46 -0800 by jonoc33

Implement a simple di container

I have seen many frameworks before, such as laravel, thinkphp, yii, etc. Basically, containers are used. For me, although I understand how laravel is written, if I don't try it, I still don't think it will be. The following code is a simple container I implemented. It's not very good in many places, but it should be enough. <?php class Cont ...

Posted on Wed, 04 Dec 2019 14:52:31 -0800 by RaheimSG

Laravel polymorphism association (morphTo,morphMany)

Laravel polymorphism association (morphTo,morphMany)In the process of website development, we often encounter comment products, comment articles, comment stores, etc. when dealing with such needs, we often create a new comment table, and then distinguish the object development process of comments through a type field as follows: New table opera ...

Posted on Mon, 02 Dec 2019 08:59:47 -0800 by bladx

Cookie serialization problems encountered after Laravel 5.5 upgrade to 5.5.42

Recently, the small version number of Laravel (v5.5.39 = > v5.5.45) in the project has been upgraded for the manual disabled. If it is not upgraded, it will have problems as soon as it is upgraded! Error prompt on Sentry platform: openssl_encrypt() expectations parameter 1 to be string, array given. The specific error record is as follows: E ...

Posted on Sun, 01 Dec 2019 10:18:59 -0800 by Major Tom

Laravel admin usage record - quickly build CURD

Introducer After the installation, simply change the configuration and page effect. Next, build CURD quickly. Use the faker & users table used in the previous test. Controller and routing Specify the model generation controller PHP artican admin: make database \ \ fakerusercontroller -- model = app \ \ models \ \ fakeruser. After execution ...

Posted on Sat, 30 Nov 2019 20:57:21 -0800 by Zippyaus

Basic use of Pcntl multiprocess extension in PHP

PHP provides a pcntl extension. Pcntl is based on Linux process. Windows system does not have this extension for the time being. It is used to realize basic multi process implementation. This can be used to process a very time-consuming task, such as sending and subscribing e-mail, SMS, in station information, etc. Reference link: http://php.ne ...

Posted on Sat, 30 Nov 2019 18:36:08 -0800 by saadlive

Problem solving encountered by the Laravel framework using MongoDB

Previously, I always used macOS as a development platform, directly in macOS System Configuration Nginx PHP and MySQL Because of project requirements, MongoDB is required. This is a running ledger that runs Laravel framework under macOS system and solves problems encountered by MongoDB.   To keep the code officially developed clean, I created ...

Posted on Wed, 27 Nov 2019 20:57:10 -0800 by muthuraj_mr

MySQL transaction nesting

MySQL automatically commits by default (autocommit=1). If you want to turn on transactions, turn off autocommit first (autocommit=0). InnoDB supports transactions, but MyISAM does not. MySQL does not support transaction nesting; after a transaction has been opened, start transaction will implicitly commit the previous transaction.   Some ...

Posted on Sun, 03 Nov 2019 03:09:47 -0800 by simulant

Case 1 of the actual development of the project using swoole in Laravel (establishing swoole and front-end communication)

Recently, I used swoole to do a project, in which I designed to push information to the front end of the interface and monitor the status of users without login. Here is my experience. Please leave a comment if there is any improvement. 1 environment required for development Sharp tools make good work. Before the formal development, we should c ...

Posted on Fri, 01 Nov 2019 09:23:06 -0700 by grayson