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.
$serv = new swoole_websocket_server("127.0.0.1",3999);
//Basic settings of service
'worker_num' => 2,
Posted on Mon, 06 Jan 2020 03:35:49 -0800 by kaitan
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 = [
Posted on Tue, 10 Dec 2019 10:40:46 -0800 by jonoc33
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.
class Cont ...
Posted on Wed, 04 Dec 2019 14:52:31 -0800 by RaheimSG
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
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:
Posted on Sun, 01 Dec 2019 10:18:59 -0800 by Major Tom
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
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.
Posted on Sat, 30 Nov 2019 18:36:08 -0800 by saadlive
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 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.
Posted on Sun, 03 Nov 2019 03:09:47 -0800 by simulant
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