Skip to content

Commit f4ba299

Browse files
committed
把strategy文件夹名恢复成adapter
1 parent c113c88 commit f4ba299

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ $cfg = [
2929
'compress' => 0, // 是否启用缓存内容压缩后存贮
3030
'class' => 'File', // 缓存模式,File)文件缓存;Memcache)使用Memcache缓存;Memcached)使用Memcached缓存;Redis)使用Redis缓存
3131
];
32-
$class = "\\wf\\cache\\strategy\\{$cfg['class']}";
32+
$class = "\\wf\\cache\\adapter\\{$cfg['class']}";
3333
$cache = new $class($cfg);
3434
3535
// 从缓存读取数据
@@ -66,7 +66,7 @@ $cfg = [
6666
'dir' => 'data/cache', // 缓存文件夹,如果使用缓存服务器,则是缓存变量的前缀
6767
'expire' => 3600, // 缓存更新周期(默认:3600s)
6868
'compress' => 0, // 是否启用缓存内容压缩后存贮
69-
'class' => '\\wf\\cache\\strategy\\Memcache', // 缓存模式,File)文件缓存;Memcache)使用Memcache缓存;Memcached)使用Memcached缓存;Redis)使用Redis缓存
69+
'class' => '\\wf\\cache\\adapter\\Memcache', // 缓存模式,File)文件缓存;Memcache)使用Memcache缓存;Memcached)使用Memcached缓存;Redis)使用Redis缓存
7070
7171
['memcache'] => [
7272
'host' => '127.0.0.1', //
@@ -75,7 +75,7 @@ $cfg = [
7575
'timeout' => 1, // 超时时间(秒)
7676
],
7777
];
78-
$class = "\\wf\\cache\\strategy\\{$cfg['class']}";
78+
$class = "\\wf\\cache\\adapter\\{$cfg['class']}";
7979
$cache = new $class($cfg);
8080
8181
// Memcached
@@ -84,7 +84,7 @@ $cfg = [
8484
'dir' => 'data/cache', // 缓存文件夹,如果使用缓存服务器,则是缓存变量的前缀
8585
'expire' => 3600, // 缓存更新周期(默认:3600s)
8686
'compress' => 0, // 是否启用缓存内容压缩后存贮
87-
'class' => '\\wf\\cache\\strategy\\Memcached', // 缓存模式,File)文件缓存;Memcache)使用Memcache缓存;Memcached)使用Memcached缓存;Redis)使用Redis缓存
87+
'class' => '\\wf\\cache\\adapter\\Memcached', // 缓存模式,File)文件缓存;Memcache)使用Memcache缓存;Memcached)使用Memcached缓存;Redis)使用Redis缓存
8888
8989
['memcached'] => [
9090
'host' => '127.0.0.1', //
@@ -94,7 +94,7 @@ $cfg = [
9494
],
9595
];
9696
97-
$class = "\\wf\\cache\\strategy\\{$cfg['class']}";
97+
$class = "\\wf\\cache\\adapter\\{$cfg['class']}";
9898
$cache = new $class($cfg);
9999
100100
```
@@ -123,7 +123,7 @@ $cfg = [
123123
],
124124
];
125125
126-
$class = "\\wf\\cache\\strategy\\{$cfg['class']}";
126+
$class = "\\wf\\cache\\adapter\\{$cfg['class']}";
127127
$cache = new $class($cfg);
128128
129129
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name" : "windwork/cache",
33
"description" : "Windwork cache component",
4-
"version" : "1.1.0",
4+
"version" : "1.2.0",
55
"time" : "2017-06-26 16:00:00",
66
"require" : {
77
"php" : ">=5.5.0"

lib/strategy/File.php renamed to lib/adapter/File.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
88
* @license http://opensource.org/licenses/MIT
99
*/
10-
namespace wf\cache\strategy;
10+
namespace wf\cache\adapter;
1111

1212
/**
1313
* 文件缓存操作实现类
1414
*
1515
* 实现逻辑:通过var_dump把变量保存到文件,读取缓存时再包含文件。
1616
* (旧版通过变量系列化保存到文件再读取,新版本PHP默认开启opcache通过包含文件性能更高。)
1717
*
18-
* @package wf.cache.strategy
18+
* @package wf.cache.adapter
1919
* @author cm <[email protected]>
2020
* @link http://docs.windwork.org/manual/wf.cache.html
2121
* @since 0.1.0

lib/strategy/Memcache.php renamed to lib/adapter/Memcache.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
88
* @license http://opensource.org/licenses/MIT
99
*/
10-
namespace wf\cache\strategy;
10+
namespace wf\cache\adapter;
1111

1212
/**
1313
* Memcache缓存操作实现类
1414
* 需要安装Memcache扩展
1515
*
16-
* @package wf.cache.strategy
16+
* @package wf.cache.adapter
1717
* @author cm <[email protected]>
1818
* @link http://docs.windwork.org/manual/wf.cache.html
1919
* @since 0.1.0

lib/strategy/Memcached.php renamed to lib/adapter/Memcached.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
88
* @license http://opensource.org/licenses/MIT
99
*/
10-
namespace wf\cache\strategy;
10+
namespace wf\cache\adapter;
1111

1212
/**
1313
* Memcached缓存操作实现类,需要安装Memcached扩展
1414
*
15-
* @package wf.cache.strategy
15+
* @package wf.cache.adapter
1616
* @author cm <[email protected]>
1717
* @link http://docs.windwork.org/manual/wf.cache.html
1818
* @since 0.1.0

lib/strategy/Redis.php renamed to lib/adapter/Redis.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
* @copyright Copyright (c) 2008-2017 Windwork Team. (http://www.windwork.org)
88
* @license http://opensource.org/licenses/MIT
99
*/
10-
namespace wf\cache\strategy;
10+
namespace wf\cache\adapter;
1111

1212
/**
1313
* Redis 缓存操作实现类
1414
*
1515
* 需要安装php扩展:https://github.com/phpredis/phpredis
1616
*
17-
* @package wf.cache.strategy
17+
* @package wf.cache.adapter
1818
* @author cm <[email protected]>
1919
* @link http://docs.windwork.org/manual/wf.cache.html
2020
* @since 0.1.0

test/FileTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
require_once '../lib/CacheInterface.php';
33
require_once '../lib/CacheAbstract.php';
4-
require_once '../lib/strategy/File.php';
4+
require_once '../lib/adapter/File.php';
55

66
/**
77
* File test case.
@@ -30,7 +30,7 @@ protected function setUp()
3030
'class' => '',
3131
);
3232

33-
$this->cache = new \wf\cache\strategy\File($cfg);
33+
$this->cache = new \wf\cache\adapter\File($cfg);
3434
}
3535

3636
/**

test/MemcacheTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
require_once '../lib/CacheInterface.php';
33
require_once '../lib/CacheAbstract.php';
4-
require_once '../lib/strategy/Memcache.php';
4+
require_once '../lib/adapter/Memcache.php';
55

66
/**
77
* File test case.
@@ -36,7 +36,7 @@ protected function setUp()
3636
],
3737
);
3838

39-
$this->cache = new \wf\cache\strategy\Memcache($cfg);
39+
$this->cache = new \wf\cache\adapter\Memcache($cfg);
4040
}
4141

4242
/**

test/RedisTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
require_once '../lib/CacheInterface.php';
33
require_once '../lib/CacheAbstract.php';
4-
require_once '../lib/strategy/Redis.php';
4+
require_once '../lib/adapter/Redis.php';
55

66

77
/**
@@ -39,7 +39,7 @@ protected function setUp()
3939
],
4040
);
4141

42-
$this->cache = new \wf\cache\strategy\Redis($cfg);
42+
$this->cache = new \wf\cache\adapter\Redis($cfg);
4343
}
4444

4545
/**

0 commit comments

Comments
 (0)