随笔分类 - php
摘要:RPC全称为Remote Procedure Call,翻译过来为“远程过程调用”。目前,主流的平台中都支持各种远程调用技术,以满足分布式系统架构中不同的系统之间的远程通信和相互调用。远程调用的应用场景极其广泛,实现的方式也各式各样。 基于HTTP协议的(例如基于文本的SOAP(XML)、Rest(
阅读全文
摘要:send = $send; } abstract public function msg($content); public function send($to,$content){ $content = $this->msg($content); $this->send->send($to,$content); } } ...
阅读全文
摘要:28,'wind' =>7,'sun' => 'sunny']; return serialize($today); } } //适配器 class AdapterTianqi extends tianqi { public static function show(){ $today = unserialize(parent::show())...
阅读全文
摘要:content = $content; } public function decorator(){ return $this->content; } } //编辑文章摘要 class BianArt extends BaseArt { public function __construct(BaseArt $art){ ...
阅读全文
摘要:calc = new $calc(); } public function calc($op1,$op2){ return $this->calc->calc($op1,$op2); } } $type = $_POST['op']; $cmath = new CMath($type); echo $cmath->calc((int)$_POST...
阅读全文
摘要:<?php //观察者模式 class User implements SplSubject{ public $lognum; public $hobby; protected $observers = null; public function __construct($hobby){ $this
阅读全文
摘要://单例模式 class sigle{ private static $ins = null; public static function getIns(){ if(self::$ins === null){ self::$ins = new self(); } return s...
阅读全文
摘要:_hash($key); //先取圆环上最小的一个节点 $node = current($this->_postion); foreach($this->_postion as $k=>$v){ if($point _mul;$i++){ $this->_posti...
阅读全文