摘要:
详细请点击 https://blog.csdn.net/qq_38293564/article/details/80883704 以下是自己总结; 接下来我们来重点看一下比较重要的几个字段 type type类型的性能比较 通常来说,不同的 type 类型的性能关系如下: ALL < index < 阅读全文
摘要:
<?php //高并发分布式锁 header("Content-type:text/html;charset=utf-8"); $redis = new Redis(); $redis->connect('127.0.0.1', 6379); echo "Connection to server s 阅读全文
摘要:
//策略模式 interface ChargeStrategy{ public function charge();}//OK,抽象策略类就完成了// 支付宝策略类class AliCharge implements ChargeStrategy{ public function charge() 阅读全文
摘要:
<?php /** * 策略模式 * @author 桃谷六仙 * */ interface Math{ public function calc($op1,$op2);} class MathAdd implements Math{ public function calc($op1, $op2) 阅读全文
摘要:
//工厂化模式class Factory {//创建一个基本的工厂类 static public function fac($id){//创建一个返回对象实例的静态方法 if(1 == $id) return new A(); elseif(2==$id) return new B(); elsei 阅读全文