-
-
慕哥2433345
2020-02-13
配置与设计模式
-
截图
0赞 · 0采集
-
-
碰磁王110
2019-06-05
ArrayAccess自动加载配置类
-
截图
0赞 · 0采集
-
-
technoart
2019-02-01
然后获取配置文件
-
截图
0赞 · 0采集
-
-
technoart
2019-02-01
获取数组key,配置文件是数组并return
-
截图
0赞 · 0采集
-
-
technoart
2019-02-01
配置文件数组
-
截图
0赞 · 0采集
-
-
technoart
2019-02-01
实现4个方法
-
截图
0赞 · 0采集
-
-
technoart
2019-02-01
实现自动加载接口
-
截图
0赞 · 0采集
-
-
technoart
2019-02-01
自动加载配置
-
截图
0赞 · 0采集
-
-
慕斯卡6376950
2018-11-16
设计模式的实际应用
-
截图
0赞 · 0采集
-
-
人在钱途
2018-07-20
需要进一步写代码实例验证
-
0赞 · 0采集
-
-
Y言十年
2017-08-02
- ArrayAccess实现配置文件加载
-
截图
0赞 · 0采集
-
-
瞬间的事
2017-06-23
- 如果实现Arrayacess接口,则能使一个对象属性的访问可以以数组的方式进行。配置文件类常实现该接口
-
0赞 · 0采集
-
-
云旗
2017-05-31
- <?php
namespace IMooc\Config;
class Conf implements \ArrayAccess{
private $path;
private $configs = array();
public function __construct($path) {
$this->path=$path;
}
function offsetGet($offset) {
if(empty($this->configs[$offset])){
$path=$this->path.'/'.$offset.'.php';
$config=require_once $path;
$this->configs[$offset]=$config;
}
return $this->configs[$offset];
}
function offsetSet($offset, $value) {
throw new \Exception("cannot write config file!");
}
public function offsetExists($offset) {
return isset($this->configs[$offset]);
}
public function offsetUnset($offset) {
unset($this->configs[$offset]);
}
}
-
0赞 · 0采集
-
-
qu12
2017-02-28
- 自动加载配置 controller.php
-
截图
0赞 · 0采集
-
-
momomemo
2017-02-09
- 配置和设计模式-加载配置。工厂、装饰器、观察者、代理
-
截图
0赞 · 0采集
-
-
异常代码
2016-11-13
- 如果实现Arrayacess接口,则能使一个对象属性的访问可以以数组的方式进行。配置文件类常实现该接口
-
0赞 · 0采集
-
-
慕粉3216583
2016-09-16
- 配置与设计模式
-
截图
0赞 · 0采集
-
-
小疯子3583324
2016-07-12
- config自动加载使用
-
截图
0赞 · 0采集
-
-
winston_xm
2016-02-13
- ArrayAccess对我来说,是新内容。还要整合几个模式。
-
截图
0赞 · 0采集
-
-
老头头
2016-01-22
- 配置自动加载
-
截图
0赞 · 0采集
-
-
LOL麦炮
2015-11-26
- ArrayAccess接口
-
截图
0赞 · 0采集
-
-
youxianbo
2015-06-19
- 自动加载配置类,需要实现ArrayAccess类,在__construct中加载配置文件并保存到内部变量数组中(下次直接返回),实现接口规定的 offsetGet, offsetSet等等系列方法
-
0赞 · 0采集
-
-
Minersyal
2015-06-12
- 自动加载配置:
实现ArrayAccess类。
__construct,offsetGet,offsetSet等
-
0赞 · 0采集
-
-
陈校军
2015-05-19
- 1.php中使用ArrayAccess实现配置文件的加载
2.在工厂方法中读取配置,生成可配置化对象
3.使用装饰模式实现权限验证,模板渲染,json串化
4.使用观察者模式实现数据跟新时间的一系列更新操作
5.使用代理模式实现数据库的主从自动切换
-
0赞 · 1采集
-
-
陈诗烁
2015-05-01
- 1.php中使用ArrayAccess实现配置文件的加载
2.在工厂方法中读取配置,生成可配置化对象
3.使用装饰模式实现权限验证,模板渲染,json串化
4.使用观察者模式实现数据跟新时间的一系列更新操作
5.使用代理模式实现数据库的主从自动切换
-
0赞 · 0采集
-
-
wxp_Ann
2015-04-14
- ArrayAccess:PHP标准类库提供,一个对象可以变成数组访问的方式。
-
0赞 · 0采集
-
-
慕哥6350167
2015-02-28
- 配置与设计模式
-
截图
0赞 · 1采集