PHP Clean Code (Part 2)

PHP Clean Code (Part I) Use default parameters instead of short circuit operation or condition judgment Bad practice: This is not good because $breweryName can be NULL function createMicrobrewery($breweryName = 'Hipster Brew Co.'): void { // ... }    It's OK: This approach is easier to understand than the above, but it needs to contr ...

Posted by Kiubbo on Fri, 27 Mar 2020 11:33:02 +0100

PHP Clean Code (Part 1)

introduce Software Engineer Guidelines for Robert C.Martin's Clean Code The same applies to PHP.It is not a guide to coding style, it guides us to write readable, reusable, and decomposable code in PHP. Not all guidelines must be strictly followed, even some have become common conventions.This is just a guideline, many of which are years of ex ...

Posted by Kalland on Fri, 27 Mar 2020 09:16:14 +0100

solidity test case practice

Truffle development framework provides two methods for testing Ethereum smart contract: solid testing at blockchain level and JavaScript testing at DApp level. In this tutorial, we will introduce the purpose, difference and application scenario of these two testing methods of Ethereum smart contract, and learn how to use the solid test case and ...

Posted by Demonic on Thu, 26 Mar 2020 04:11:33 +0100

Actual Ethereum smart contract test [Truffle]

Truffle development framework provides two methods for testing Ethereum smart contract: solid testing at blockchain level and JavaScript testing at DApp level. In this tutorial, we will introduce the purpose, difference and application scenario of these two testing methods of Ethereum smart contract, and learn how to use the solid test case and ...

Posted by scheols on Thu, 26 Mar 2020 03:33:25 +0100

Tihinkphp3.2 integrate the latest version of Alibaba fish to send SMS verification code

Alida fish's latest download address: Alibig fish SDK Download Or download from the official website: Alibaba big fish SDK official website download After downloading, put the API ﹣ SDK folder in the compressed package into the ThinkPHP\Library\Vendor directory, and change the file name to Aliyun. If you want to change it to another name, plea ...

Posted by Neomech on Fri, 20 Mar 2020 16:43:03 +0100

PHP implementation of RabbitMQ message queue

First, install RabbitMQ corresponding to PHP. Here we use PHP ﹣ AMQP to implement different extension methods with slight differences php extension address: http://pecl.php.net/package/amqp The details are subject to the official website http://www.rabbitmq.com/getstarted.html introduce config.php configuration information BaseMQ.php MQ base ...

Posted by poseidix on Tue, 17 Mar 2020 16:17:27 +0100

CentOS7.X installs Redis-4.0.8 and builds Redis clusters

My personal website Install redis Preparation before installation yum install \ vim \ wget \ make \ gcc \ gcc-c++ \ automake \ autoconf \ -y \ Download, unzip and install cd /root wget http://download.redis.io/releases/redis-4.0.8.tar.gz tar -zxzf redis-4.0.8.tar.gz cd redis-4.0.8 make PREFIX=/usr/local/redis/ install Create the data file ...

Posted by chrisv on Tue, 17 Mar 2020 12:24:00 +0100

Redis - using Gearmand as mysql cache server

Redis - using Gearmand as mysql cache server Article directory Redis - using Gearmand as mysql cache server 1. What is gearland? 2. Deployment process 3. test 1. What is gearland? Gearmand is a machine used to delegate work to other machines, distributed calls are more suitable for doing a c ...

Posted by onedumbcoder on Fri, 13 Mar 2020 07:53:45 +0100

Centos7.4 source code to build lamp ᥤ PHP configuration

Learning notes 1. Command for the location of the PHP configuration file /usr/local/php/bin/php -i|grep -i "loaded configuration file"      ​ 2. Disable functions in PHP 2.1. php has many built-in functions, so it is safe to disable some risky functions vim /etc/php.ini         #This is the lo ...

Posted by Aybabtu on Tue, 25 Feb 2020 05:20:33 +0100

Find the longest string in a string (PHP version)

Title Description 1: read in a string STR, and output the longest string in the string str. If there are more than one consecutive longest digital string, just output the first one. Input description The input contains 1 test case, a string str, and the length does not exceed 255. Output descrip ...

Posted by Cheez on Fri, 21 Feb 2020 14:13:10 +0100