Showing
9 changed files
with
1217 additions
and
1079 deletions
@@ -11,7 +11,9 @@ | @@ -11,7 +11,9 @@ | ||
11 | 11 | ||
12 | namespace Api; | 12 | namespace Api; |
13 | 13 | ||
14 | -use Plugin\Cache; | 14 | +use WebPlugin\Cache; |
15 | +use WebPlugin\UdpLog; | ||
16 | + | ||
15 | class Yohobuy | 17 | class Yohobuy |
16 | { | 18 | { |
17 | 19 | ||
@@ -153,13 +155,20 @@ class Yohobuy | @@ -153,13 +155,20 @@ class Yohobuy | ||
153 | $urlBack = $url; | 155 | $urlBack = $url; |
154 | 156 | ||
155 | if (USE_INTER_FACE_SHUNT) { | 157 | if (USE_INTER_FACE_SHUNT) { |
156 | - if (strpos($url, 'api.')) { | 158 | + if (strpos($url, 'api')) { |
157 | $isApi = true; | 159 | $isApi = true; |
158 | $url = self::_getUrl($url, $data); | 160 | $url = self::_getUrl($url, $data); |
159 | - } else if (strpos($url, 'service.')) { | 161 | + } else if (strpos($url, 'service')) { |
160 | $isService = true; | 162 | $isService = true; |
161 | $url = self::_getUrl($url, $data); | 163 | $url = self::_getUrl($url, $data); |
162 | } | 164 | } |
165 | + | ||
166 | + //$url 返回为空,走原先的url | ||
167 | + if (empty($url)) { | ||
168 | + $isApi = false; | ||
169 | + $isService = false; | ||
170 | + $url = $urlBack; | ||
171 | + } | ||
163 | } | 172 | } |
164 | 173 | ||
165 | // 销毁私钥参数 | 174 | // 销毁私钥参数 |
@@ -171,6 +180,8 @@ class Yohobuy | @@ -171,6 +180,8 @@ class Yohobuy | ||
171 | $url = self::httpBuildQuery($url, $data); | 180 | $url = self::httpBuildQuery($url, $data); |
172 | } //echo $url; | 181 | } //echo $url; |
173 | 182 | ||
183 | + UdpLog::debug('get shut api', $url); | ||
184 | + | ||
174 | /* 开启缓存的情况 */ | 185 | /* 开启缓存的情况 */ |
175 | if ($cache && USE_CACHE) { | 186 | if ($cache && USE_CACHE) { |
176 | // 先尝试获取一级缓存(master), 有数据则直接返回. | 187 | // 先尝试获取一级缓存(master), 有数据则直接返回. |
@@ -265,6 +276,8 @@ class Yohobuy | @@ -265,6 +276,8 @@ class Yohobuy | ||
265 | curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); | 276 | curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); |
266 | } | 277 | } |
267 | 278 | ||
279 | + UdpLog::debug('call api: ', $url); | ||
280 | + | ||
268 | $result = curl_exec($ch); | 281 | $result = curl_exec($ch); |
269 | $httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE); | 282 | $httpCode = curl_getinfo($ch,CURLINFO_HTTP_CODE); |
270 | if (!$returnJson && !empty($result)) { | 283 | if (!$returnJson && !empty($result)) { |
@@ -306,13 +319,20 @@ class Yohobuy | @@ -306,13 +319,20 @@ class Yohobuy | ||
306 | $urlBack = $url; | 319 | $urlBack = $url; |
307 | 320 | ||
308 | if (USE_INTER_FACE_SHUNT) { | 321 | if (USE_INTER_FACE_SHUNT) { |
309 | - if (strpos($url, 'api.')) { | 322 | + if (strpos($url, 'api')) { |
310 | $isApi = true; | 323 | $isApi = true; |
311 | $url = self::_getUrl($url, $data); | 324 | $url = self::_getUrl($url, $data); |
312 | - } else if (strpos($url, 'service.')) { | 325 | + } else if (strpos($url, 'service')) { |
313 | $isService = true; | 326 | $isService = true; |
314 | $url = self::_getUrl($url, $data); | 327 | $url = self::_getUrl($url, $data); |
315 | } | 328 | } |
329 | + | ||
330 | + //$url 返回为空,走原先的url | ||
331 | + if (empty($url)) { | ||
332 | + $isApi = false; | ||
333 | + $isService = false; | ||
334 | + $url = $urlBack; | ||
335 | + } | ||
316 | } | 336 | } |
317 | 337 | ||
318 | $ch = curl_init($url); | 338 | $ch = curl_init($url); |
@@ -353,6 +373,9 @@ class Yohobuy | @@ -353,6 +373,9 @@ class Yohobuy | ||
353 | $result = curl_exec($ch); | 373 | $result = curl_exec($ch); |
354 | 374 | ||
355 | $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); | 375 | $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); |
376 | + | ||
377 | + UdpLog::debug('post api', array('url' => $url, 'httpCode' => $httpCode)); | ||
378 | + | ||
356 | //如果分流执行失败,则走原来的逻辑 | 379 | //如果分流执行失败,则走原来的逻辑 |
357 | if (USE_INTER_FACE_SHUNT && $httpCode !== 200) { | 380 | if (USE_INTER_FACE_SHUNT && $httpCode !== 200) { |
358 | curl_close($ch); | 381 | curl_close($ch); |
@@ -399,6 +422,9 @@ class Yohobuy | @@ -399,6 +422,9 @@ class Yohobuy | ||
399 | //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); | 422 | //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); |
400 | curl_setopt($ch, CURLOPT_POSTFIELDS, $str); | 423 | curl_setopt($ch, CURLOPT_POSTFIELDS, $str); |
401 | } | 424 | } |
425 | + | ||
426 | + UdpLog::debug('post fail api', $url); | ||
427 | + | ||
402 | $result = curl_exec($ch); | 428 | $result = curl_exec($ch); |
403 | if (!$returnJson && !empty($result)) { | 429 | if (!$returnJson && !empty($result)) { |
404 | $result = json_decode($result, true); | 430 | $result = json_decode($result, true); |
@@ -678,34 +704,90 @@ class Yohobuy | @@ -678,34 +704,90 @@ class Yohobuy | ||
678 | */ | 704 | */ |
679 | private static function _getUrl($url, $param) | 705 | private static function _getUrl($url, $param) |
680 | { | 706 | { |
681 | - if (USE_INTER_FACE_SHUNT === false) { | ||
682 | - return $url; | 707 | + if (USE_CACHE === false || USE_INTER_FACE_SHUNT === false) { |
708 | + return false; | ||
709 | + } | ||
710 | + | ||
711 | + | ||
712 | + UdpLog::debug('read memcache'); | ||
713 | + $interfaceShunt = Cache::getBy('INTERFACE_SHUT_KEY', 'master'); | ||
714 | + | ||
715 | + UdpLog::debug('read memcahe: ', $interfaceShunt); | ||
716 | + if (empty($interfaceShunt)) { | ||
717 | + return false; | ||
683 | } | 718 | } |
684 | 719 | ||
685 | - $uid = 0; | 720 | + $interfaceShunt = json_decode($interfaceShunt, true); |
721 | + | ||
722 | + if (empty($interfaceShunt['cloud'])) { | ||
723 | + return false; | ||
724 | + } | ||
725 | + | ||
726 | + $uid = isset($param['uid']) ? intval($param['uid']) : 0; | ||
686 | $mod = 0; | 727 | $mod = 0; |
728 | + $cloud = intval($interfaceShunt['cloud']); | ||
729 | + $ips = ''; | ||
687 | 730 | ||
688 | - if (isset($param['uid'])) { | ||
689 | - $uid = intval($param['uid']); | ||
690 | - $mod = $uid % 1024; | 731 | + switch ($cloud) { |
732 | + case 1: | ||
733 | + $ips = $interfaceShunt['aws']; | ||
734 | + break; | ||
735 | + case 2: | ||
736 | + $ips = $interfaceShunt['tencent']; | ||
737 | + break; | ||
738 | + case 3: | ||
739 | + if (empty($uid) || empty($interfaceShunt['strategy']) || | ||
740 | + empty($interfaceShunt['strategy']['model']) || | ||
741 | + empty($interfaceShunt['strategy']['tencentMax'])) { | ||
742 | + break; | ||
743 | + } else { | ||
744 | + $ips = $uid % $interfaceShunt['strategy']['model'] > $interfaceShunt['strategy']['tencentMax'] ? | ||
745 | + $interfaceShunt['aws'] : $interfaceShunt['tencent']; | ||
746 | + } | ||
747 | + break; | ||
748 | + default: | ||
749 | + $ips = ''; | ||
750 | + break; | ||
751 | + } | ||
752 | + | ||
753 | + //未登录情况下 | ||
754 | + if (empty($uid) && empty($ips) && !empty($interfaceShunt['strategy']) && | ||
755 | + !empty($interfaceShunt['strategy']['notLogin'])) { | ||
756 | + $ips = $interfaceShunt[$interfaceShunt['strategy']['notLogin']]; | ||
691 | } | 757 | } |
692 | 758 | ||
693 | - if ($mod > 128 || $uid === 0) { | ||
694 | - $paseUrl = parse_url($url); | ||
695 | - if (strpos($url, 'api.')) { | ||
696 | - $url = 'http://' . self::$interfaceShunt['awsServers']['api'] . rtrim($paseUrl['path'], '/') . '/'; | ||
697 | - } else if (strpos($url, 'service.')) { | ||
698 | - $url = 'http://' . self::$interfaceShunt['awsServers']['service'] . rtrim($paseUrl['path'], '/') . '/'; | 759 | + if (empty($ips)) { |
760 | + return false; | ||
761 | + } | ||
762 | + | ||
763 | + $paseUrl = parse_url($url); | ||
764 | + if (strpos($url, 'api')) { | ||
765 | + | ||
766 | + if (empty($ips['api.yoho.cn'])) { | ||
767 | + return false; | ||
699 | } | 768 | } |
700 | - } else { | ||
701 | - $paseUrl = parse_url($url); | ||
702 | - if (strpos($url, 'api.')) { | ||
703 | - $num = array_rand(self::$interfaceShunt['tencentServers']['api']); | ||
704 | - $url = 'http://' . self::$interfaceShunt['tencentServers']['api'][$num] . rtrim($paseUrl['path'], '/') . '/'; | ||
705 | - } else if (strpos($url, 'service.')) { | ||
706 | - $num = array_rand(self::$interfaceShunt['tencentServers']['service']); | ||
707 | - $url = 'http://' . self::$interfaceShunt['tencentServers']['service'][$num] . rtrim($paseUrl['path'], '/') . '/'; | 769 | + |
770 | + $num = array_rand($ips['api.yoho.cn']); | ||
771 | + | ||
772 | + if (empty($ips['api.yoho.cn'][$num]['ip'])) { | ||
773 | + return false; | ||
774 | + } | ||
775 | + | ||
776 | + $url = 'http://' . $ips['api.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/'; | ||
777 | + | ||
778 | + } else if (strpos($url, 'service')) { | ||
779 | + | ||
780 | + if (empty($ips['service.yoho.cn'])) { | ||
781 | + return false; | ||
708 | } | 782 | } |
783 | + | ||
784 | + $num = array_rand($ips['service.yoho.cn']); | ||
785 | + | ||
786 | + if (empty($ips['service.yoho.cn'][$num]['ip'])) { | ||
787 | + return false; | ||
788 | + } | ||
789 | + | ||
790 | + $url = 'http://' . $ips['service.yoho.cn'][$num]['ip'] . rtrim($paseUrl['path'], '/') . '/'; | ||
709 | } | 791 | } |
710 | 792 | ||
711 | return $url; | 793 | return $url; |
1 | -<?php | ||
2 | - | ||
3 | -namespace Plugin; | ||
4 | - | ||
5 | -use Hood\Cache as HoodCache; | ||
6 | - | ||
7 | -/** | ||
8 | - * 数据缓存的操作类 | ||
9 | - * | ||
10 | - * @name Cache | ||
11 | - * @package Plugin | ||
12 | - * @copyright yoho.inc | ||
13 | - * @version 1.0 (2015-10-10 11:23:47) | ||
14 | - * @author fei.hong <fei.hong@yoho.cn> | ||
15 | - */ | ||
16 | -class Cache | ||
17 | -{ | ||
18 | - | ||
19 | - /** | ||
20 | - * 设置缓存 | ||
21 | - * | ||
22 | - * 备注: | ||
23 | - * 采用主从分布式缓存 | ||
24 | - * master 代表主缓存服务器 | ||
25 | - * slave 代表从缓存服务器 | ||
26 | - * | ||
27 | - * 作用: | ||
28 | - * 在后端的服务异常挂掉了并且主服务器缓存(master)的数据时间到期后, | ||
29 | - * 能获取从服务器缓存(slave)的数据,不影响前端页面的正常访问. | ||
30 | - * | ||
31 | - * @param string $key 键名 | ||
32 | - * @param mixed $value 需要缓存的数据 | ||
33 | - * @param int $expire 缓存有效期(单位秒, 0表示永久) | ||
34 | - * @return void | ||
35 | - */ | ||
36 | - public static function set($key, $value, $expire = 300) | ||
37 | - { | ||
38 | - try { | ||
39 | - // WINDOWS | ||
40 | - if (DIRECTORY_SEPARATOR === '\\') { | ||
41 | - HoodCache::Memcache('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
42 | - HoodCache::Memcache('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
43 | - } | ||
44 | - // LINUX | ||
45 | - else { | ||
46 | - HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
47 | - HoodCache::Memcached('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
48 | - } | ||
49 | - } catch (Exception $e) { | ||
50 | - // do nothing | ||
51 | - } | ||
52 | - } | ||
53 | - | ||
54 | - /** | ||
55 | - * 获取缓存 | ||
56 | - * | ||
57 | - * @param string $key 键名 | ||
58 | - * @param string $node master代表主服务器, slave代表从服务器 | ||
59 | - * @return mixed | ||
60 | - */ | ||
61 | - public static function get($key, $node = 'master') | ||
62 | - { | ||
63 | - $result = array(); | ||
64 | - | ||
65 | - try { | ||
66 | - // WINDOWS | ||
67 | - if (DIRECTORY_SEPARATOR === '\\') { | ||
68 | - $result = HoodCache::Memcache($node)->get(self::makeKey($key, $node)); | ||
69 | - } | ||
70 | - // LINUX | ||
71 | - else { | ||
72 | - $result = HoodCache::Memcached($node)->get(self::makeKey($key, $node)); | ||
73 | - } | ||
74 | - | ||
75 | - // 当接口异常,一级缓存没取到数据的情况 | ||
76 | - if ($node === 'slave') { | ||
77 | - $incrementKey = self::makeKey('_increment_' . $key, 'slave'); | ||
78 | - $incrementValue = HoodCache::Memcached('slave')->get($incrementKey); | ||
79 | - // 接口调用失败累计5次之后,回填二级缓存数据到一级缓存, 重置计数值为0 | ||
80 | - if (is_int($incrementValue) && $incrementValue > 5) { | ||
81 | - HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $result, 300); | ||
82 | - HoodCache::Memcached('slave')->set($incrementKey, 0, 3600); | ||
83 | - } | ||
84 | - // 接口调用失败次数累加 | ||
85 | - else { | ||
86 | - HoodCache::Memcached('slave')->increment($incrementKey, 1, 0, 3600); | ||
87 | - } | ||
88 | - } | ||
89 | - } catch (Exception $e) { | ||
90 | - $result = array(); | ||
91 | - } | ||
92 | - | ||
93 | - return $result; | ||
94 | - } | ||
95 | - | ||
96 | - /** | ||
97 | - * 清除缓存 | ||
98 | - * | ||
99 | - * @param string $key 键名 | ||
100 | - * @return void | ||
101 | - */ | ||
102 | - public static function delete($key) | ||
103 | - { | ||
104 | - // WINDOWS | ||
105 | - if (DIRECTORY_SEPARATOR === '\\') { | ||
106 | - HoodCache::Memcache('master')->delete(self::makeKey($key, 'master')); | ||
107 | - HoodCache::Memcache('slave')->delete(self::makeKey($key, 'slave')); | ||
108 | - } | ||
109 | - // LINUX | ||
110 | - else { | ||
111 | - HoodCache::Memcached('master')->delete(self::makeKey($key, 'master')); | ||
112 | - HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave')); | ||
113 | - } | ||
114 | - } | ||
115 | - | ||
116 | - /** | ||
117 | - * 累加 | ||
118 | - * | ||
119 | - * @param string $key | ||
120 | - * @param int $offset | ||
121 | - * @param int $initialValue | ||
122 | - * @param int $expiry | ||
123 | - * @return boolean | ||
124 | - */ | ||
125 | - public static function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
126 | - { | ||
127 | - return HoodCache::Memcached('master')->increment(self::makeKey($key, 'master'), $offset, $initialValue, $expiry); | ||
128 | - } | ||
129 | - | ||
130 | - /** | ||
131 | - * 递减 | ||
132 | - * | ||
133 | - * @param string $key | ||
134 | - * @param int $offset | ||
135 | - * @return boolean | ||
136 | - */ | ||
137 | - public static function decrement($key, $offset = 1) | ||
138 | - { | ||
139 | - return HoodCache::Memcached('master')->decrement(self::makeKey($key, 'master'), $offset); | ||
140 | - } | ||
141 | - | ||
142 | - /** | ||
143 | - * 生成键名 | ||
144 | - * | ||
145 | - * @param string $key 键名 | ||
146 | - * @param string $prefix 前缀标识 | ||
147 | - * @return string | ||
148 | - */ | ||
149 | - public static function makeKey($key, $prefix) | ||
150 | - { | ||
151 | - return md5($prefix . '_' . $key); | ||
152 | - } | ||
153 | - | ||
154 | -} | 1 | +<?php |
2 | + | ||
3 | +namespace Plugin; | ||
4 | + | ||
5 | +use Hood\Cache as HoodCache; | ||
6 | + | ||
7 | +/** | ||
8 | + * 数据缓存的操作类 | ||
9 | + * | ||
10 | + * @name Cache | ||
11 | + * @package Plugin | ||
12 | + * @copyright yoho.inc | ||
13 | + * @version 1.0 (2015-10-10 11:23:47) | ||
14 | + * @author fei.hong <fei.hong@yoho.cn> | ||
15 | + */ | ||
16 | +class Cache | ||
17 | +{ | ||
18 | + | ||
19 | + /** | ||
20 | + * 设置缓存 | ||
21 | + * | ||
22 | + * 备注: | ||
23 | + * 采用主从分布式缓存 | ||
24 | + * master 代表主缓存服务器 | ||
25 | + * slave 代表从缓存服务器 | ||
26 | + * | ||
27 | + * 作用: | ||
28 | + * 在后端的服务异常挂掉了并且主服务器缓存(master)的数据时间到期后, | ||
29 | + * 能获取从服务器缓存(slave)的数据,不影响前端页面的正常访问. | ||
30 | + * | ||
31 | + * @param string $key 键名 | ||
32 | + * @param mixed $value 需要缓存的数据 | ||
33 | + * @param int $expire 缓存有效期(单位秒, 0表示永久) | ||
34 | + * @return void | ||
35 | + */ | ||
36 | + public static function set($key, $value, $expire = 300) | ||
37 | + { | ||
38 | + try { | ||
39 | + // WINDOWS | ||
40 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
41 | + HoodCache::Memcache('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
42 | + HoodCache::Memcache('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
43 | + } | ||
44 | + // LINUX | ||
45 | + else { | ||
46 | + HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
47 | + HoodCache::Memcached('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
48 | + } | ||
49 | + } catch (Exception $e) { | ||
50 | + // do nothing | ||
51 | + } | ||
52 | + } | ||
53 | + | ||
54 | + /** | ||
55 | + * 获取缓存 | ||
56 | + * | ||
57 | + * @param string $key 键名 | ||
58 | + * @param string $node master代表主服务器, slave代表从服务器 | ||
59 | + * @return mixed | ||
60 | + */ | ||
61 | + public static function get($key, $node = 'master') | ||
62 | + { | ||
63 | + $result = array(); | ||
64 | + | ||
65 | + try { | ||
66 | + // WINDOWS | ||
67 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
68 | + $result = HoodCache::Memcache($node)->get(self::makeKey($key, $node)); | ||
69 | + } | ||
70 | + // LINUX | ||
71 | + else { | ||
72 | + $result = HoodCache::Memcached($node)->get(self::makeKey($key, $node)); | ||
73 | + } | ||
74 | + | ||
75 | + // 当接口异常,一级缓存没取到数据的情况 | ||
76 | + if ($node === 'slave') { | ||
77 | + $incrementKey = self::makeKey('_increment_' . $key, 'slave'); | ||
78 | + $incrementValue = HoodCache::Memcached('slave')->get($incrementKey); | ||
79 | + // 接口调用失败累计5次之后,回填二级缓存数据到一级缓存, 重置计数值为0 | ||
80 | + if (is_int($incrementValue) && $incrementValue > 5) { | ||
81 | + HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $result, 300); | ||
82 | + HoodCache::Memcached('slave')->set($incrementKey, 0, 3600); | ||
83 | + } | ||
84 | + // 接口调用失败次数累加 | ||
85 | + else { | ||
86 | + HoodCache::Memcached('slave')->increment($incrementKey, 1, 0, 3600); | ||
87 | + } | ||
88 | + } | ||
89 | + } catch (Exception $e) { | ||
90 | + $result = array(); | ||
91 | + } | ||
92 | + | ||
93 | + return $result; | ||
94 | + } | ||
95 | + | ||
96 | + /** | ||
97 | + * 直接查询缓存,不对key做任何处理 | ||
98 | + */ | ||
99 | + public static function getBy($key, $node = 'master') | ||
100 | + { | ||
101 | + $result = array(); | ||
102 | + | ||
103 | + try { | ||
104 | + // WINDOWS | ||
105 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
106 | + $result = HoodCache::Memcache($node)->getBy($key); | ||
107 | + } | ||
108 | + // LINUX | ||
109 | + else { | ||
110 | + $result = HoodCache::Memcached($node)->getBy($key); | ||
111 | + } | ||
112 | + } catch (Exception $e) { | ||
113 | + $result = array(); | ||
114 | + } | ||
115 | + | ||
116 | + return $result; | ||
117 | + } | ||
118 | + | ||
119 | + /** | ||
120 | + * 清除缓存 | ||
121 | + * | ||
122 | + * @param string $key 键名 | ||
123 | + * @return void | ||
124 | + */ | ||
125 | + public static function delete($key) | ||
126 | + { | ||
127 | + // WINDOWS | ||
128 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
129 | + HoodCache::Memcache('master')->delete(self::makeKey($key, 'master')); | ||
130 | + HoodCache::Memcache('slave')->delete(self::makeKey($key, 'slave')); | ||
131 | + } | ||
132 | + // LINUX | ||
133 | + else { | ||
134 | + HoodCache::Memcached('master')->delete(self::makeKey($key, 'master')); | ||
135 | + HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave')); | ||
136 | + } | ||
137 | + } | ||
138 | + | ||
139 | + /** | ||
140 | + * 累加 | ||
141 | + * | ||
142 | + * @param string $key | ||
143 | + * @param int $offset | ||
144 | + * @param int $initialValue | ||
145 | + * @param int $expiry | ||
146 | + * @return boolean | ||
147 | + */ | ||
148 | + public static function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
149 | + { | ||
150 | + return HoodCache::Memcached('master')->increment(self::makeKey($key, 'master'), $offset, $initialValue, $expiry); | ||
151 | + } | ||
152 | + | ||
153 | + /** | ||
154 | + * 递减 | ||
155 | + * | ||
156 | + * @param string $key | ||
157 | + * @param int $offset | ||
158 | + * @return boolean | ||
159 | + */ | ||
160 | + public static function decrement($key, $offset = 1) | ||
161 | + { | ||
162 | + return HoodCache::Memcached('master')->decrement(self::makeKey($key, 'master'), $offset); | ||
163 | + } | ||
164 | + | ||
165 | + /** | ||
166 | + * 生成键名 | ||
167 | + * | ||
168 | + * @param string $key 键名 | ||
169 | + * @param string $prefix 前缀标识 | ||
170 | + * @return string | ||
171 | + */ | ||
172 | + public static function makeKey($key, $prefix) | ||
173 | + { | ||
174 | + return md5($prefix . '_' . $key); | ||
175 | + } | ||
176 | + | ||
177 | +} |
1 | -<?php | ||
2 | - | ||
3 | -namespace WebPlugin; | ||
4 | - | ||
5 | -use Hood\Cache as HoodCache; | ||
6 | - | ||
7 | -/** | ||
8 | - * 数据缓存的操作类 | ||
9 | - * | ||
10 | - * @name Cache | ||
11 | - * @package Plugin | ||
12 | - * @copyright yoho.inc | ||
13 | - * @version 1.0 (2015-10-10 11:23:47) | ||
14 | - * @author fei.hong <fei.hong@yoho.cn> | ||
15 | - */ | ||
16 | -class Cache | ||
17 | -{ | ||
18 | - | ||
19 | - /** | ||
20 | - * 设置缓存 | ||
21 | - * | ||
22 | - * 备注: | ||
23 | - * 采用主从分布式缓存 | ||
24 | - * master 代表主缓存服务器 | ||
25 | - * slave 代表从缓存服务器 | ||
26 | - * | ||
27 | - * 作用: | ||
28 | - * 在后端的服务异常挂掉了并且主服务器缓存(master)的数据时间到期后, | ||
29 | - * 能获取从服务器缓存(slave)的数据,不影响前端页面的正常访问. | ||
30 | - * | ||
31 | - * @param string $key 键名 | ||
32 | - * @param mixed $value 需要缓存的数据 | ||
33 | - * @param int $expire 缓存有效期(单位秒, 0表示永久) | ||
34 | - * @return void | ||
35 | - */ | ||
36 | - public static function set($key, $value, $expire = 300) | ||
37 | - { | ||
38 | - if (USE_CACHE) { | ||
39 | - try { | ||
40 | - // WINDOWS | ||
41 | - if (DIRECTORY_SEPARATOR === '\\') { | ||
42 | - HoodCache::Memcache('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
43 | - HoodCache::Memcache('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
44 | - } | ||
45 | - // LINUX | ||
46 | - else { | ||
47 | - HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
48 | - HoodCache::Memcached('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
49 | - } | ||
50 | - } catch (Exception $e) { | ||
51 | - // do nothing | ||
52 | - } | ||
53 | - } | ||
54 | - } | ||
55 | - | ||
56 | - /** | ||
57 | - * 获取缓存 | ||
58 | - * | ||
59 | - * @param string $key 键名 | ||
60 | - * @param string $node master代表主服务器, slave代表从服务器 | ||
61 | - * @return mixed | ||
62 | - */ | ||
63 | - public static function get($key, $node = 'master') | ||
64 | - { | ||
65 | - $result = array(); | ||
66 | - | ||
67 | - if (USE_CACHE) { | ||
68 | - try { | ||
69 | - // WINDOWS | ||
70 | - if (DIRECTORY_SEPARATOR === '\\') { | ||
71 | - $result = HoodCache::Memcache($node)->get(self::makeKey($key, $node)); | ||
72 | - } | ||
73 | - // LINUX | ||
74 | - else { | ||
75 | - $result = HoodCache::Memcached($node)->get(self::makeKey($key, $node)); | ||
76 | - } | ||
77 | - } catch (Exception $e) { | ||
78 | - $result = array(); | ||
79 | - } | ||
80 | - } | ||
81 | - | ||
82 | - return $result; | ||
83 | - } | ||
84 | - | ||
85 | - /** | ||
86 | - * 清除缓存 | ||
87 | - * | ||
88 | - * @param string $key 键名 | ||
89 | - * @return void | ||
90 | - */ | ||
91 | - public static function delete($key) | ||
92 | - { | ||
93 | - if (USE_CACHE) { | ||
94 | - // WINDOWS | ||
95 | - if (DIRECTORY_SEPARATOR === '\\') { | ||
96 | - HoodCache::Memcache('master')->delete(self::makeKey($key, 'master')); | ||
97 | - HoodCache::Memcache('slave')->delete(self::makeKey($key, 'slave')); | ||
98 | - } | ||
99 | - // LINUX | ||
100 | - else { | ||
101 | - HoodCache::Memcached('master')->delete(self::makeKey($key, 'master')); | ||
102 | - HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave')); | ||
103 | - } | ||
104 | - } | ||
105 | - } | ||
106 | - | ||
107 | - /** | ||
108 | - * 生成键名 | ||
109 | - * | ||
110 | - * @param string $key 键名 | ||
111 | - * @param string $prefix 前缀标识 | ||
112 | - * @return string | ||
113 | - */ | ||
114 | - public static function makeKey($key, $prefix) | ||
115 | - { | ||
116 | - return md5($prefix . '_' . $key); | ||
117 | - } | ||
118 | - | ||
119 | - /** | ||
120 | - * 累加 | ||
121 | - * | ||
122 | - * @param string $key | ||
123 | - * @param int $offset | ||
124 | - * @param int $initialValue | ||
125 | - * @param int $expiry | ||
126 | - * @return boolean | ||
127 | - */ | ||
128 | - public static function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
129 | - { | ||
130 | - return HoodCache::Memcached('master')->increment(self::makeKey($key, 'master'), $offset, $initialValue, $expiry); | ||
131 | - } | ||
132 | - | ||
133 | - /** | ||
134 | - * 递减 | ||
135 | - * | ||
136 | - * @param string $key | ||
137 | - * @param int $offset | ||
138 | - * @return boolean | ||
139 | - */ | ||
140 | - public static function decrement($key, $offset = 1) | ||
141 | - { | ||
142 | - return HoodCache::Memcached('master')->decrement(self::makeKey($key, 'master'), $offset); | ||
143 | - } | ||
144 | - | ||
145 | -} | 1 | +<?php |
2 | + | ||
3 | +namespace WebPlugin; | ||
4 | + | ||
5 | +use Hood\Cache as HoodCache; | ||
6 | + | ||
7 | +/** | ||
8 | + * 数据缓存的操作类 | ||
9 | + * | ||
10 | + * @name Cache | ||
11 | + * @package Plugin | ||
12 | + * @copyright yoho.inc | ||
13 | + * @version 1.0 (2015-10-10 11:23:47) | ||
14 | + * @author fei.hong <fei.hong@yoho.cn> | ||
15 | + */ | ||
16 | +class Cache | ||
17 | +{ | ||
18 | + | ||
19 | + /** | ||
20 | + * 设置缓存 | ||
21 | + * | ||
22 | + * 备注: | ||
23 | + * 采用主从分布式缓存 | ||
24 | + * master 代表主缓存服务器 | ||
25 | + * slave 代表从缓存服务器 | ||
26 | + * | ||
27 | + * 作用: | ||
28 | + * 在后端的服务异常挂掉了并且主服务器缓存(master)的数据时间到期后, | ||
29 | + * 能获取从服务器缓存(slave)的数据,不影响前端页面的正常访问. | ||
30 | + * | ||
31 | + * @param string $key 键名 | ||
32 | + * @param mixed $value 需要缓存的数据 | ||
33 | + * @param int $expire 缓存有效期(单位秒, 0表示永久) | ||
34 | + * @return void | ||
35 | + */ | ||
36 | + public static function set($key, $value, $expire = 300) | ||
37 | + { | ||
38 | + if (USE_CACHE) { | ||
39 | + try { | ||
40 | + // WINDOWS | ||
41 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
42 | + HoodCache::Memcache('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
43 | + HoodCache::Memcache('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
44 | + } | ||
45 | + // LINUX | ||
46 | + else { | ||
47 | + HoodCache::Memcached('master')->set(self::makeKey($key, 'master'), $value, $expire); | ||
48 | + HoodCache::Memcached('slave')->set(self::makeKey($key, 'slave'), $value, 86400); // 二级缓存1天 | ||
49 | + } | ||
50 | + } catch (Exception $e) { | ||
51 | + // do nothing | ||
52 | + } | ||
53 | + } | ||
54 | + } | ||
55 | + | ||
56 | + /** | ||
57 | + * 获取缓存 | ||
58 | + * | ||
59 | + * @param string $key 键名 | ||
60 | + * @param string $node master代表主服务器, slave代表从服务器 | ||
61 | + * @return mixed | ||
62 | + */ | ||
63 | + public static function get($key, $node = 'master') | ||
64 | + { | ||
65 | + $result = array(); | ||
66 | + | ||
67 | + if (USE_CACHE) { | ||
68 | + try { | ||
69 | + // WINDOWS | ||
70 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
71 | + $result = HoodCache::Memcache($node)->get(self::makeKey($key, $node)); | ||
72 | + } | ||
73 | + // LINUX | ||
74 | + else { | ||
75 | + $result = HoodCache::Memcached($node)->get(self::makeKey($key, $node)); | ||
76 | + } | ||
77 | + } catch (Exception $e) { | ||
78 | + $result = array(); | ||
79 | + } | ||
80 | + } | ||
81 | + | ||
82 | + return $result; | ||
83 | + } | ||
84 | + | ||
85 | + /** | ||
86 | + * 直接查询缓存,不对key做任何处理 | ||
87 | + */ | ||
88 | + public static function getBy($key, $node = 'master') | ||
89 | + { | ||
90 | + $result = array(); | ||
91 | + | ||
92 | + try { | ||
93 | + // WINDOWS | ||
94 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
95 | + $result = HoodCache::Memcache($node)->getBy($key); | ||
96 | + } | ||
97 | + // LINUX | ||
98 | + else { | ||
99 | + $result = HoodCache::Memcached($node)->getBy($key); | ||
100 | + } | ||
101 | + } catch (Exception $e) { | ||
102 | + $result = array(); | ||
103 | + } | ||
104 | + | ||
105 | + return $result; | ||
106 | + } | ||
107 | + | ||
108 | + /** | ||
109 | + * 清除缓存 | ||
110 | + * | ||
111 | + * @param string $key 键名 | ||
112 | + * @return void | ||
113 | + */ | ||
114 | + public static function delete($key) | ||
115 | + { | ||
116 | + if (USE_CACHE) { | ||
117 | + // WINDOWS | ||
118 | + if (DIRECTORY_SEPARATOR === '\\') { | ||
119 | + HoodCache::Memcache('master')->delete(self::makeKey($key, 'master')); | ||
120 | + HoodCache::Memcache('slave')->delete(self::makeKey($key, 'slave')); | ||
121 | + } | ||
122 | + // LINUX | ||
123 | + else { | ||
124 | + HoodCache::Memcached('master')->delete(self::makeKey($key, 'master')); | ||
125 | + HoodCache::Memcached('slave')->delete(self::makeKey($key, 'slave')); | ||
126 | + } | ||
127 | + } | ||
128 | + } | ||
129 | + | ||
130 | + /** | ||
131 | + * 生成键名 | ||
132 | + * | ||
133 | + * @param string $key 键名 | ||
134 | + * @param string $prefix 前缀标识 | ||
135 | + * @return string | ||
136 | + */ | ||
137 | + public static function makeKey($key, $prefix) | ||
138 | + { | ||
139 | + return md5($prefix . '_' . $key); | ||
140 | + } | ||
141 | + | ||
142 | + /** | ||
143 | + * 累加 | ||
144 | + * | ||
145 | + * @param string $key | ||
146 | + * @param int $offset | ||
147 | + * @param int $initialValue | ||
148 | + * @param int $expiry | ||
149 | + * @return boolean | ||
150 | + */ | ||
151 | + public static function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
152 | + { | ||
153 | + return HoodCache::Memcached('master')->increment(self::makeKey($key, 'master'), $offset, $initialValue, $expiry); | ||
154 | + } | ||
155 | + | ||
156 | + /** | ||
157 | + * 递减 | ||
158 | + * | ||
159 | + * @param string $key | ||
160 | + * @param int $offset | ||
161 | + * @return boolean | ||
162 | + */ | ||
163 | + public static function decrement($key, $offset = 1) | ||
164 | + { | ||
165 | + return HoodCache::Memcached('master')->decrement(self::makeKey($key, 'master'), $offset); | ||
166 | + } | ||
167 | + | ||
168 | +} |
1 | -<?xml version="1.0" standalone="no"?> | ||
2 | -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > | ||
3 | -<svg xmlns="http://www.w3.org/2000/svg"> | ||
4 | -<metadata> | ||
5 | -Created by FontForge 20120731 at Thu Jul 14 10:27:46 2016 | ||
6 | - By admin | ||
7 | -</metadata> | ||
8 | -<defs> | ||
9 | -<font id="iconfont" horiz-adv-x="1024" > | ||
10 | - <font-face | ||
11 | - font-family="iconfont" | ||
12 | - font-weight="500" | ||
13 | - font-stretch="normal" | ||
14 | - units-per-em="1024" | ||
15 | - panose-1="2 0 6 3 0 0 0 0 0 0" | ||
16 | - ascent="896" | ||
17 | - descent="-128" | ||
18 | - x-height="792" | ||
19 | - bbox="-0.75 -212 1160 896.75" | ||
20 | - underline-thickness="50" | ||
21 | - underline-position="-100" | ||
22 | - unicode-range="U+0078-E63E" | ||
23 | - /> | ||
24 | -<missing-glyph horiz-adv-x="374" | ||
25 | -d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> | ||
26 | - <glyph glyph-name=".notdef" horiz-adv-x="374" | ||
27 | -d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> | ||
28 | - <glyph glyph-name=".null" horiz-adv-x="0" | ||
29 | - /> | ||
30 | - <glyph glyph-name="nonmarkingreturn" horiz-adv-x="341" | ||
31 | - /> | ||
32 | - <glyph glyph-name="x" unicode="x" horiz-adv-x="1001" | ||
33 | -d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5 | ||
34 | -t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5 | ||
35 | -t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" /> | ||
36 | - <glyph glyph-name="uniE600" unicode="" | ||
37 | -d="M286 509l-46 -45l272 -272l272 272l-46 45l-226 -226z" /> | ||
38 | - <glyph glyph-name="uniE601" unicode="" | ||
39 | -d="M387 158l45 -46l272 272l-272 272l-45 -46l226 -226z" /> | ||
40 | - <glyph glyph-name="uniE602" unicode="" | ||
41 | -d="M766 193l-196 192l196 192l-61 60l-196 -193l-196 193l-60 -60l196 -192l-196 -192l60 -59l196 192l196 -192z" /> | ||
42 | - <glyph glyph-name="uniE603" unicode="" | ||
43 | -d="M951 77h-878l439 614z" /> | ||
44 | - <glyph glyph-name="uniE604" unicode="" | ||
45 | -d="M512 77l-439 614h878z" /> | ||
46 | - <glyph glyph-name="uniE605" unicode="" | ||
47 | -d="M819 823v-878l-614 439z" /> | ||
48 | - <glyph glyph-name="uniE606" unicode="" | ||
49 | -d="M205 -55v878l614 -439z" /> | ||
50 | - <glyph glyph-name="uniE607" unicode="" | ||
51 | -d="M786 789l-415 -405l415 -404q19 -18 19 -44t-19 -44.5t-46 -18.5t-46 18l-461 449q-19 18 -19 44.5t19 44.5l461 449q19 18 46 18t46 -18.5t19 -44.5t-19 -44zM786 789z" /> | ||
52 | - <glyph glyph-name="uniE608" unicode="" | ||
53 | -d="M233 789q-19 18 -19 44t19 44.5t46 18.5t46 -18l461 -449q19 -18 19 -44.5t-19 -44.5l-461 -449q-19 -18 -46 -18t-46 18.5t-19 44.5t19 44l416 404zM233 789z" /> | ||
54 | - <glyph glyph-name="uniE609" unicode="" | ||
55 | -d="M577 -118q-17 0 -30 11q-16 12 -18 31.5t11 35.5l357 443l-350 404q-13 15 -11.5 34.5t16.5 32.5t34.5 11.5t32.5 -16.5l376 -433q12 -13 12 -30.5t-11 -30.5l-382 -475q-14 -18 -37 -18z" /> | ||
56 | - <glyph glyph-name="uniE60A" unicode="" | ||
57 | -d="M447 -118q-23 0 -37 18l-382 475q-11 13 -11 30.5t12 30.5l376 433q13 15 32.5 16.5t34.5 -11.5t16.5 -32.5t-11.5 -34.5l-350 -404l357 -443q13 -16 11 -35.5t-18 -31.5q-13 -11 -30 -11z" /> | ||
58 | - <glyph glyph-name="uniE60B" unicode="" | ||
59 | -d="M284 15q-14 -14 -14 -33t13.5 -32.5t32.5 -13.5t32 14l397 401q13 14 13 33t-13 33l-397 401q-13 14 -32 14t-32.5 -13.5t-13.5 -32.5t13 -33l351 -369l-350 -369v0zM284 15z" /> | ||
60 | - <glyph glyph-name="uniE60C" unicode="" | ||
61 | -d="M745 753q13 14 13 33t-13.5 32.5t-32.5 13.5t-32 -14l-396 -401q-14 -14 -14 -33t14 -33l396 -401q14 -14 32.5 -14t32 13.5t13.5 32.5t-13 33l-351 369l351 369v0zM745 753z" /> | ||
62 | - <glyph glyph-name="uniE60D" unicode="" | ||
63 | -d="M512.5 750q-12.5 0 -21.5 -9t-9 -22v-311h-249q-12 0 -21.5 -9t-9.5 -22t9.5 -22t21.5 -9h280q12 0 21.5 9t9.5 22v342q0 13 -9.5 22t-22 9zM513 874q-101 0 -193 -39.5t-158.5 -105.5t-106 -158t-39.5 -193t39.5 -193t106 -158.5t158.5 -105.5t193 -39t192.5 39 | ||
64 | -t158 105.5t106 158.5t39.5 193t-39.5 193t-106 158t-158 105.5t-192.5 39.5zM513 -56q-118 0 -218 58t-158.5 158t-58.5 218t58.5 218t158.5 158t218 58t218 -58t158 -158t58 -218t-58 -218t-158 -158t-218 -58z" /> | ||
65 | - <glyph glyph-name="uniE60E" unicode="" | ||
66 | -d="M710 384l-473 474l38 38l512 -512l-512 -512l-38 38z" /> | ||
67 | - <glyph glyph-name="uniE60F" unicode="" | ||
68 | -d="M314 384l473 -474l-38 -38l-512 512l512 512l38 -38z" /> | ||
69 | - <glyph glyph-name="uniE610" unicode="" | ||
70 | -d="M797 219.5q0 -7.5 -5 -13.5l-29 -28q-6 -6 -13.5 -6t-12.5 6l-225 224l-224 -224q-6 -6 -13.5 -6t-13.5 6l-28 28q-6 6 -6 13.5t6 13.5l266 266q6 6 13.5 6t12.5 -6l267 -266q5 -6 5 -13.5z" /> | ||
71 | - <glyph glyph-name="uniE611" unicode="" | ||
72 | -d="M892 125l-236 236q54 77 54 172q0 124 -87 211t-210.5 87t-211 -87t-87.5 -211t87.5 -211t210.5 -87q95 0 173 55l236 -236q16 -17 38 -18t37 14t14 37t-18 38zM213 533q0 82 58.5 140.5t140.5 58.5t140.5 -58.5t58.5 -140.5t-58.5 -140.5t-140.5 -58.5t-140.5 58.5 | ||
73 | -t-58.5 140.5z" /> | ||
74 | - <glyph glyph-name="uniE612" unicode="" | ||
75 | -d="M939 -128h-854q-35 0 -60 25t-25 60v854q0 35 25 60t60 25h854q35 0 60 -25t25 -60v-854q0 -35 -25 -60t-60 -25zM939 789q0 10 -6 16t-16 6h-810q-10 0 -16 -6t-6 -16v-810q0 -10 6 -16t16 -6h810q10 0 16 6t6 16v810zM457 183q-10 -12 -30.5 -12t-29.5 12l-171 171 | ||
76 | -q-13 10 -13 30q0 18 12.5 30.5t30.5 12.5q20 0 30 -13l141 -141l311 312q13 12 30 12q18 0 30.5 -12.5t12.5 -29.5q0 -21 -13 -30z" /> | ||
77 | - <glyph glyph-name="uniE613" unicode="" | ||
78 | -d="M877 896h-730q-61 0 -104 -43t-43 -104v-730q0 -61 43 -104t104 -43h730q61 0 104 43t43 104v730q0 61 -43 104t-104 43zM939 19q0 -26 -18 -44t-44 -18h-730q-26 0 -44 18t-18 44v730q0 26 18 44t44 18h730q26 0 44 -18t18 -44v-730z" /> | ||
79 | - <glyph glyph-name="uniE614" unicode="" | ||
80 | -d="M160 996zM865 247q0 -18 -13 -31l-308 -308q-13 -13 -31 -13t-31 13l-309 308q-13 13 -13 31t13.5 31t30.5 13h617q18 0 31 -13t13 -31zM865 511q0 -18 -13 -31t-31 -13h-617q-18 0 -31 13t-13 31t13 31l309 309q13 13 31 13t31 -13l308 -309q13 -13 13 -31z" /> | ||
81 | - <glyph glyph-name="uniE615" unicode="" | ||
82 | -d="M704 665l-41 39l-343 -320l343 -320l41 39l-301 281z" /> | ||
83 | - <glyph glyph-name="uniE616" unicode="" horiz-adv-x="1173" | ||
84 | -d="M569 607q-28 66 -74 108.5t-95 56.5t-100 2.5t-91.5 -45t-66 -94t-26.5 -137.5q0 -36 8.5 -67.5t26 -58t35.5 -47t46.5 -41t49 -34t52.5 -32.5t48 -30q71 -47 124.5 -106.5t63.5 -93.5q7 31 62.5 92t124.5 110q19 14 55.5 36.5t61 38.5t55 42.5t49 52t31.5 62.5t13 79 | ||
85 | -q0 76 -26.5 136t-67 92t-92 42.5t-101 -4t-94.5 -56t-72 -104.5z" /> | ||
86 | - <glyph glyph-name="uniE617" unicode="" | ||
87 | -d="M500 775l-348 -298q-16 -14 -16 -35v-386q0 -25 17.5 -42.5t42.5 -17.5h197v257h238v-257h197q25 0 42.5 17.5t17.5 42.5v386q0 21 -16 35l-348 298q-12 10 -24 0z" /> | ||
88 | - <glyph glyph-name="uniE618" unicode="" horiz-adv-x="1000" | ||
89 | -d="M751 766q21 -20 34 -33t19.5 -22.5t8.5 -16t2 -10.5v-13h-119q-8 0 -14 6t-10 14t-6 16.5t-2 12.5v100h3q6 0 13 -2t15.5 -8t22 -16t33.5 -28zM614 720q0 -16 5 -33.5t15 -32t26 -24t38 -9.5h117v-451q0 -24 -9.5 -42t-24.5 -31t-33.5 -20t-35.5 -7h-394q-15 0 -33 8.5 | ||
90 | -t-33.5 23t-26 33t-10.5 38.5v543q0 17 7.5 35t21 33.5t30 25.5t35.5 10h305v-100zM664 221q21 0 35.5 14.5t14.5 35.5t-14.5 35.5t-35.5 14.5h-299q-21 0 -35.5 -14.5t-14.5 -35.5t14.5 -35.5t35.5 -14.5h299zM714 470q0 21 -14.5 36t-35.5 15h-299q-21 0 -35.5 -15 | ||
91 | -t-14.5 -36t14.5 -35t35.5 -14h299q21 0 35.5 14t14.5 35zM714 470z" /> | ||
92 | - <glyph glyph-name="uniE619" unicode="" | ||
93 | -d="M512 599q47 0 88 -18t72 -49t49 -72t18 -89q0 -46 -18 -87t-49 -72t-72 -49t-88 -18t-88 18t-72 49t-49 72t-18 87q0 48 18 89t49 72t72 49t88 18v0zM512 599z" /> | ||
94 | - <glyph glyph-name="uniE61A" unicode="" | ||
95 | -d="M903 577l-68 69l-388 -388l-231 230l-68 -68l299 -298l65 65z" /> | ||
96 | - <glyph glyph-name="uniE61B" unicode="" | ||
97 | -d="M505 337l2 -2q2 -1 3.5 -1t3.5 1l430 364q2 2 1 5.5t-5 3.5h-435h-424q-4 0 -5 -3.5t1 -5.5zM72 669q-3 2 -6 0.5t-3 -4.5v-584q0 -4 3.5 -5t5.5 1l288 346zM953 669.5q-3 1.5 -5 -0.5l-288 -246l287 -346q3 -2 6 -1t3 5v584q0 3 -3 4.5zM641 406l-131 -111l-5 5 | ||
98 | -l-125 103l-275 -328q-2 -3 -1 -6t5 -3h396h407q4 0 5 3t-1 6z" /> | ||
99 | - <glyph glyph-name="uniE61C" unicode="" | ||
100 | -d="M982 137l-4 6l-10 12q-12 13 -42 38q-43 36 -79 59l-48 31l-21 11q-17 8 -36 1q-16 -5 -23 -18l-17 -25q-4 -6 -8 -13l-12 -24q-9 -18 -15 -28q-7 -14 -21 -24t-32 -13.5t-36 7.5q-102 57 -171 123q-101 95 -135 172q-8 13 -1.5 37t26.5 34q13 7 34.5 15.5t31.5 14.5 | ||
101 | -q7 4 14.5 8.5t18.5 11.5l4 3l4 3l3 3q19 18 9 43l-3 8q-14 32 -36 69q-17 30 -41 62q-16 21 -32.5 36t-25.5 20l-9 5q-9 5 -13 7q-23 10 -50 -1q-15 -6 -30.5 -15.5t-22 -14.5t-26.5 -21q-44 -37 -69.5 -82.5t-19.5 -86.5q10 -72 88 -198.5t182.5 -225.5t237.5 -173t209 -84 | ||
102 | -q79 -10 169 73q38 36 56 73q6 14 7.5 30t-5.5 31zM982 137z" /> | ||
103 | - <glyph glyph-name="uniE61D" unicode="" | ||
104 | -d="M888 620q12 12 28.5 12t28.5 -12t12 -28.5t-12 -28.5l-406 -405q-12 -12 -28.5 -12t-27.5 12q-12 11 -12 27.5t12 28.5zM539 214q11 -12 11 -28.5t-11 -27.5q-12 -12 -28.5 -12t-28.5 12l-406 405q-11 12 -11 28.5t11 28.5q12 12 28.5 12t28.5 -12zM539 214z" /> | ||
105 | - <glyph glyph-name="uniE61E" unicode="" | ||
106 | -d="M127 769v-770h770v770h-770zM555 170h-86v86h86v-86zM555 298h-86v257h86v-257z" /> | ||
107 | - <glyph glyph-name="uniE61F" unicode="" | ||
108 | -d="M511.5 831q-90.5 0 -173.5 -35.5t-143 -95t-95 -142.5t-35 -174t35 -173.5t95 -142.5t143 -95.5t173.5 -35.5t173.5 35.5t143 95.5t95 142.5t35.5 173.5t-35 174t-95.5 142.5t-143 95t-173.5 35.5zM452 184h-1v0l-38 38l-179 180l38 37l179 -179l318 318l38 -38zM512 -63 | ||
109 | -q-91 0 -175 35q-80 34 -142 96t-96 142q-35 83 -35 174t35 174q34 81 96 142.5t142 95.5q84 36 175 36t174 -36q80 -34 142 -95.5t96 -142.5q35 -83 35 -174t-35 -174q-34 -80 -96 -142t-142 -96q-83 -35 -174 -35zM511.5 831q-90.5 0 -173 -35.5t-142.5 -95.5t-95.5 -142.5 | ||
110 | -t-35.5 -173.5t35.5 -173.5t95.5 -142.5t142.5 -95t173 -35t173.5 35t142.5 95t95 142.5t35.5 173.5t-35.5 173.5t-95 142.5t-142.5 95.5t-173.5 35.5zM451 183l-38 39l-180 180l39 38l179 -180l318 318l39 -38zM414 222l37 -37l355 355l-37 37l-318 -318l-179 180l-38 -37z | ||
111 | -" /> | ||
112 | - <glyph glyph-name="uniE620" unicode="" | ||
113 | -d="M958 758q0 30 -21 51.5t-51 21.5h-749q-30 0 -51 -21.5t-21 -51.5v-748q0 -30 21 -51t51 -21h749q30 0 51 21t21 51v748zM778 454l-267 -267q-14 -14 -34 -14t-34 14l-168 168q-14 14 -14 34t14 34.5t34 14.5t34 -15l134 -133l233 232q14 14 34 14t34 -14t14 -34t-14 -34 | ||
114 | -z" /> | ||
115 | - <glyph glyph-name="uniE621" unicode="" | ||
116 | -d="M384 640v-513l321 257z" /> | ||
117 | - <glyph glyph-name="uniE622" unicode="" horiz-adv-x="1000" | ||
118 | -d="M662 662v-499l-299 250zM662 662z" /> | ||
119 | - <glyph glyph-name="uniE623" unicode="" horiz-adv-x="1000" | ||
120 | -d="M744 598h-488q-38 0 -64.5 -26.5t-26.5 -64.5v-290q0 -38 26.5 -64.5t64.5 -26.5h227l200 -138v138h61q38 0 64.5 26.5t26.5 64.5v290q0 38 -26.5 64.5t-64.5 26.5zM744 358z" /> | ||
121 | - <glyph glyph-name="uniE624" unicode="" horiz-adv-x="1025" | ||
122 | -d="M1024 480v338q0 32 -23 55t-55 23h-331h-14q-55 0 -76 -21l-506 -506q-19 -19 -19 -46t19 -45l387 -387q18 -19 45 -19t46 19l506 506q10 10 15 25.5t5.5 26.5t0.5 31zM764 549q-36 0 -61.5 25.5t-25.5 61.5t25.5 61t61.5 25t61 -25t25 -61t-25 -61.5t-61 -25.5z" /> | ||
123 | - <glyph glyph-name="uniE625" unicode="" | ||
124 | -d="M511 832q-91 0 -173.5 -35.5t-142 -95t-95 -142t-35.5 -173.5t35.5 -173.5t95 -142t142 -95t173.5 -35.5t173.5 35.5t142.5 95t95 142t35 173.5t-35 173.5t-95 142t-142.5 95t-173.5 35.5zM734 337h-237q-7 0 -14 3q-22 9 -22 33v237q0 15 10.5 26t26 11t26 -11t10.5 -26 | ||
125 | -v-200h200q15 0 26 -10.5t11 -26t-11 -26t-26 -10.5zM734 337z" /> | ||
126 | - <glyph glyph-name="uniE626" unicode="" horiz-adv-x="1025" | ||
127 | -d="M994 163q-18 9 -16 30.5t27 46.5q24 27 17.5 54.5t-33.5 40.5q-17 8 -24.5 17.5t-2 20t26.5 19.5q30 11 29.5 55.5t-31.5 80.5q-34 39 -278 23l-23 -1q3 2 3 145q0 101 -28 139t-84 36q-18 0 -28.5 -5t-17 -13t-11 -26.5t-7.5 -38t-10 -56.5t-16 -74q-12 -47 -38 -94 | ||
128 | -t-54 -80t-55 -59t-44 -39l-18 -13v-386q10 -14 27 -25.5t31 -17t31 -11.5t21 -8q9 -4 65 -10.5t105.5 -11t51.5 -4.5q4 0 11 0.5t30 2.5t45 4.5t52 6.5t56.5 8t53.5 9.5t47 11t33.5 13t15.5 14.5q8 24 3 39t-2 27t23 20q27 10 34.5 34.5t0.5 46t-19 28.5zM0 379v-380 | ||
129 | -q0 -28 20 -48.5t49 -20.5h137v518h-137q-29 0 -49 -20.5t-20 -48.5zM0 379z" /> | ||
130 | - <glyph glyph-name="uniE627" unicode="" horiz-adv-x="1025" | ||
131 | -d="M512 719q-167 0 -304.5 -89.5t-205.5 -236.5q-4 -9 0 -18q68 -147 205.5 -236.5t304.5 -89.5t304.5 89.5t205.5 236.5q4 9 0 18q-68 147 -205.5 236.5t-304.5 89.5zM512 153q-96 0 -163.5 67.5t-67.5 163.5t67.5 163.5t163.5 67.5t163.5 -67.5t67.5 -163.5t-67.5 -163.5 | ||
132 | -t-163.5 -67.5zM512 384zM364 384q0 61 43.5 104.5t104.5 43.5t104.5 -43.5t43.5 -104.5t-43.5 -104.5t-104.5 -43.5t-104.5 43.5t-43.5 104.5z" /> | ||
133 | - <glyph glyph-name="uniE628" unicode="" | ||
134 | -d="M482.5 167q-24.5 0 -42 -17.5t-17.5 -42.5t17.5 -42.5t42 -17.5t42 17.5t17.5 42.5t-17.5 42.5t-42 17.5zM769 167q-25 0 -42.5 -17.5t-17.5 -42.5t17.5 -42.5t42.5 -17.5t42.5 17.5t17.5 42.5t-17.5 42.5t-42.5 17.5zM839 277h-417l-143 425q-7 18 -29 18h-127 | ||
135 | -q-13 0 -22 -8t-9 -20.5t9 -20.5t22 -8h105l143 -424q7 -19 29 -19h439q13 0 21.5 8t8.5 20.5t-8.5 20.5t-21.5 8zM904 608l-516 45q-12 1 -18.5 -7t-1.5 -20l90 -270q4 -12 16 -21.5t24 -9.5h377q12 0 22 10t11 23l23 216q2 12 -6 22t-21 12z" /> | ||
136 | - <glyph glyph-name="uniE629" unicode="" | ||
137 | -d="M154 770v-646h146l-14 -208l240 208h344v646h-716zM752 260h-134v159h-192v-159h-134v382h134v-148h192v148h134v-382z" /> | ||
138 | - <glyph glyph-name="uniE62A" unicode="" | ||
139 | -d="M328 18q-6 0 -11 3q-14 6 -14 22v128h-193q-10 0 -17.5 7t-7.5 18v549q0 10 7.5 17.5t17.5 7.5h804q11 0 18 -7.5t7 -17.5v-549q0 -11 -7 -18t-18 -7h-401l-169 -146q-7 -7 -16 -7zM171 256h188q10 0 17.5 -7.5t7.5 -17.5v-73l103 92q7 6 17 6h350v426h-683v-426z | ||
140 | -M739 569h-454q-10 0 -17.5 7t-7.5 17.5t7.5 18t17.5 7.5h454q10 0 17.5 -7.5t7.5 -18t-7 -17.5t-18 -7zM739 446h-454q-10 0 -17.5 7t-7.5 17.5t7.5 18t17.5 7.5h454q10 0 17.5 -7.5t7.5 -18t-7 -17.5t-18 -7zM549 323h-264q-10 0 -17.5 7t-7.5 17.5t7.5 18t17.5 7.5h264 | ||
141 | -q10 0 17.5 -7.5t7.5 -17.5t-7.5 -17.5t-17.5 -7.5z" /> | ||
142 | - <glyph glyph-name="uniE62B" unicode="" | ||
143 | -d="M510.5 -60q-90.5 0 -173 35.5t-142.5 95.5t-95.5 142.5t-35.5 173t35.5 173t95.5 142.5t142.5 95.5t173 35.5t173.5 -35.5t142.5 -95.5t95 -142.5t35.5 -173t-35.5 -173t-95 -142.5t-142.5 -95.5t-173.5 -35.5zM510.5 787q-108.5 0 -200.5 -53.5t-146 -146t-54 -201 | ||
144 | -t54 -201t146 -146t200.5 -53.5t201 53.5t146 146t53.5 201t-53.5 201t-146 146t-201 53.5zM465 248v29q0 19 3 33q3 15 9 28q5 14 15 26t24 26l35 33q15 13 25.5 29.5t10.5 39.5q0 30 -19 50.5t-54 20.5q-18 0 -32 -6.5t-24.5 -17.5t-16.5 -26q-5 -15 -6 -30l-95 8 | ||
145 | -q5 37 20 66t39 49t55 31q31 10 66 10q33 0 63 -9.5t53 -28.5t36 -46.5t13 -64.5q0 -25 -5.5 -43t-15.5 -34t-24 -30q-15 -15 -32 -30q-16 -13 -25.5 -23t-15.5 -20t-8 -21.5t-2 -28.5v-20h-92zM450 140q0 25 18 43t44 18q24 0 43 -17t19 -42t-18.5 -42.5t-43.5 -17.5 | ||
146 | -q-12 0 -23.5 4.5t-20.5 12.5q-8 7 -13 18t-5 23z" /> | ||
147 | - <glyph glyph-name="uniE62C" unicode="" | ||
148 | -d="M505 860q95 0 182 -37t150 -100t100.5 -150t37.5 -182t-37.5 -182t-100.5 -150t-150 -100.5t-182 -37.5t-182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -20q112 0 206.5 55t149.5 149.5t55 206t-55 206t-149.5 149.5t-206 55t-206 -55 | ||
149 | -t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 222v-59h-58v59h58zM470 648h58v-349h-58v349z" /> | ||
150 | - <glyph glyph-name="uniE62D" unicode="" | ||
151 | -d="M828 702q65 -65 98 -148t33 -169t-33 -169t-98 -148q-66 -66 -149 -98.5t-169 -32.5t-168.5 32.5t-148.5 97.5q-66 66 -98.5 149t-32.5 169t32.5 169t98.5 149q66 65 148.5 97.5t168.5 32.5t169 -32.5t149 -98.5v0zM258 133q53 -53 118.5 -79t134.5 -26t134.5 26 | ||
152 | -t118 78.5t78.5 118t26 134.5t-26 134.5t-78 118.5q-53 53 -119 79t-134.5 26t-134.5 -26t-118 -78.5t-78.5 -118t-26.5 -134.5t26.5 -134.5t78.5 -118.5v0zM748 686l69 -72l-531 -530l-70 70zM748 686z" /> | ||
153 | - <glyph glyph-name="uniE62E" unicode="" horiz-adv-x="1025" | ||
154 | -d="M491 6q9 -10 21.5 -10t21.5 10l357 407q9 10 5.5 17.5t-17.5 7.5h-133q-14 0 -23.5 9.5t-9.5 22.5v261q0 13 -10 22.5t-24 9.5h-333q-14 0 -24 -9.5t-10 -22.5v-261q0 -13 -9.5 -22.5t-23.5 -9.5h-133q-14 0 -17.5 -7.5t5.5 -17.5z" /> | ||
155 | - <glyph glyph-name="uniE62F" unicode="" | ||
156 | -d="M512 809v0q-58 0 -112.5 -12t-105.5 -38t-80.5 -44t-77.5 -51v-450q0 -57 19.5 -110.5t49 -93.5t69 -76t75.5 -59.5t73.5 -43t57 -28t32.5 -12.5q13 4 32.5 12.5t57 28t73.5 43t75.5 59.5t69 76t49 93.5t19.5 110.5v450q-48 33 -77.5 51t-80.5 44t-105.5 38t-112.5 12z | ||
157 | -M808 214q0 -76 -36.5 -138t-112.5 -117q-73 -53 -147 -82q-74 29 -147 82q-76 55 -112.5 117t-36.5 138v421q87 53 146.5 75t149.5 23q90 -1 149.5 -23t146.5 -75v-421zM512 671q-67 0 -112.5 -12.5t-119.5 -49.5v-399q0 -35 12.5 -68.5t30 -57.5t44 -46t47 -35.5t46 -26 | ||
158 | -t34 -16t18.5 -6.5q10 3 18.5 6.5t34 16t46 26t47 35.5t44 46t30 57.5t12.5 68.5v399q-74 37 -119.5 49.5t-112.5 12.5v0zM667 515v-47h-105v-67h92v-61h-92v-77h116v-57h-332v57h42v168h64v-168h46v205h-138v61h307v-14z" /> | ||
159 | - <glyph glyph-name="uniE630" unicode="" horiz-adv-x="1163" | ||
160 | -d="M295 196q67 0 114 -47t47 -113.5t-47 -114t-114 -47.5t-114 47.5t-47 114t47 113.5t114 47zM917.5 196q66.5 0 113.5 -47t47 -113.5t-47 -114t-113.5 -47.5t-114 47.5t-47.5 114t47.5 113.5t114 47zM400 894v-99h-210v0l-187 -294v-372h95q27 56 80 90.5t117 34.5 | ||
161 | -t117 -34.5t80 -90.5h228q27 56 80 90.5t117.5 34.5t117.5 -34.5t79 -90.5h46v765h-760zM400 452h-283l159 250l124 1v-251v0zM893 701l-131 -276l-63 31l101 206h-105v68h198v-29v0z" /> | ||
162 | - <glyph glyph-name="uniE631" unicode="" | ||
163 | -d="M799 456l127 127v313h-830v-609l421 -413l409 404v181l-414 -401l-288 284v426h575v-312zM671 518l-107 22l-53 100l-52 -100l-108 -22l75 -83l-14 -114l99 49l99 -49l-14 114z" /> | ||
164 | - <glyph glyph-name="uniE632" unicode="" | ||
165 | -d="M512 769q-104 0 -192.5 -51.5t-140 -140t-51.5 -193t51.5 -193t140 -140t192.5 -51.5t192.5 51.5t140 140t51.5 193t-51.5 193t-140 140t-192.5 51.5zM660 181h-50v175h-196v-175h-50v395h50v-179h196v179h50v-395z" /> | ||
166 | - <glyph glyph-name="uniE633" unicode="" | ||
167 | -d="M1020 810q0 34 -24 58t-59 24h-851q-34 0 -58.5 -24t-24.5 -58v-852q0 -34 24.5 -58t58.5 -24h851q35 0 59 24t24 58v852zM815 464l-304 -304q-16 -16 -38.5 -16t-38.5 16l-191 191q-17 16 -17 39t16.5 39t39 16t38.5 -16l153 -152l264 264q16 16 39 16t39 -16t16 -38.5 | ||
168 | -t-16 -38.5z" /> | ||
169 | - <glyph glyph-name="uniE634" unicode="" | ||
170 | -d="M637 610l-45 46l-272 -272l272 -272l45 46l-226 226z" /> | ||
171 | - <glyph glyph-name="uniE635" unicode="" | ||
172 | -d="M0 896h1024v-1024h-1024v1024zM85 -43h854v854h-854v-854z" /> | ||
173 | - <glyph glyph-name="uniE636" unicode="" | ||
174 | -d="M1024 -128h-1024v1024h1024v-1024zM947 674l-34 34q-13 13 -30 13t-30 -13l-486 -495l-196 205q-13 13 -30 13t-30 -13l-34 -34q-13 -13 -13 -30t13 -30l256 -256q23 -22 51 -8q9 0 9 8l546 546q18 13 20 30.5t-12 29.5z" /> | ||
175 | - <glyph glyph-name="uniE637" unicode="" | ||
176 | -d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h448q9 0 15 6t6 14t-6 14t-15 6h-448q-9 0 -15 -6t-6 -14t6 -14t15 -6z" /> | ||
177 | - <glyph glyph-name="uniE638" unicode="" | ||
178 | -d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h204v-204q0 -9 6 -15t14 -6t14 6t6 15v204h204q9 0 15 6t6 14t-6 14t-15 6h-204v204q0 9 -6 15t-14 6t-14 -6t-6 -15v-204h-204q-9 0 -15 -6t-6 -14t6 -14t15 -6z" /> | ||
179 | - <glyph glyph-name="uniE639" unicode="" | ||
180 | -d="M774 201h-524l262 366z" /> | ||
181 | - <glyph glyph-name="uniE63A" unicode="" | ||
182 | -d="M512 188l-280 392h560z" /> | ||
183 | - <glyph glyph-name="uniE63B" unicode="" horiz-adv-x="1048" | ||
184 | -d="M297.5 528q-20.5 0 -35 -14.5t-14.5 -35t14.5 -35.5t35 -15t35.5 15t15 35.5t-15 35t-35.5 14.5zM381 251q0 96 84 164t202 68t202 -68t84 -163.5t-84 -163.5t-202 -68t-202 68t-84 163zM286 251q0 -17 2 -35v1q-88 42 -140.5 114t-52.5 157t51.5 157t139.5 114t192 42 | ||
185 | -q142 0 249.5 -76.5t128.5 -189.5q-88 43 -189 43q-104 0 -191.5 -43.5t-138.5 -119t-51 -164.5zM953 36q95 93 95 215t-94 214q2 20 2 23q0 111 -64 205t-174.5 148.5t-240 54.5t-239.5 -54.5t-174 -148.5t-64 -205q0 -78 33 -148.5t93 -125.5l-77 -123q-8 -12 -6.5 -26 | ||
186 | -t10.5 -25q13 -15 32 -15q9 0 18 4l180 80q4 2 7 4q20 -7 39 -12q48 -80 138.5 -128t199.5 -48q75 0 145 25q1 -1 2 -1l140 -62q8 -4 17 -4q20 0 32 15q10 10 11 24t-7 26zM527 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z | ||
187 | -M667 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11zM806 282q-16 0 -27 -11t-11 -27t11 -27.5t27 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z" /> | ||
188 | - <glyph glyph-name="uniE63C" unicode="" horiz-adv-x="1158" | ||
189 | -d="M1069 181h-245v378h132l113 -169v-209zM1158 417l-155 231h-268v-467h-45v508q0 20 -14 34t-34 14h-63l-67 -89h89v-467h-512v467h45l22 89h-108q-20 0 -34 -14t-14 -34v-549q0 -20 14 -34t34 -14h139q-33 -37 -33 -87q0 -53 37.5 -91t91 -38t91.5 38t38 91q0 50 -34 87 | ||
190 | -h264h191q-34 -37 -34 -87q0 -53 38 -91t91.5 -38t91 38t37.5 91q0 50 -33 87h134v325zM326 668q-89 -153 -94 -296v-12h129v12q0 43 17 112q17 68 39 116q27 61 67.5 118t62.5 79l4 3v96h-390l-2 -114h245q-33 -40 -78 -114z" /> | ||
191 | - <glyph glyph-name="uniE63D" unicode="" | ||
192 | -d="M875 126l-363 -164l-363 164v610q247 75 363 75t363 -75v-610zM930 808q-34 11 -84.5 26t-159.5 38.5t-174 23.5t-174 -23.5t-159.5 -38.5t-84.5 -26q-14 -4 -22 -15.5t-8 -25.5v-669q0 -27 25 -39l405 -183q9 -3 18 -3t18 3l405 183q25 12 25 39v669q0 14 -8 25.5 | ||
193 | -t-22 15.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119h151v83h-151v96h179z" /> | ||
194 | - <glyph glyph-name="uniE63E" unicode="" | ||
195 | -d="M866.5 747.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 199l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" /> | ||
196 | - </font> | ||
197 | -</defs></svg> | 1 | +<?xml version="1.0" standalone="no"?> |
2 | +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > | ||
3 | +<svg xmlns="http://www.w3.org/2000/svg"> | ||
4 | +<metadata> | ||
5 | +Created by FontForge 20120731 at Thu Jul 14 10:27:46 2016 | ||
6 | + By admin | ||
7 | +</metadata> | ||
8 | +<defs> | ||
9 | +<font id="iconfont" horiz-adv-x="1024" > | ||
10 | + <font-face | ||
11 | + font-family="iconfont" | ||
12 | + font-weight="500" | ||
13 | + font-stretch="normal" | ||
14 | + units-per-em="1024" | ||
15 | + panose-1="2 0 6 3 0 0 0 0 0 0" | ||
16 | + ascent="896" | ||
17 | + descent="-128" | ||
18 | + x-height="792" | ||
19 | + bbox="-0.75 -212 1160 896.75" | ||
20 | + underline-thickness="50" | ||
21 | + underline-position="-100" | ||
22 | + unicode-range="U+0078-E63E" | ||
23 | + /> | ||
24 | +<missing-glyph horiz-adv-x="374" | ||
25 | +d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> | ||
26 | + <glyph glyph-name=".notdef" horiz-adv-x="374" | ||
27 | +d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" /> | ||
28 | + <glyph glyph-name=".null" horiz-adv-x="0" | ||
29 | + /> | ||
30 | + <glyph glyph-name="nonmarkingreturn" horiz-adv-x="341" | ||
31 | + /> | ||
32 | + <glyph glyph-name="x" unicode="x" horiz-adv-x="1001" | ||
33 | +d="M281 543q-27 -1 -53 -1h-83q-18 0 -36.5 -6t-32.5 -18.5t-23 -32t-9 -45.5v-76h912v41q0 16 -0.5 30t-0.5 18q0 13 -5 29t-17 29.5t-31.5 22.5t-49.5 9h-133v-97h-438v97zM955 310v-52q0 -23 0.5 -52t0.5 -58t-10.5 -47.5t-26 -30t-33 -16t-31.5 -4.5q-14 -1 -29.5 -0.5 | ||
34 | +t-29.5 0.5h-32l-45 128h-439l-44 -128h-29h-34q-20 0 -45 1q-25 0 -41 9.5t-25.5 23t-13.5 29.5t-4 30v167h911zM163 247q-12 0 -21 -8.5t-9 -21.5t9 -21.5t21 -8.5q13 0 22 8.5t9 21.5t-9 21.5t-22 8.5zM316 123q-8 -26 -14 -48q-5 -19 -10.5 -37t-7.5 -25t-3 -15t1 -14.5 | ||
35 | +t9.5 -10.5t21.5 -4h37h67h81h80h64h36q23 0 34 12t2 38q-5 13 -9.5 30.5t-9.5 34.5q-5 19 -11 39h-368zM336 498v228q0 11 2.5 23t10 21.5t20.5 15.5t34 6h188q31 0 51.5 -14.5t20.5 -52.5v-227h-327z" /> | ||
36 | + <glyph glyph-name="uniE600" unicode="" | ||
37 | +d="M286 509l-46 -45l272 -272l272 272l-46 45l-226 -226z" /> | ||
38 | + <glyph glyph-name="uniE601" unicode="" | ||
39 | +d="M387 158l45 -46l272 272l-272 272l-45 -46l226 -226z" /> | ||
40 | + <glyph glyph-name="uniE602" unicode="" | ||
41 | +d="M766 193l-196 192l196 192l-61 60l-196 -193l-196 193l-60 -60l196 -192l-196 -192l60 -59l196 192l196 -192z" /> | ||
42 | + <glyph glyph-name="uniE603" unicode="" | ||
43 | +d="M951 77h-878l439 614z" /> | ||
44 | + <glyph glyph-name="uniE604" unicode="" | ||
45 | +d="M512 77l-439 614h878z" /> | ||
46 | + <glyph glyph-name="uniE605" unicode="" | ||
47 | +d="M819 823v-878l-614 439z" /> | ||
48 | + <glyph glyph-name="uniE606" unicode="" | ||
49 | +d="M205 -55v878l614 -439z" /> | ||
50 | + <glyph glyph-name="uniE607" unicode="" | ||
51 | +d="M786 789l-415 -405l415 -404q19 -18 19 -44t-19 -44.5t-46 -18.5t-46 18l-461 449q-19 18 -19 44.5t19 44.5l461 449q19 18 46 18t46 -18.5t19 -44.5t-19 -44zM786 789z" /> | ||
52 | + <glyph glyph-name="uniE608" unicode="" | ||
53 | +d="M233 789q-19 18 -19 44t19 44.5t46 18.5t46 -18l461 -449q19 -18 19 -44.5t-19 -44.5l-461 -449q-19 -18 -46 -18t-46 18.5t-19 44.5t19 44l416 404zM233 789z" /> | ||
54 | + <glyph glyph-name="uniE609" unicode="" | ||
55 | +d="M577 -118q-17 0 -30 11q-16 12 -18 31.5t11 35.5l357 443l-350 404q-13 15 -11.5 34.5t16.5 32.5t34.5 11.5t32.5 -16.5l376 -433q12 -13 12 -30.5t-11 -30.5l-382 -475q-14 -18 -37 -18z" /> | ||
56 | + <glyph glyph-name="uniE60A" unicode="" | ||
57 | +d="M447 -118q-23 0 -37 18l-382 475q-11 13 -11 30.5t12 30.5l376 433q13 15 32.5 16.5t34.5 -11.5t16.5 -32.5t-11.5 -34.5l-350 -404l357 -443q13 -16 11 -35.5t-18 -31.5q-13 -11 -30 -11z" /> | ||
58 | + <glyph glyph-name="uniE60B" unicode="" | ||
59 | +d="M284 15q-14 -14 -14 -33t13.5 -32.5t32.5 -13.5t32 14l397 401q13 14 13 33t-13 33l-397 401q-13 14 -32 14t-32.5 -13.5t-13.5 -32.5t13 -33l351 -369l-350 -369v0zM284 15z" /> | ||
60 | + <glyph glyph-name="uniE60C" unicode="" | ||
61 | +d="M745 753q13 14 13 33t-13.5 32.5t-32.5 13.5t-32 -14l-396 -401q-14 -14 -14 -33t14 -33l396 -401q14 -14 32.5 -14t32 13.5t13.5 32.5t-13 33l-351 369l351 369v0zM745 753z" /> | ||
62 | + <glyph glyph-name="uniE60D" unicode="" | ||
63 | +d="M512.5 750q-12.5 0 -21.5 -9t-9 -22v-311h-249q-12 0 -21.5 -9t-9.5 -22t9.5 -22t21.5 -9h280q12 0 21.5 9t9.5 22v342q0 13 -9.5 22t-22 9zM513 874q-101 0 -193 -39.5t-158.5 -105.5t-106 -158t-39.5 -193t39.5 -193t106 -158.5t158.5 -105.5t193 -39t192.5 39 | ||
64 | +t158 105.5t106 158.5t39.5 193t-39.5 193t-106 158t-158 105.5t-192.5 39.5zM513 -56q-118 0 -218 58t-158.5 158t-58.5 218t58.5 218t158.5 158t218 58t218 -58t158 -158t58 -218t-58 -218t-158 -158t-218 -58z" /> | ||
65 | + <glyph glyph-name="uniE60E" unicode="" | ||
66 | +d="M710 384l-473 474l38 38l512 -512l-512 -512l-38 38z" /> | ||
67 | + <glyph glyph-name="uniE60F" unicode="" | ||
68 | +d="M314 384l473 -474l-38 -38l-512 512l512 512l38 -38z" /> | ||
69 | + <glyph glyph-name="uniE610" unicode="" | ||
70 | +d="M797 219.5q0 -7.5 -5 -13.5l-29 -28q-6 -6 -13.5 -6t-12.5 6l-225 224l-224 -224q-6 -6 -13.5 -6t-13.5 6l-28 28q-6 6 -6 13.5t6 13.5l266 266q6 6 13.5 6t12.5 -6l267 -266q5 -6 5 -13.5z" /> | ||
71 | + <glyph glyph-name="uniE611" unicode="" | ||
72 | +d="M892 125l-236 236q54 77 54 172q0 124 -87 211t-210.5 87t-211 -87t-87.5 -211t87.5 -211t210.5 -87q95 0 173 55l236 -236q16 -17 38 -18t37 14t14 37t-18 38zM213 533q0 82 58.5 140.5t140.5 58.5t140.5 -58.5t58.5 -140.5t-58.5 -140.5t-140.5 -58.5t-140.5 58.5 | ||
73 | +t-58.5 140.5z" /> | ||
74 | + <glyph glyph-name="uniE612" unicode="" | ||
75 | +d="M939 -128h-854q-35 0 -60 25t-25 60v854q0 35 25 60t60 25h854q35 0 60 -25t25 -60v-854q0 -35 -25 -60t-60 -25zM939 789q0 10 -6 16t-16 6h-810q-10 0 -16 -6t-6 -16v-810q0 -10 6 -16t16 -6h810q10 0 16 6t6 16v810zM457 183q-10 -12 -30.5 -12t-29.5 12l-171 171 | ||
76 | +q-13 10 -13 30q0 18 12.5 30.5t30.5 12.5q20 0 30 -13l141 -141l311 312q13 12 30 12q18 0 30.5 -12.5t12.5 -29.5q0 -21 -13 -30z" /> | ||
77 | + <glyph glyph-name="uniE613" unicode="" | ||
78 | +d="M877 896h-730q-61 0 -104 -43t-43 -104v-730q0 -61 43 -104t104 -43h730q61 0 104 43t43 104v730q0 61 -43 104t-104 43zM939 19q0 -26 -18 -44t-44 -18h-730q-26 0 -44 18t-18 44v730q0 26 18 44t44 18h730q26 0 44 -18t18 -44v-730z" /> | ||
79 | + <glyph glyph-name="uniE614" unicode="" | ||
80 | +d="M160 996zM865 247q0 -18 -13 -31l-308 -308q-13 -13 -31 -13t-31 13l-309 308q-13 13 -13 31t13.5 31t30.5 13h617q18 0 31 -13t13 -31zM865 511q0 -18 -13 -31t-31 -13h-617q-18 0 -31 13t-13 31t13 31l309 309q13 13 31 13t31 -13l308 -309q13 -13 13 -31z" /> | ||
81 | + <glyph glyph-name="uniE615" unicode="" | ||
82 | +d="M704 665l-41 39l-343 -320l343 -320l41 39l-301 281z" /> | ||
83 | + <glyph glyph-name="uniE616" unicode="" horiz-adv-x="1173" | ||
84 | +d="M569 607q-28 66 -74 108.5t-95 56.5t-100 2.5t-91.5 -45t-66 -94t-26.5 -137.5q0 -36 8.5 -67.5t26 -58t35.5 -47t46.5 -41t49 -34t52.5 -32.5t48 -30q71 -47 124.5 -106.5t63.5 -93.5q7 31 62.5 92t124.5 110q19 14 55.5 36.5t61 38.5t55 42.5t49 52t31.5 62.5t13 79 | ||
85 | +q0 76 -26.5 136t-67 92t-92 42.5t-101 -4t-94.5 -56t-72 -104.5z" /> | ||
86 | + <glyph glyph-name="uniE617" unicode="" | ||
87 | +d="M500 775l-348 -298q-16 -14 -16 -35v-386q0 -25 17.5 -42.5t42.5 -17.5h197v257h238v-257h197q25 0 42.5 17.5t17.5 42.5v386q0 21 -16 35l-348 298q-12 10 -24 0z" /> | ||
88 | + <glyph glyph-name="uniE618" unicode="" horiz-adv-x="1000" | ||
89 | +d="M751 766q21 -20 34 -33t19.5 -22.5t8.5 -16t2 -10.5v-13h-119q-8 0 -14 6t-10 14t-6 16.5t-2 12.5v100h3q6 0 13 -2t15.5 -8t22 -16t33.5 -28zM614 720q0 -16 5 -33.5t15 -32t26 -24t38 -9.5h117v-451q0 -24 -9.5 -42t-24.5 -31t-33.5 -20t-35.5 -7h-394q-15 0 -33 8.5 | ||
90 | +t-33.5 23t-26 33t-10.5 38.5v543q0 17 7.5 35t21 33.5t30 25.5t35.5 10h305v-100zM664 221q21 0 35.5 14.5t14.5 35.5t-14.5 35.5t-35.5 14.5h-299q-21 0 -35.5 -14.5t-14.5 -35.5t14.5 -35.5t35.5 -14.5h299zM714 470q0 21 -14.5 36t-35.5 15h-299q-21 0 -35.5 -15 | ||
91 | +t-14.5 -36t14.5 -35t35.5 -14h299q21 0 35.5 14t14.5 35zM714 470z" /> | ||
92 | + <glyph glyph-name="uniE619" unicode="" | ||
93 | +d="M512 599q47 0 88 -18t72 -49t49 -72t18 -89q0 -46 -18 -87t-49 -72t-72 -49t-88 -18t-88 18t-72 49t-49 72t-18 87q0 48 18 89t49 72t72 49t88 18v0zM512 599z" /> | ||
94 | + <glyph glyph-name="uniE61A" unicode="" | ||
95 | +d="M903 577l-68 69l-388 -388l-231 230l-68 -68l299 -298l65 65z" /> | ||
96 | + <glyph glyph-name="uniE61B" unicode="" | ||
97 | +d="M505 337l2 -2q2 -1 3.5 -1t3.5 1l430 364q2 2 1 5.5t-5 3.5h-435h-424q-4 0 -5 -3.5t1 -5.5zM72 669q-3 2 -6 0.5t-3 -4.5v-584q0 -4 3.5 -5t5.5 1l288 346zM953 669.5q-3 1.5 -5 -0.5l-288 -246l287 -346q3 -2 6 -1t3 5v584q0 3 -3 4.5zM641 406l-131 -111l-5 5 | ||
98 | +l-125 103l-275 -328q-2 -3 -1 -6t5 -3h396h407q4 0 5 3t-1 6z" /> | ||
99 | + <glyph glyph-name="uniE61C" unicode="" | ||
100 | +d="M982 137l-4 6l-10 12q-12 13 -42 38q-43 36 -79 59l-48 31l-21 11q-17 8 -36 1q-16 -5 -23 -18l-17 -25q-4 -6 -8 -13l-12 -24q-9 -18 -15 -28q-7 -14 -21 -24t-32 -13.5t-36 7.5q-102 57 -171 123q-101 95 -135 172q-8 13 -1.5 37t26.5 34q13 7 34.5 15.5t31.5 14.5 | ||
101 | +q7 4 14.5 8.5t18.5 11.5l4 3l4 3l3 3q19 18 9 43l-3 8q-14 32 -36 69q-17 30 -41 62q-16 21 -32.5 36t-25.5 20l-9 5q-9 5 -13 7q-23 10 -50 -1q-15 -6 -30.5 -15.5t-22 -14.5t-26.5 -21q-44 -37 -69.5 -82.5t-19.5 -86.5q10 -72 88 -198.5t182.5 -225.5t237.5 -173t209 -84 | ||
102 | +q79 -10 169 73q38 36 56 73q6 14 7.5 30t-5.5 31zM982 137z" /> | ||
103 | + <glyph glyph-name="uniE61D" unicode="" | ||
104 | +d="M888 620q12 12 28.5 12t28.5 -12t12 -28.5t-12 -28.5l-406 -405q-12 -12 -28.5 -12t-27.5 12q-12 11 -12 27.5t12 28.5zM539 214q11 -12 11 -28.5t-11 -27.5q-12 -12 -28.5 -12t-28.5 12l-406 405q-11 12 -11 28.5t11 28.5q12 12 28.5 12t28.5 -12zM539 214z" /> | ||
105 | + <glyph glyph-name="uniE61E" unicode="" | ||
106 | +d="M127 769v-770h770v770h-770zM555 170h-86v86h86v-86zM555 298h-86v257h86v-257z" /> | ||
107 | + <glyph glyph-name="uniE61F" unicode="" | ||
108 | +d="M511.5 831q-90.5 0 -173.5 -35.5t-143 -95t-95 -142.5t-35 -174t35 -173.5t95 -142.5t143 -95.5t173.5 -35.5t173.5 35.5t143 95.5t95 142.5t35.5 173.5t-35 174t-95.5 142.5t-143 95t-173.5 35.5zM452 184h-1v0l-38 38l-179 180l38 37l179 -179l318 318l38 -38zM512 -63 | ||
109 | +q-91 0 -175 35q-80 34 -142 96t-96 142q-35 83 -35 174t35 174q34 81 96 142.5t142 95.5q84 36 175 36t174 -36q80 -34 142 -95.5t96 -142.5q35 -83 35 -174t-35 -174q-34 -80 -96 -142t-142 -96q-83 -35 -174 -35zM511.5 831q-90.5 0 -173 -35.5t-142.5 -95.5t-95.5 -142.5 | ||
110 | +t-35.5 -173.5t35.5 -173.5t95.5 -142.5t142.5 -95t173 -35t173.5 35t142.5 95t95 142.5t35.5 173.5t-35.5 173.5t-95 142.5t-142.5 95.5t-173.5 35.5zM451 183l-38 39l-180 180l39 38l179 -180l318 318l39 -38zM414 222l37 -37l355 355l-37 37l-318 -318l-179 180l-38 -37z | ||
111 | +" /> | ||
112 | + <glyph glyph-name="uniE620" unicode="" | ||
113 | +d="M958 758q0 30 -21 51.5t-51 21.5h-749q-30 0 -51 -21.5t-21 -51.5v-748q0 -30 21 -51t51 -21h749q30 0 51 21t21 51v748zM778 454l-267 -267q-14 -14 -34 -14t-34 14l-168 168q-14 14 -14 34t14 34.5t34 14.5t34 -15l134 -133l233 232q14 14 34 14t34 -14t14 -34t-14 -34 | ||
114 | +z" /> | ||
115 | + <glyph glyph-name="uniE621" unicode="" | ||
116 | +d="M384 640v-513l321 257z" /> | ||
117 | + <glyph glyph-name="uniE622" unicode="" horiz-adv-x="1000" | ||
118 | +d="M662 662v-499l-299 250zM662 662z" /> | ||
119 | + <glyph glyph-name="uniE623" unicode="" horiz-adv-x="1000" | ||
120 | +d="M744 598h-488q-38 0 -64.5 -26.5t-26.5 -64.5v-290q0 -38 26.5 -64.5t64.5 -26.5h227l200 -138v138h61q38 0 64.5 26.5t26.5 64.5v290q0 38 -26.5 64.5t-64.5 26.5zM744 358z" /> | ||
121 | + <glyph glyph-name="uniE624" unicode="" horiz-adv-x="1025" | ||
122 | +d="M1024 480v338q0 32 -23 55t-55 23h-331h-14q-55 0 -76 -21l-506 -506q-19 -19 -19 -46t19 -45l387 -387q18 -19 45 -19t46 19l506 506q10 10 15 25.5t5.5 26.5t0.5 31zM764 549q-36 0 -61.5 25.5t-25.5 61.5t25.5 61t61.5 25t61 -25t25 -61t-25 -61.5t-61 -25.5z" /> | ||
123 | + <glyph glyph-name="uniE625" unicode="" | ||
124 | +d="M511 832q-91 0 -173.5 -35.5t-142 -95t-95 -142t-35.5 -173.5t35.5 -173.5t95 -142t142 -95t173.5 -35.5t173.5 35.5t142.5 95t95 142t35 173.5t-35 173.5t-95 142t-142.5 95t-173.5 35.5zM734 337h-237q-7 0 -14 3q-22 9 -22 33v237q0 15 10.5 26t26 11t26 -11t10.5 -26 | ||
125 | +v-200h200q15 0 26 -10.5t11 -26t-11 -26t-26 -10.5zM734 337z" /> | ||
126 | + <glyph glyph-name="uniE626" unicode="" horiz-adv-x="1025" | ||
127 | +d="M994 163q-18 9 -16 30.5t27 46.5q24 27 17.5 54.5t-33.5 40.5q-17 8 -24.5 17.5t-2 20t26.5 19.5q30 11 29.5 55.5t-31.5 80.5q-34 39 -278 23l-23 -1q3 2 3 145q0 101 -28 139t-84 36q-18 0 -28.5 -5t-17 -13t-11 -26.5t-7.5 -38t-10 -56.5t-16 -74q-12 -47 -38 -94 | ||
128 | +t-54 -80t-55 -59t-44 -39l-18 -13v-386q10 -14 27 -25.5t31 -17t31 -11.5t21 -8q9 -4 65 -10.5t105.5 -11t51.5 -4.5q4 0 11 0.5t30 2.5t45 4.5t52 6.5t56.5 8t53.5 9.5t47 11t33.5 13t15.5 14.5q8 24 3 39t-2 27t23 20q27 10 34.5 34.5t0.5 46t-19 28.5zM0 379v-380 | ||
129 | +q0 -28 20 -48.5t49 -20.5h137v518h-137q-29 0 -49 -20.5t-20 -48.5zM0 379z" /> | ||
130 | + <glyph glyph-name="uniE627" unicode="" horiz-adv-x="1025" | ||
131 | +d="M512 719q-167 0 -304.5 -89.5t-205.5 -236.5q-4 -9 0 -18q68 -147 205.5 -236.5t304.5 -89.5t304.5 89.5t205.5 236.5q4 9 0 18q-68 147 -205.5 236.5t-304.5 89.5zM512 153q-96 0 -163.5 67.5t-67.5 163.5t67.5 163.5t163.5 67.5t163.5 -67.5t67.5 -163.5t-67.5 -163.5 | ||
132 | +t-163.5 -67.5zM512 384zM364 384q0 61 43.5 104.5t104.5 43.5t104.5 -43.5t43.5 -104.5t-43.5 -104.5t-104.5 -43.5t-104.5 43.5t-43.5 104.5z" /> | ||
133 | + <glyph glyph-name="uniE628" unicode="" | ||
134 | +d="M482.5 167q-24.5 0 -42 -17.5t-17.5 -42.5t17.5 -42.5t42 -17.5t42 17.5t17.5 42.5t-17.5 42.5t-42 17.5zM769 167q-25 0 -42.5 -17.5t-17.5 -42.5t17.5 -42.5t42.5 -17.5t42.5 17.5t17.5 42.5t-17.5 42.5t-42.5 17.5zM839 277h-417l-143 425q-7 18 -29 18h-127 | ||
135 | +q-13 0 -22 -8t-9 -20.5t9 -20.5t22 -8h105l143 -424q7 -19 29 -19h439q13 0 21.5 8t8.5 20.5t-8.5 20.5t-21.5 8zM904 608l-516 45q-12 1 -18.5 -7t-1.5 -20l90 -270q4 -12 16 -21.5t24 -9.5h377q12 0 22 10t11 23l23 216q2 12 -6 22t-21 12z" /> | ||
136 | + <glyph glyph-name="uniE629" unicode="" | ||
137 | +d="M154 770v-646h146l-14 -208l240 208h344v646h-716zM752 260h-134v159h-192v-159h-134v382h134v-148h192v148h134v-382z" /> | ||
138 | + <glyph glyph-name="uniE62A" unicode="" | ||
139 | +d="M328 18q-6 0 -11 3q-14 6 -14 22v128h-193q-10 0 -17.5 7t-7.5 18v549q0 10 7.5 17.5t17.5 7.5h804q11 0 18 -7.5t7 -17.5v-549q0 -11 -7 -18t-18 -7h-401l-169 -146q-7 -7 -16 -7zM171 256h188q10 0 17.5 -7.5t7.5 -17.5v-73l103 92q7 6 17 6h350v426h-683v-426z | ||
140 | +M739 569h-454q-10 0 -17.5 7t-7.5 17.5t7.5 18t17.5 7.5h454q10 0 17.5 -7.5t7.5 -18t-7 -17.5t-18 -7zM739 446h-454q-10 0 -17.5 7t-7.5 17.5t7.5 18t17.5 7.5h454q10 0 17.5 -7.5t7.5 -18t-7 -17.5t-18 -7zM549 323h-264q-10 0 -17.5 7t-7.5 17.5t7.5 18t17.5 7.5h264 | ||
141 | +q10 0 17.5 -7.5t7.5 -17.5t-7.5 -17.5t-17.5 -7.5z" /> | ||
142 | + <glyph glyph-name="uniE62B" unicode="" | ||
143 | +d="M510.5 -60q-90.5 0 -173 35.5t-142.5 95.5t-95.5 142.5t-35.5 173t35.5 173t95.5 142.5t142.5 95.5t173 35.5t173.5 -35.5t142.5 -95.5t95 -142.5t35.5 -173t-35.5 -173t-95 -142.5t-142.5 -95.5t-173.5 -35.5zM510.5 787q-108.5 0 -200.5 -53.5t-146 -146t-54 -201 | ||
144 | +t54 -201t146 -146t200.5 -53.5t201 53.5t146 146t53.5 201t-53.5 201t-146 146t-201 53.5zM465 248v29q0 19 3 33q3 15 9 28q5 14 15 26t24 26l35 33q15 13 25.5 29.5t10.5 39.5q0 30 -19 50.5t-54 20.5q-18 0 -32 -6.5t-24.5 -17.5t-16.5 -26q-5 -15 -6 -30l-95 8 | ||
145 | +q5 37 20 66t39 49t55 31q31 10 66 10q33 0 63 -9.5t53 -28.5t36 -46.5t13 -64.5q0 -25 -5.5 -43t-15.5 -34t-24 -30q-15 -15 -32 -30q-16 -13 -25.5 -23t-15.5 -20t-8 -21.5t-2 -28.5v-20h-92zM450 140q0 25 18 43t44 18q24 0 43 -17t19 -42t-18.5 -42.5t-43.5 -17.5 | ||
146 | +q-12 0 -23.5 4.5t-20.5 12.5q-8 7 -13 18t-5 23z" /> | ||
147 | + <glyph glyph-name="uniE62C" unicode="" | ||
148 | +d="M505 860q95 0 182 -37t150 -100t100.5 -150t37.5 -182t-37.5 -182t-100.5 -150t-150 -100.5t-182 -37.5t-182 37.5t-150 100.5t-100 150t-37 182t37 182t100 150t150 100t182 37zM505 -20q112 0 206.5 55t149.5 149.5t55 206t-55 206t-149.5 149.5t-206 55t-206 -55 | ||
149 | +t-149.5 -149.5t-55 -206t55 -206t149.5 -149.5t205.5 -55zM528 222v-59h-58v59h58zM470 648h58v-349h-58v349z" /> | ||
150 | + <glyph glyph-name="uniE62D" unicode="" | ||
151 | +d="M828 702q65 -65 98 -148t33 -169t-33 -169t-98 -148q-66 -66 -149 -98.5t-169 -32.5t-168.5 32.5t-148.5 97.5q-66 66 -98.5 149t-32.5 169t32.5 169t98.5 149q66 65 148.5 97.5t168.5 32.5t169 -32.5t149 -98.5v0zM258 133q53 -53 118.5 -79t134.5 -26t134.5 26 | ||
152 | +t118 78.5t78.5 118t26 134.5t-26 134.5t-78 118.5q-53 53 -119 79t-134.5 26t-134.5 -26t-118 -78.5t-78.5 -118t-26.5 -134.5t26.5 -134.5t78.5 -118.5v0zM748 686l69 -72l-531 -530l-70 70zM748 686z" /> | ||
153 | + <glyph glyph-name="uniE62E" unicode="" horiz-adv-x="1025" | ||
154 | +d="M491 6q9 -10 21.5 -10t21.5 10l357 407q9 10 5.5 17.5t-17.5 7.5h-133q-14 0 -23.5 9.5t-9.5 22.5v261q0 13 -10 22.5t-24 9.5h-333q-14 0 -24 -9.5t-10 -22.5v-261q0 -13 -9.5 -22.5t-23.5 -9.5h-133q-14 0 -17.5 -7.5t5.5 -17.5z" /> | ||
155 | + <glyph glyph-name="uniE62F" unicode="" | ||
156 | +d="M512 809v0q-58 0 -112.5 -12t-105.5 -38t-80.5 -44t-77.5 -51v-450q0 -57 19.5 -110.5t49 -93.5t69 -76t75.5 -59.5t73.5 -43t57 -28t32.5 -12.5q13 4 32.5 12.5t57 28t73.5 43t75.5 59.5t69 76t49 93.5t19.5 110.5v450q-48 33 -77.5 51t-80.5 44t-105.5 38t-112.5 12z | ||
157 | +M808 214q0 -76 -36.5 -138t-112.5 -117q-73 -53 -147 -82q-74 29 -147 82q-76 55 -112.5 117t-36.5 138v421q87 53 146.5 75t149.5 23q90 -1 149.5 -23t146.5 -75v-421zM512 671q-67 0 -112.5 -12.5t-119.5 -49.5v-399q0 -35 12.5 -68.5t30 -57.5t44 -46t47 -35.5t46 -26 | ||
158 | +t34 -16t18.5 -6.5q10 3 18.5 6.5t34 16t46 26t47 35.5t44 46t30 57.5t12.5 68.5v399q-74 37 -119.5 49.5t-112.5 12.5v0zM667 515v-47h-105v-67h92v-61h-92v-77h116v-57h-332v57h42v168h64v-168h46v205h-138v61h307v-14z" /> | ||
159 | + <glyph glyph-name="uniE630" unicode="" horiz-adv-x="1163" | ||
160 | +d="M295 196q67 0 114 -47t47 -113.5t-47 -114t-114 -47.5t-114 47.5t-47 114t47 113.5t114 47zM917.5 196q66.5 0 113.5 -47t47 -113.5t-47 -114t-113.5 -47.5t-114 47.5t-47.5 114t47.5 113.5t114 47zM400 894v-99h-210v0l-187 -294v-372h95q27 56 80 90.5t117 34.5 | ||
161 | +t117 -34.5t80 -90.5h228q27 56 80 90.5t117.5 34.5t117.5 -34.5t79 -90.5h46v765h-760zM400 452h-283l159 250l124 1v-251v0zM893 701l-131 -276l-63 31l101 206h-105v68h198v-29v0z" /> | ||
162 | + <glyph glyph-name="uniE631" unicode="" | ||
163 | +d="M799 456l127 127v313h-830v-609l421 -413l409 404v181l-414 -401l-288 284v426h575v-312zM671 518l-107 22l-53 100l-52 -100l-108 -22l75 -83l-14 -114l99 49l99 -49l-14 114z" /> | ||
164 | + <glyph glyph-name="uniE632" unicode="" | ||
165 | +d="M512 769q-104 0 -192.5 -51.5t-140 -140t-51.5 -193t51.5 -193t140 -140t192.5 -51.5t192.5 51.5t140 140t51.5 193t-51.5 193t-140 140t-192.5 51.5zM660 181h-50v175h-196v-175h-50v395h50v-179h196v179h50v-395z" /> | ||
166 | + <glyph glyph-name="uniE633" unicode="" | ||
167 | +d="M1020 810q0 34 -24 58t-59 24h-851q-34 0 -58.5 -24t-24.5 -58v-852q0 -34 24.5 -58t58.5 -24h851q35 0 59 24t24 58v852zM815 464l-304 -304q-16 -16 -38.5 -16t-38.5 16l-191 191q-17 16 -17 39t16.5 39t39 16t38.5 -16l153 -152l264 264q16 16 39 16t39 -16t16 -38.5 | ||
168 | +t-16 -38.5z" /> | ||
169 | + <glyph glyph-name="uniE634" unicode="" | ||
170 | +d="M637 610l-45 46l-272 -272l272 -272l45 46l-226 226z" /> | ||
171 | + <glyph glyph-name="uniE635" unicode="" | ||
172 | +d="M0 896h1024v-1024h-1024v1024zM85 -43h854v854h-854v-854z" /> | ||
173 | + <glyph glyph-name="uniE636" unicode="" | ||
174 | +d="M1024 -128h-1024v1024h1024v-1024zM947 674l-34 34q-13 13 -30 13t-30 -13l-486 -495l-196 205q-13 13 -30 13t-30 -13l-34 -34q-13 -13 -13 -30t13 -30l256 -256q23 -22 51 -8q9 0 9 8l546 546q18 13 20 30.5t-12 29.5z" /> | ||
175 | + <glyph glyph-name="uniE637" unicode="" | ||
176 | +d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h448q9 0 15 6t6 14t-6 14t-15 6h-448q-9 0 -15 -6t-6 -14t6 -14t15 -6z" /> | ||
177 | + <glyph glyph-name="uniE638" unicode="" | ||
178 | +d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h204v-204q0 -9 6 -15t14 -6t14 6t6 15v204h204q9 0 15 6t6 14t-6 14t-15 6h-204v204q0 9 -6 15t-14 6t-14 -6t-6 -15v-204h-204q-9 0 -15 -6t-6 -14t6 -14t15 -6z" /> | ||
179 | + <glyph glyph-name="uniE639" unicode="" | ||
180 | +d="M774 201h-524l262 366z" /> | ||
181 | + <glyph glyph-name="uniE63A" unicode="" | ||
182 | +d="M512 188l-280 392h560z" /> | ||
183 | + <glyph glyph-name="uniE63B" unicode="" horiz-adv-x="1048" | ||
184 | +d="M297.5 528q-20.5 0 -35 -14.5t-14.5 -35t14.5 -35.5t35 -15t35.5 15t15 35.5t-15 35t-35.5 14.5zM381 251q0 96 84 164t202 68t202 -68t84 -163.5t-84 -163.5t-202 -68t-202 68t-84 163zM286 251q0 -17 2 -35v1q-88 42 -140.5 114t-52.5 157t51.5 157t139.5 114t192 42 | ||
185 | +q142 0 249.5 -76.5t128.5 -189.5q-88 43 -189 43q-104 0 -191.5 -43.5t-138.5 -119t-51 -164.5zM953 36q95 93 95 215t-94 214q2 20 2 23q0 111 -64 205t-174.5 148.5t-240 54.5t-239.5 -54.5t-174 -148.5t-64 -205q0 -78 33 -148.5t93 -125.5l-77 -123q-8 -12 -6.5 -26 | ||
186 | +t10.5 -25q13 -15 32 -15q9 0 18 4l180 80q4 2 7 4q20 -7 39 -12q48 -80 138.5 -128t199.5 -48q75 0 145 25q1 -1 2 -1l140 -62q8 -4 17 -4q20 0 32 15q10 10 11 24t-7 26zM527 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z | ||
187 | +M667 282q-16 0 -27.5 -11t-11.5 -27t11.5 -27.5t27.5 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11zM806 282q-16 0 -27 -11t-11 -27t11 -27.5t27 -11.5t27.5 11.5t11.5 27.5t-11.5 27t-27.5 11z" /> | ||
188 | + <glyph glyph-name="uniE63C" unicode="" horiz-adv-x="1158" | ||
189 | +d="M1069 181h-245v378h132l113 -169v-209zM1158 417l-155 231h-268v-467h-45v508q0 20 -14 34t-34 14h-63l-67 -89h89v-467h-512v467h45l22 89h-108q-20 0 -34 -14t-14 -34v-549q0 -20 14 -34t34 -14h139q-33 -37 -33 -87q0 -53 37.5 -91t91 -38t91.5 38t38 91q0 50 -34 87 | ||
190 | +h264h191q-34 -37 -34 -87q0 -53 38 -91t91.5 -38t91 38t37.5 91q0 50 -33 87h134v325zM326 668q-89 -153 -94 -296v-12h129v12q0 43 17 112q17 68 39 116q27 61 67.5 118t62.5 79l4 3v96h-390l-2 -114h245q-33 -40 -78 -114z" /> | ||
191 | + <glyph glyph-name="uniE63D" unicode="" | ||
192 | +d="M875 126l-363 -164l-363 164v610q247 75 363 75t363 -75v-610zM930 808q-34 11 -84.5 26t-159.5 38.5t-174 23.5t-174 -23.5t-159.5 -38.5t-84.5 -26q-14 -4 -22 -15.5t-8 -25.5v-669q0 -27 25 -39l405 -183q9 -3 18 -3t18 3l405 183q25 12 25 39v669q0 14 -8 25.5 | ||
193 | +t-22 15.5zM751 552v83h-473v-83h206v-298h-72v237h-87v-237h-66v-84h506v84h-193v119h151v83h-151v96h179z" /> | ||
194 | + <glyph glyph-name="uniE63E" unicode="" | ||
195 | +d="M866.5 747.5q-97.5 97.5 -228 132t-261.5 0t-228.5 -132t-132 -228.5t0 -261.5t132 -228t228.5 -132t261.5 0t228 132t132 228t0 261.5t-132 228.5zM798 199l-101 -101l-187 186l-186 -186l-101 101l186 186l-186 187l101 101l186 -186l187 186l101 -101l-186 -187z" /> | ||
196 | + </font> | ||
197 | +</defs></svg> |
1 | -<?php | ||
2 | -/** | ||
3 | - * Created by PhpStorm. | ||
4 | - * User: Zip | ||
5 | - * Date: 15/4/28 | ||
6 | - * Time: 下午3:16 | ||
7 | - */ | ||
8 | - | ||
9 | -namespace Hood\Cache; | ||
10 | - | ||
11 | -use Hood\Core\Root; | ||
12 | - | ||
13 | -class Memcache extends Root implements CacheInterface | ||
14 | -{ | ||
15 | - private $mcInstances = array(); | ||
16 | - | ||
17 | - private $persistentIDs = array(); | ||
18 | - | ||
19 | - private $section = 'memcached'; | ||
20 | - | ||
21 | - private $node = 'servers'; | ||
22 | - | ||
23 | - private $tagName = ''; | ||
24 | - | ||
25 | - private $prefix = ''; | ||
26 | - | ||
27 | - private $persistentID = 'hood.cache'; | ||
28 | - | ||
29 | - private $childNodes = 'hosts'; | ||
30 | - | ||
31 | - public function __construct($prefix = '', $persistentID = 'hood.cache') | ||
32 | - { | ||
33 | - parent::__construct(); | ||
34 | - $this->prefix = $prefix; | ||
35 | - $this->persistentIDs[] = $this->persistentID = $persistentID; | ||
36 | - } | ||
37 | - | ||
38 | - public function init() | ||
39 | - { | ||
40 | - if (isset($this->mcInstances[$this->persistentID])) { | ||
41 | - $mc = $this->mcInstances[$this->persistentID]; | ||
42 | - } else { | ||
43 | - $instance = new \Memcache(); | ||
44 | - $server = $this->getServerHost('cache'); | ||
45 | - $_serverHosts = $server->getServerConfig($this->section, $this->node); | ||
46 | - $mcServers = $this->_makeHosts($server->getServer($_serverHosts[$this->childNodes], 2)); | ||
47 | - foreach ($mcServers as $key => $val) { | ||
48 | - $weight = 100; | ||
49 | - if (count($val) == 3) { | ||
50 | - list($host, $port, $weight) = $val; | ||
51 | - } else { | ||
52 | - list($host, $port) = $val; | ||
53 | - } | ||
54 | - $instance->addServer($host, $port, $this->persistentID, $weight); | ||
55 | - } | ||
56 | - $this->mcInstances[$this->persistentID] = $mc = $instance; | ||
57 | - } | ||
58 | - return $mc; | ||
59 | - } | ||
60 | - | ||
61 | - /** | ||
62 | - * 组织host | ||
63 | - * @param array $hosts | ||
64 | - * @return array | ||
65 | - */ | ||
66 | - private function _makeHosts(array $hosts) | ||
67 | - { | ||
68 | - $_server = array(); | ||
69 | - foreach ($hosts as $key => $val) { | ||
70 | - $_server[] = explode(':', $val); | ||
71 | - } | ||
72 | - return $_server; | ||
73 | - } | ||
74 | - | ||
75 | - /** | ||
76 | - * 设置mc配置的块节点 | ||
77 | - * @param $node | ||
78 | - * @return $this | ||
79 | - */ | ||
80 | - public function setNode($node = null) | ||
81 | - { | ||
82 | - if ($node != null) $this->node = $node; | ||
83 | - return $this; | ||
84 | - } | ||
85 | - | ||
86 | - /** | ||
87 | - * 设置子节点 | ||
88 | - * @param $childNode | ||
89 | - * @return $this | ||
90 | - */ | ||
91 | - public function setChildNodes($childNode) | ||
92 | - { | ||
93 | - $this->childNodes = $childNode; | ||
94 | - return $this; | ||
95 | - } | ||
96 | - | ||
97 | - /** | ||
98 | - * 构建tag | ||
99 | - * @param bool $mode | ||
100 | - * @return string | ||
101 | - */ | ||
102 | - private function _makeTag($mode = false) | ||
103 | - { | ||
104 | - if (empty($this->tagName)) return ''; | ||
105 | - $_tagVal = $this->init()->get($this->tagName); | ||
106 | - if (empty($_tagVal) && $mode == true) { | ||
107 | - $_tagVal = md5(microtime() . mt_rand() . uniqid()); | ||
108 | - $this->init()->set($this->tagName, $_tagVal, 0); | ||
109 | - } | ||
110 | - unset($this->tagName); | ||
111 | - return empty($_tagVal) ? '' : $_tagVal . '.'; | ||
112 | - } | ||
113 | - | ||
114 | - /** | ||
115 | - * 检索一个元素 | ||
116 | - * @param $key | ||
117 | - * @param callable $flags | ||
118 | - * @return mixed | ||
119 | - */ | ||
120 | - public function get($key, &$flags = \MEMCACHE_COMPRESSED) | ||
121 | - { | ||
122 | - return $this->init()->get($this->_makeTag() . $key, $flags); | ||
123 | - } | ||
124 | - | ||
125 | - /** | ||
126 | - * 向一个新的key下面增加一个元素 | ||
127 | - * @param $key | ||
128 | - * @param $value | ||
129 | - * @param $expiration | ||
130 | - * @return bool | ||
131 | - */ | ||
132 | - public function add($key, $value, $expiration = 0) | ||
133 | - { | ||
134 | - return $this->init()->add($this->_makeTag(true) . $key, $value, $expiration); | ||
135 | - } | ||
136 | - | ||
137 | - | ||
138 | - /** | ||
139 | - * 减小数值元素的值 | ||
140 | - * @param $key | ||
141 | - * @param int $offset | ||
142 | - * @return int | ||
143 | - */ | ||
144 | - public function decrement($key, $offset = 1) | ||
145 | - { | ||
146 | - return $this->init()->decrement($this->_makeTag() . $key, $offset); | ||
147 | - } | ||
148 | - | ||
149 | - /** | ||
150 | - * @param $key | ||
151 | - * @param int $time | ||
152 | - * @return bool | ||
153 | - */ | ||
154 | - public function delete($key, $time = 0) | ||
155 | - { | ||
156 | - return $this->init()->delete($this->_makeTag() . $key, $time); | ||
157 | - } | ||
158 | - | ||
159 | - | ||
160 | - /** | ||
161 | - * 增加数值元素的值 | ||
162 | - * @param $key | ||
163 | - * @param int $offset | ||
164 | - * @param int $initialValue | ||
165 | - * @param int $expiry | ||
166 | - * @return int | ||
167 | - */ | ||
168 | - public function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
169 | - { | ||
170 | - return $this->init()->increment($this->_makeTag() . $key, $offset, $initialValue, $expiry); | ||
171 | - } | ||
172 | - | ||
173 | - | ||
174 | - /** | ||
175 | - * 设置 | ||
176 | - * @param $key | ||
177 | - * @param $value | ||
178 | - * @param int $expiration | ||
179 | - * @return bool | ||
180 | - */ | ||
181 | - public function set($key, $var, $expire = 0, $flag = \MEMCACHE_COMPRESSED) | ||
182 | - { | ||
183 | - return $this->init()->set($this->_makeTag(true) . $key, $var, $flag, $expire); | ||
184 | - } | ||
185 | - | ||
186 | - /** | ||
187 | - * 设置tag | ||
188 | - * @param $tagName | ||
189 | - * @return $this | ||
190 | - */ | ||
191 | - public function tag($tagName) | ||
192 | - { | ||
193 | - $this->tagName = $tagName; | ||
194 | - return $this; | ||
195 | - } | 1 | +<?php |
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: Zip | ||
5 | + * Date: 15/4/28 | ||
6 | + * Time: 下午3:16 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace Hood\Cache; | ||
10 | + | ||
11 | +use Hood\Core\Root; | ||
12 | + | ||
13 | +class Memcache extends Root implements CacheInterface | ||
14 | +{ | ||
15 | + private $mcInstances = array(); | ||
16 | + | ||
17 | + private $persistentIDs = array(); | ||
18 | + | ||
19 | + private $section = 'memcached'; | ||
20 | + | ||
21 | + private $node = 'servers'; | ||
22 | + | ||
23 | + private $tagName = ''; | ||
24 | + | ||
25 | + private $prefix = ''; | ||
26 | + | ||
27 | + private $persistentID = 'hood.cache'; | ||
28 | + | ||
29 | + private $childNodes = 'hosts'; | ||
30 | + | ||
31 | + public function __construct($prefix = '', $persistentID = 'hood.cache') | ||
32 | + { | ||
33 | + parent::__construct(); | ||
34 | + $this->prefix = $prefix; | ||
35 | + $this->persistentIDs[] = $this->persistentID = $persistentID; | ||
36 | + } | ||
37 | + | ||
38 | + public function init() | ||
39 | + { | ||
40 | + if (isset($this->mcInstances[$this->persistentID])) { | ||
41 | + $mc = $this->mcInstances[$this->persistentID]; | ||
42 | + } else { | ||
43 | + $instance = new \Memcache(); | ||
44 | + $server = $this->getServerHost('cache'); | ||
45 | + $_serverHosts = $server->getServerConfig($this->section, $this->node); | ||
46 | + $mcServers = $this->_makeHosts($server->getServer($_serverHosts[$this->childNodes], 2)); | ||
47 | + foreach ($mcServers as $key => $val) { | ||
48 | + $weight = 100; | ||
49 | + if (count($val) == 3) { | ||
50 | + list($host, $port, $weight) = $val; | ||
51 | + } else { | ||
52 | + list($host, $port) = $val; | ||
53 | + } | ||
54 | + $instance->addServer($host, $port, $this->persistentID, $weight); | ||
55 | + } | ||
56 | + $this->mcInstances[$this->persistentID] = $mc = $instance; | ||
57 | + } | ||
58 | + return $mc; | ||
59 | + } | ||
60 | + | ||
61 | + /** | ||
62 | + * 组织host | ||
63 | + * @param array $hosts | ||
64 | + * @return array | ||
65 | + */ | ||
66 | + private function _makeHosts(array $hosts) | ||
67 | + { | ||
68 | + $_server = array(); | ||
69 | + foreach ($hosts as $key => $val) { | ||
70 | + $_server[] = explode(':', $val); | ||
71 | + } | ||
72 | + return $_server; | ||
73 | + } | ||
74 | + | ||
75 | + /** | ||
76 | + * 设置mc配置的块节点 | ||
77 | + * @param $node | ||
78 | + * @return $this | ||
79 | + */ | ||
80 | + public function setNode($node = null) | ||
81 | + { | ||
82 | + if ($node != null) $this->node = $node; | ||
83 | + return $this; | ||
84 | + } | ||
85 | + | ||
86 | + /** | ||
87 | + * 设置子节点 | ||
88 | + * @param $childNode | ||
89 | + * @return $this | ||
90 | + */ | ||
91 | + public function setChildNodes($childNode) | ||
92 | + { | ||
93 | + $this->childNodes = $childNode; | ||
94 | + return $this; | ||
95 | + } | ||
96 | + | ||
97 | + /** | ||
98 | + * 构建tag | ||
99 | + * @param bool $mode | ||
100 | + * @return string | ||
101 | + */ | ||
102 | + private function _makeTag($mode = false) | ||
103 | + { | ||
104 | + if (empty($this->tagName)) return ''; | ||
105 | + $_tagVal = $this->init()->get($this->tagName); | ||
106 | + if (empty($_tagVal) && $mode == true) { | ||
107 | + $_tagVal = md5(microtime() . mt_rand() . uniqid()); | ||
108 | + $this->init()->set($this->tagName, $_tagVal, 0); | ||
109 | + } | ||
110 | + unset($this->tagName); | ||
111 | + return empty($_tagVal) ? '' : $_tagVal . '.'; | ||
112 | + } | ||
113 | + | ||
114 | + /** | ||
115 | + * 检索一个元素 | ||
116 | + * @param $key | ||
117 | + * @param callable $flags | ||
118 | + * @return mixed | ||
119 | + */ | ||
120 | + public function get($key, &$flags = \MEMCACHE_COMPRESSED) | ||
121 | + { | ||
122 | + return $this->init()->get($this->_makeTag() . $key, $flags); | ||
123 | + } | ||
124 | + | ||
125 | + public function getBy($key, $cacheCb = null, &$casToken = null) | ||
126 | + { | ||
127 | + return $this->init()->get($key, $cacheCb, $casToken); | ||
128 | + } | ||
129 | + | ||
130 | + /** | ||
131 | + * 向一个新的key下面增加一个元素 | ||
132 | + * @param $key | ||
133 | + * @param $value | ||
134 | + * @param $expiration | ||
135 | + * @return bool | ||
136 | + */ | ||
137 | + public function add($key, $value, $expiration = 0) | ||
138 | + { | ||
139 | + return $this->init()->add($this->_makeTag(true) . $key, $value, $expiration); | ||
140 | + } | ||
141 | + | ||
142 | + | ||
143 | + /** | ||
144 | + * 减小数值元素的值 | ||
145 | + * @param $key | ||
146 | + * @param int $offset | ||
147 | + * @return int | ||
148 | + */ | ||
149 | + public function decrement($key, $offset = 1) | ||
150 | + { | ||
151 | + return $this->init()->decrement($this->_makeTag() . $key, $offset); | ||
152 | + } | ||
153 | + | ||
154 | + /** | ||
155 | + * @param $key | ||
156 | + * @param int $time | ||
157 | + * @return bool | ||
158 | + */ | ||
159 | + public function delete($key, $time = 0) | ||
160 | + { | ||
161 | + return $this->init()->delete($this->_makeTag() . $key, $time); | ||
162 | + } | ||
163 | + | ||
164 | + | ||
165 | + /** | ||
166 | + * 增加数值元素的值 | ||
167 | + * @param $key | ||
168 | + * @param int $offset | ||
169 | + * @param int $initialValue | ||
170 | + * @param int $expiry | ||
171 | + * @return int | ||
172 | + */ | ||
173 | + public function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
174 | + { | ||
175 | + return $this->init()->increment($this->_makeTag() . $key, $offset, $initialValue, $expiry); | ||
176 | + } | ||
177 | + | ||
178 | + | ||
179 | + /** | ||
180 | + * 设置 | ||
181 | + * @param $key | ||
182 | + * @param $value | ||
183 | + * @param int $expiration | ||
184 | + * @return bool | ||
185 | + */ | ||
186 | + public function set($key, $var, $expire = 0, $flag = \MEMCACHE_COMPRESSED) | ||
187 | + { | ||
188 | + return $this->init()->set($this->_makeTag(true) . $key, $var, $flag, $expire); | ||
189 | + } | ||
190 | + | ||
191 | + /** | ||
192 | + * 设置tag | ||
193 | + * @param $tagName | ||
194 | + * @return $this | ||
195 | + */ | ||
196 | + public function tag($tagName) | ||
197 | + { | ||
198 | + $this->tagName = $tagName; | ||
199 | + return $this; | ||
200 | + } | ||
196 | } | 201 | } |
1 | -<?php | ||
2 | -/** | ||
3 | - * Created by PhpStorm. | ||
4 | - * User: Zip | ||
5 | - * Date: 14/11/23 | ||
6 | - * Time: 上午1:39 | ||
7 | - */ | ||
8 | - | ||
9 | -namespace Hood\Cache; | ||
10 | - | ||
11 | -use Hood\Core\Root; | ||
12 | -use Hood\Debug\DebugException; | ||
13 | - | ||
14 | -class Memcached extends Root implements CacheInterface | ||
15 | -{ | ||
16 | - private $mcInstances = array(); | ||
17 | - | ||
18 | - private $persistentIDs = array(); | ||
19 | - | ||
20 | - private $timeout = 150; | ||
21 | - | ||
22 | - private $section = 'memcached'; | ||
23 | - | ||
24 | - private $node = 'servers'; | ||
25 | - | ||
26 | - private $tagName = ''; | ||
27 | - | ||
28 | - private $prefix = ''; | ||
29 | - | ||
30 | - private $persistentID = 'hood.cache'; | ||
31 | - | ||
32 | - private $childNodes = 'hosts'; | ||
33 | - | ||
34 | - public function __construct($prefix = '', $persistentID = 'hood.cache') | ||
35 | - { | ||
36 | - parent::__construct(); | ||
37 | - $this->prefix = $prefix; | ||
38 | - $this->persistentIDs[] = $this->persistentID = $persistentID; | ||
39 | - } | ||
40 | - | ||
41 | - /** | ||
42 | - * 设置子节点 | ||
43 | - * @param $childNode | ||
44 | - * @return $this | ||
45 | - */ | ||
46 | - public function setChildNodes($childNode) | ||
47 | - { | ||
48 | - $this->childNodes = $childNode; | ||
49 | - return $this; | ||
50 | - } | ||
51 | - | ||
52 | - /** | ||
53 | - * 设置前缀 | ||
54 | - * @param $prefix | ||
55 | - * @return $this | ||
56 | - */ | ||
57 | - public function setPrefix($prefix) | ||
58 | - { | ||
59 | - $this->prefix = $prefix; | ||
60 | - return $this; | ||
61 | - } | ||
62 | - | ||
63 | - /** | ||
64 | - * 设置共享连接ID | ||
65 | - * @param $persistentID | ||
66 | - * @return $this | ||
67 | - */ | ||
68 | - public function setPersistentID($persistentID) | ||
69 | - { | ||
70 | - $this->persistentID = $persistentID; | ||
71 | - return $this; | ||
72 | - } | ||
73 | - | ||
74 | - /** | ||
75 | - * @param $persistentID | ||
76 | - * @return \Memcached | ||
77 | - * @throws \Hood\Debug\DebugException | ||
78 | - */ | ||
79 | - private function init() | ||
80 | - { | ||
81 | - if (isset($this->mcInstances[$this->persistentID])) { | ||
82 | - $mc = $this->mcInstances[$this->persistentID]; | ||
83 | - } else { | ||
84 | - $instance = new \Memcached(); | ||
85 | - $instance->setOption(\Memcached::OPT_PREFIX_KEY, $this->prefix); | ||
86 | - $instance->setOption(\Memcached::OPT_DISTRIBUTION, \Memcached::DISTRIBUTION_CONSISTENT); // 开启一致性哈希 取模(默认)/ 一致性 | ||
87 | - $instance->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);//ketama算法兼容 设置为md5并且分布算法将会 采用带有权重的一致性hash分布 | ||
88 | - $instance->setOption(\Memcached::OPT_CONNECT_TIMEOUT, $this->timeout); | ||
89 | - if (count($instance->getServerList()) < 1) { | ||
90 | - $server = $this->getServerHost('cache'); | ||
91 | - $_serverHosts = $server->getServerConfig($this->section, $this->node); | ||
92 | - if (empty($_serverHosts[$this->childNodes])) { | ||
93 | - throw new DebugException('Memcache Host Config is Null.'); | ||
94 | - } | ||
95 | - $mcServers = $this->_makeHosts($server->getServer($_serverHosts[$this->childNodes], 2)); | ||
96 | - $instance->addServers($mcServers); | ||
97 | - unset($mcServers); | ||
98 | - } | ||
99 | - $this->mcInstances[$this->persistentID] = $mc = $instance; | ||
100 | - } | ||
101 | - return $mc; | ||
102 | - } | ||
103 | - | ||
104 | - | ||
105 | - /** | ||
106 | - * 设置mc配置的块 | ||
107 | - * @param $section | ||
108 | - * @return $this | ||
109 | - */ | ||
110 | - public function setSection($section) | ||
111 | - { | ||
112 | - $this->section = $section; | ||
113 | - return $this; | ||
114 | - } | ||
115 | - | ||
116 | - /** | ||
117 | - * 设置mc配置的块节点 | ||
118 | - * @param $node | ||
119 | - * @return $this | ||
120 | - */ | ||
121 | - public function setNode($node = null) | ||
122 | - { | ||
123 | - if ($node != null) $this->node = $node; | ||
124 | - return $this; | ||
125 | - } | ||
126 | - | ||
127 | - /** | ||
128 | - * 组织host | ||
129 | - * @param array $hosts | ||
130 | - * @return array | ||
131 | - */ | ||
132 | - private function _makeHosts(array $hosts) | ||
133 | - { | ||
134 | - $_server = array(); | ||
135 | - foreach ($hosts as $key => $val) { | ||
136 | - $_server[] = explode(':', $val); | ||
137 | - } | ||
138 | - return $_server; | ||
139 | - } | ||
140 | - | ||
141 | - /** | ||
142 | - * 构建tag | ||
143 | - * @param bool $mode | ||
144 | - * @return string | ||
145 | - */ | ||
146 | - private function _makeTag($mode = false) | ||
147 | - { | ||
148 | - if (empty($this->tagName)) return ''; | ||
149 | - $_tagVal = $this->init()->get($this->tagName); | ||
150 | - if (empty($_tagVal) && $mode == true) { | ||
151 | - $_tagVal = md5(microtime() . mt_rand() . uniqid()); | ||
152 | - $this->init()->set($this->tagName, $_tagVal, 0); | ||
153 | - } | ||
154 | - unset($this->tagName); | ||
155 | - return empty($_tagVal) ? '' : $_tagVal . '.'; | ||
156 | - } | ||
157 | - | ||
158 | - /** | ||
159 | - * 检索一个元素 | ||
160 | - * @param $key | ||
161 | - * @param callable $cache_cb | ||
162 | - * @param float $cas_token | ||
163 | - * @return mixed | ||
164 | - */ | ||
165 | - public function get($key, $cacheCb = null, &$casToken = null) | ||
166 | - { | ||
167 | - return $this->init()->get($this->_makeTag() . $key, $cacheCb, $casToken); | ||
168 | - } | ||
169 | - | ||
170 | - /** | ||
171 | - * 向一个新的key下面增加一个元素 | ||
172 | - * @param $key | ||
173 | - * @param $value | ||
174 | - * @param $expiration | ||
175 | - * @return bool | ||
176 | - */ | ||
177 | - public function add($key, $value, $expiration = 0) | ||
178 | - { | ||
179 | - return $this->init()->add($this->_makeTag(true) . $key, $value, $expiration); | ||
180 | - } | ||
181 | - | ||
182 | - /** | ||
183 | - * 向已存在元素后追加数据 | ||
184 | - * @param $key | ||
185 | - * @param $value | ||
186 | - * @return bool | ||
187 | - */ | ||
188 | - public function append($key, $value) | ||
189 | - { | ||
190 | - return $this->init()->append($this->_makeTag(true) . $key, $value); | ||
191 | - } | ||
192 | - | ||
193 | - /** | ||
194 | - * 比较并交换值 | ||
195 | - * @param $casToken | ||
196 | - * @param $key | ||
197 | - * @param $value | ||
198 | - * @param int $expiration | ||
199 | - * @return bool | ||
200 | - */ | ||
201 | - public function cas($casToken, $key, $value, $expiration = 0) | ||
202 | - { | ||
203 | - return $this->init()->cas($casToken, $this->_makeTag(true) . $key, $value, $expiration); | ||
204 | - } | ||
205 | - | ||
206 | - /** | ||
207 | - * 减小数值元素的值 | ||
208 | - * @param $key | ||
209 | - * @param int $offset | ||
210 | - * @return int | ||
211 | - */ | ||
212 | - public function decrement($key, $offset = 1) | ||
213 | - { | ||
214 | - return $this->init()->decrement($this->_makeTag() . $key, $offset); | ||
215 | - } | ||
216 | - | ||
217 | - /** | ||
218 | - * @param $key | ||
219 | - * @param int $time | ||
220 | - * @return bool | ||
221 | - */ | ||
222 | - public function delete($key, $time = 0) | ||
223 | - { | ||
224 | - return $this->init()->delete($this->_makeTag() . $key, $time); | ||
225 | - } | ||
226 | - | ||
227 | - /** | ||
228 | - * 删除多个数据 | ||
229 | - * @param array $keys | ||
230 | - * @param int $time | ||
231 | - * @return bool | ||
232 | - */ | ||
233 | - public function deleteMulti(array $keys, $time = 0) | ||
234 | - { | ||
235 | - return $this->init()->deleteMulti($this->_makeMultiKey($keys), $time); | ||
236 | - } | ||
237 | - | ||
238 | - /** | ||
239 | - * 组合多key 数据 | ||
240 | - * @param $keys | ||
241 | - * @return array | ||
242 | - */ | ||
243 | - private function _makeMultiKey($keys, $mode = false) | ||
244 | - { | ||
245 | - $_keys = array(); | ||
246 | - $tag = $this->_makeTag($mode); | ||
247 | - foreach ($keys as $key) { | ||
248 | - $_keys[] = $tag . $key; | ||
249 | - } | ||
250 | - return $_keys; | ||
251 | - } | ||
252 | - | ||
253 | - /** | ||
254 | - * 请求多个元素 | ||
255 | - * @param array $keys | ||
256 | - * @param null $withCas | ||
257 | - * @param callable $valueCb | ||
258 | - * @return bool | ||
259 | - */ | ||
260 | - public function getDelayed(array $keys, $withCas = null, callable $valueCb = null) | ||
261 | - { | ||
262 | - return $this->init()->getDelayed($this->_makeMultiKey($keys), $withCas, $valueCb); | ||
263 | - } | ||
264 | - | ||
265 | - /** | ||
266 | - * 抓取所有剩余的结果 | ||
267 | - * @return array | ||
268 | - */ | ||
269 | - public function fetchAll() | ||
270 | - { | ||
271 | - return $this->init()->fetchAll(); | ||
272 | - } | ||
273 | - | ||
274 | - /** | ||
275 | - * 检索多个元素 | ||
276 | - * @param array $keys | ||
277 | - * @param array $cas_tokens | ||
278 | - * @param null $flags | ||
279 | - * @return mixed | ||
280 | - */ | ||
281 | - public function getMulti(array $keys, array &$casTokens = null, $flags = null) | ||
282 | - { | ||
283 | - return $this->init()->getMulti($this->_makeMultiKey($keys), $casTokens, $flags); | ||
284 | - } | ||
285 | - | ||
286 | - /** | ||
287 | - * 增加数值元素的值 | ||
288 | - * @param $key | ||
289 | - * @param int $offset | ||
290 | - * @param int $initialValue | ||
291 | - * @param int $expiry | ||
292 | - * @return int | ||
293 | - */ | ||
294 | - public function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
295 | - { | ||
296 | - return $this->init()->increment($this->_makeTag() . $key, $offset, $initialValue, $expiry); | ||
297 | - } | ||
298 | - | ||
299 | - /** | ||
300 | - * 检查memcache是否长连接 | ||
301 | - * @return bool | ||
302 | - */ | ||
303 | - public function isPersistent() | ||
304 | - { | ||
305 | - return $this->init()->isPersistent(); | ||
306 | - } | ||
307 | - | ||
308 | - /** | ||
309 | - * 设置 | ||
310 | - * @param $key | ||
311 | - * @param $value | ||
312 | - * @param int $expiration | ||
313 | - * @return bool | ||
314 | - */ | ||
315 | - public function set($key, $value, $expiration = 0) | ||
316 | - { | ||
317 | - return $this->init()->set($this->_makeTag(true) . $key, $value, $expiration); | ||
318 | - } | ||
319 | - | ||
320 | - /** | ||
321 | - * 设置多个数据 | ||
322 | - * @param array $items | ||
323 | - * @param int $expiration | ||
324 | - * @return bool | ||
325 | - */ | ||
326 | - public function setMulti(array $items, $expiration = 0) | ||
327 | - { | ||
328 | - $_items = array(); | ||
329 | - $tag = $this->_makeTag(true); | ||
330 | - foreach ($items as $key => $val) { | ||
331 | - $_items[$tag . $key] = $val; | ||
332 | - } | ||
333 | - return $this->init()->setMulti($_items, $expiration); | ||
334 | - } | ||
335 | - | ||
336 | - /** | ||
337 | - * 设置tag | ||
338 | - * @param $tagName | ||
339 | - * @return $this | ||
340 | - */ | ||
341 | - public function tag($tagName) | ||
342 | - { | ||
343 | - $this->tagName = $tagName; | ||
344 | - return $this; | ||
345 | - } | ||
346 | - | ||
347 | - /** | ||
348 | - * 清除服务列表 | ||
349 | - * @return $this | ||
350 | - */ | ||
351 | - public function resetServerList() | ||
352 | - { | ||
353 | - $this->init()->resetServerList(); | ||
354 | - return $this; | ||
355 | - } | 1 | +<?php |
2 | +/** | ||
3 | + * Created by PhpStorm. | ||
4 | + * User: Zip | ||
5 | + * Date: 14/11/23 | ||
6 | + * Time: 上午1:39 | ||
7 | + */ | ||
8 | + | ||
9 | +namespace Hood\Cache; | ||
10 | + | ||
11 | +use Hood\Core\Root; | ||
12 | +use Hood\Debug\DebugException; | ||
13 | + | ||
14 | +class Memcached extends Root implements CacheInterface | ||
15 | +{ | ||
16 | + private $mcInstances = array(); | ||
17 | + | ||
18 | + private $persistentIDs = array(); | ||
19 | + | ||
20 | + private $timeout = 150; | ||
21 | + | ||
22 | + private $section = 'memcached'; | ||
23 | + | ||
24 | + private $node = 'servers'; | ||
25 | + | ||
26 | + private $tagName = ''; | ||
27 | + | ||
28 | + private $prefix = ''; | ||
29 | + | ||
30 | + private $persistentID = 'hood.cache'; | ||
31 | + | ||
32 | + private $childNodes = 'hosts'; | ||
33 | + | ||
34 | + public function __construct($prefix = '', $persistentID = 'hood.cache') | ||
35 | + { | ||
36 | + parent::__construct(); | ||
37 | + $this->prefix = $prefix; | ||
38 | + $this->persistentIDs[] = $this->persistentID = $persistentID; | ||
39 | + } | ||
40 | + | ||
41 | + /** | ||
42 | + * 设置子节点 | ||
43 | + * @param $childNode | ||
44 | + * @return $this | ||
45 | + */ | ||
46 | + public function setChildNodes($childNode) | ||
47 | + { | ||
48 | + $this->childNodes = $childNode; | ||
49 | + return $this; | ||
50 | + } | ||
51 | + | ||
52 | + /** | ||
53 | + * 设置前缀 | ||
54 | + * @param $prefix | ||
55 | + * @return $this | ||
56 | + */ | ||
57 | + public function setPrefix($prefix) | ||
58 | + { | ||
59 | + $this->prefix = $prefix; | ||
60 | + return $this; | ||
61 | + } | ||
62 | + | ||
63 | + /** | ||
64 | + * 设置共享连接ID | ||
65 | + * @param $persistentID | ||
66 | + * @return $this | ||
67 | + */ | ||
68 | + public function setPersistentID($persistentID) | ||
69 | + { | ||
70 | + $this->persistentID = $persistentID; | ||
71 | + return $this; | ||
72 | + } | ||
73 | + | ||
74 | + /** | ||
75 | + * @param $persistentID | ||
76 | + * @return \Memcached | ||
77 | + * @throws \Hood\Debug\DebugException | ||
78 | + */ | ||
79 | + private function init() | ||
80 | + { | ||
81 | + if (isset($this->mcInstances[$this->persistentID])) { | ||
82 | + $mc = $this->mcInstances[$this->persistentID]; | ||
83 | + } else { | ||
84 | + $instance = new \Memcached(); | ||
85 | + $instance->setOption(\Memcached::OPT_PREFIX_KEY, $this->prefix); | ||
86 | + $instance->setOption(\Memcached::OPT_DISTRIBUTION, \Memcached::DISTRIBUTION_CONSISTENT); // 开启一致性哈希 取模(默认)/ 一致性 | ||
87 | + $instance->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);//ketama算法兼容 设置为md5并且分布算法将会 采用带有权重的一致性hash分布 | ||
88 | + $instance->setOption(\Memcached::OPT_CONNECT_TIMEOUT, $this->timeout); | ||
89 | + if (count($instance->getServerList()) < 1) { | ||
90 | + $server = $this->getServerHost('cache'); | ||
91 | + $_serverHosts = $server->getServerConfig($this->section, $this->node); | ||
92 | + if (empty($_serverHosts[$this->childNodes])) { | ||
93 | + throw new DebugException('Memcache Host Config is Null.'); | ||
94 | + } | ||
95 | + $mcServers = $this->_makeHosts($server->getServer($_serverHosts[$this->childNodes], 2)); | ||
96 | + $instance->addServers($mcServers); | ||
97 | + unset($mcServers); | ||
98 | + } | ||
99 | + $this->mcInstances[$this->persistentID] = $mc = $instance; | ||
100 | + } | ||
101 | + return $mc; | ||
102 | + } | ||
103 | + | ||
104 | + | ||
105 | + /** | ||
106 | + * 设置mc配置的块 | ||
107 | + * @param $section | ||
108 | + * @return $this | ||
109 | + */ | ||
110 | + public function setSection($section) | ||
111 | + { | ||
112 | + $this->section = $section; | ||
113 | + return $this; | ||
114 | + } | ||
115 | + | ||
116 | + /** | ||
117 | + * 设置mc配置的块节点 | ||
118 | + * @param $node | ||
119 | + * @return $this | ||
120 | + */ | ||
121 | + public function setNode($node = null) | ||
122 | + { | ||
123 | + if ($node != null) $this->node = $node; | ||
124 | + return $this; | ||
125 | + } | ||
126 | + | ||
127 | + /** | ||
128 | + * 组织host | ||
129 | + * @param array $hosts | ||
130 | + * @return array | ||
131 | + */ | ||
132 | + private function _makeHosts(array $hosts) | ||
133 | + { | ||
134 | + $_server = array(); | ||
135 | + foreach ($hosts as $key => $val) { | ||
136 | + $_server[] = explode(':', $val); | ||
137 | + } | ||
138 | + return $_server; | ||
139 | + } | ||
140 | + | ||
141 | + /** | ||
142 | + * 构建tag | ||
143 | + * @param bool $mode | ||
144 | + * @return string | ||
145 | + */ | ||
146 | + private function _makeTag($mode = false) | ||
147 | + { | ||
148 | + if (empty($this->tagName)) return ''; | ||
149 | + $_tagVal = $this->init()->get($this->tagName); | ||
150 | + if (empty($_tagVal) && $mode == true) { | ||
151 | + $_tagVal = md5(microtime() . mt_rand() . uniqid()); | ||
152 | + $this->init()->set($this->tagName, $_tagVal, 0); | ||
153 | + } | ||
154 | + unset($this->tagName); | ||
155 | + return empty($_tagVal) ? '' : $_tagVal . '.'; | ||
156 | + } | ||
157 | + | ||
158 | + /** | ||
159 | + * 检索一个元素 | ||
160 | + * @param $key | ||
161 | + * @param callable $cache_cb | ||
162 | + * @param float $cas_token | ||
163 | + * @return mixed | ||
164 | + */ | ||
165 | + public function get($key, $cacheCb = null, &$casToken = null) | ||
166 | + { | ||
167 | + return $this->init()->get($this->_makeTag() . $key, $cacheCb, $casToken); | ||
168 | + } | ||
169 | + | ||
170 | + public function getBy($key, $cacheCb = null, &$casToken = null) | ||
171 | + { | ||
172 | + return $this->init()->get($key, $cacheCb, $casToken); | ||
173 | + } | ||
174 | + | ||
175 | + /** | ||
176 | + * 向一个新的key下面增加一个元素 | ||
177 | + * @param $key | ||
178 | + * @param $value | ||
179 | + * @param $expiration | ||
180 | + * @return bool | ||
181 | + */ | ||
182 | + public function add($key, $value, $expiration = 0) | ||
183 | + { | ||
184 | + return $this->init()->add($this->_makeTag(true) . $key, $value, $expiration); | ||
185 | + } | ||
186 | + | ||
187 | + /** | ||
188 | + * 向已存在元素后追加数据 | ||
189 | + * @param $key | ||
190 | + * @param $value | ||
191 | + * @return bool | ||
192 | + */ | ||
193 | + public function append($key, $value) | ||
194 | + { | ||
195 | + return $this->init()->append($this->_makeTag(true) . $key, $value); | ||
196 | + } | ||
197 | + | ||
198 | + /** | ||
199 | + * 比较并交换值 | ||
200 | + * @param $casToken | ||
201 | + * @param $key | ||
202 | + * @param $value | ||
203 | + * @param int $expiration | ||
204 | + * @return bool | ||
205 | + */ | ||
206 | + public function cas($casToken, $key, $value, $expiration = 0) | ||
207 | + { | ||
208 | + return $this->init()->cas($casToken, $this->_makeTag(true) . $key, $value, $expiration); | ||
209 | + } | ||
210 | + | ||
211 | + /** | ||
212 | + * 减小数值元素的值 | ||
213 | + * @param $key | ||
214 | + * @param int $offset | ||
215 | + * @return int | ||
216 | + */ | ||
217 | + public function decrement($key, $offset = 1) | ||
218 | + { | ||
219 | + return $this->init()->decrement($this->_makeTag() . $key, $offset); | ||
220 | + } | ||
221 | + | ||
222 | + /** | ||
223 | + * @param $key | ||
224 | + * @param int $time | ||
225 | + * @return bool | ||
226 | + */ | ||
227 | + public function delete($key, $time = 0) | ||
228 | + { | ||
229 | + return $this->init()->delete($this->_makeTag() . $key, $time); | ||
230 | + } | ||
231 | + | ||
232 | + /** | ||
233 | + * 删除多个数据 | ||
234 | + * @param array $keys | ||
235 | + * @param int $time | ||
236 | + * @return bool | ||
237 | + */ | ||
238 | + public function deleteMulti(array $keys, $time = 0) | ||
239 | + { | ||
240 | + return $this->init()->deleteMulti($this->_makeMultiKey($keys), $time); | ||
241 | + } | ||
242 | + | ||
243 | + /** | ||
244 | + * 组合多key 数据 | ||
245 | + * @param $keys | ||
246 | + * @return array | ||
247 | + */ | ||
248 | + private function _makeMultiKey($keys, $mode = false) | ||
249 | + { | ||
250 | + $_keys = array(); | ||
251 | + $tag = $this->_makeTag($mode); | ||
252 | + foreach ($keys as $key) { | ||
253 | + $_keys[] = $tag . $key; | ||
254 | + } | ||
255 | + return $_keys; | ||
256 | + } | ||
257 | + | ||
258 | + /** | ||
259 | + * 请求多个元素 | ||
260 | + * @param array $keys | ||
261 | + * @param null $withCas | ||
262 | + * @param callable $valueCb | ||
263 | + * @return bool | ||
264 | + */ | ||
265 | + public function getDelayed(array $keys, $withCas = null, callable $valueCb = null) | ||
266 | + { | ||
267 | + return $this->init()->getDelayed($this->_makeMultiKey($keys), $withCas, $valueCb); | ||
268 | + } | ||
269 | + | ||
270 | + /** | ||
271 | + * 抓取所有剩余的结果 | ||
272 | + * @return array | ||
273 | + */ | ||
274 | + public function fetchAll() | ||
275 | + { | ||
276 | + return $this->init()->fetchAll(); | ||
277 | + } | ||
278 | + | ||
279 | + /** | ||
280 | + * 检索多个元素 | ||
281 | + * @param array $keys | ||
282 | + * @param array $cas_tokens | ||
283 | + * @param null $flags | ||
284 | + * @return mixed | ||
285 | + */ | ||
286 | + public function getMulti(array $keys, array &$casTokens = null, $flags = null) | ||
287 | + { | ||
288 | + return $this->init()->getMulti($this->_makeMultiKey($keys), $casTokens, $flags); | ||
289 | + } | ||
290 | + | ||
291 | + /** | ||
292 | + * 增加数值元素的值 | ||
293 | + * @param $key | ||
294 | + * @param int $offset | ||
295 | + * @param int $initialValue | ||
296 | + * @param int $expiry | ||
297 | + * @return int | ||
298 | + */ | ||
299 | + public function increment($key, $offset = 1, $initialValue = 0, $expiry = 0) | ||
300 | + { | ||
301 | + return $this->init()->increment($this->_makeTag() . $key, $offset, $initialValue, $expiry); | ||
302 | + } | ||
303 | + | ||
304 | + /** | ||
305 | + * 检查memcache是否长连接 | ||
306 | + * @return bool | ||
307 | + */ | ||
308 | + public function isPersistent() | ||
309 | + { | ||
310 | + return $this->init()->isPersistent(); | ||
311 | + } | ||
312 | + | ||
313 | + /** | ||
314 | + * 设置 | ||
315 | + * @param $key | ||
316 | + * @param $value | ||
317 | + * @param int $expiration | ||
318 | + * @return bool | ||
319 | + */ | ||
320 | + public function set($key, $value, $expiration = 0) | ||
321 | + { | ||
322 | + return $this->init()->set($this->_makeTag(true) . $key, $value, $expiration); | ||
323 | + } | ||
324 | + | ||
325 | + /** | ||
326 | + * 设置多个数据 | ||
327 | + * @param array $items | ||
328 | + * @param int $expiration | ||
329 | + * @return bool | ||
330 | + */ | ||
331 | + public function setMulti(array $items, $expiration = 0) | ||
332 | + { | ||
333 | + $_items = array(); | ||
334 | + $tag = $this->_makeTag(true); | ||
335 | + foreach ($items as $key => $val) { | ||
336 | + $_items[$tag . $key] = $val; | ||
337 | + } | ||
338 | + return $this->init()->setMulti($_items, $expiration); | ||
339 | + } | ||
340 | + | ||
341 | + /** | ||
342 | + * 设置tag | ||
343 | + * @param $tagName | ||
344 | + * @return $this | ||
345 | + */ | ||
346 | + public function tag($tagName) | ||
347 | + { | ||
348 | + $this->tagName = $tagName; | ||
349 | + return $this; | ||
350 | + } | ||
351 | + | ||
352 | + /** | ||
353 | + * 清除服务列表 | ||
354 | + * @return $this | ||
355 | + */ | ||
356 | + public function resetServerList() | ||
357 | + { | ||
358 | + $this->init()->resetServerList(); | ||
359 | + return $this; | ||
360 | + } | ||
356 | } | 361 | } |
1 | -[memcached] | ||
2 | -master.hosts=127.0.0.1:11212,127.0.0.1:11213 | ||
3 | -slave.hosts=127.0.0.1:11212,127.0.0.1:11213 | ||
4 | -session.hosts=127.0.0.1:11212,127.0.0.1:11213 | ||
5 | - | ||
6 | -[redis] | 1 | +[memcached] |
2 | +master.hosts=127.0.0.1:12111 | ||
3 | +slave.hosts=127.0.0.1:12111 | ||
4 | +session.hosts=127.0.0.1:12111 | ||
5 | + | ||
6 | +[redis] | ||
7 | servers.hosts = 127.0.0.1:6379 | 7 | servers.hosts = 127.0.0.1:6379 |
@@ -12,7 +12,7 @@ defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'preview'); | @@ -12,7 +12,7 @@ defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'preview'); | ||
12 | 12 | ||
13 | define('EXHIBITION_TICKET', 51335912);//展览票skn | 13 | define('EXHIBITION_TICKET', 51335912);//展览票skn |
14 | 14 | ||
15 | -define('USE_INTER_FACE_SHUNT', false);//分流开关 | 15 | +define('USE_INTER_FACE_SHUNT', true);//分流开关 |
16 | 16 | ||
17 | define('API_URL', 'http://api.yoho.yohoops.org/'); | 17 | define('API_URL', 'http://api.yoho.yohoops.org/'); |
18 | define('SERVICE_URL', 'http://service.yoho.yohoops.org/'); | 18 | define('SERVICE_URL', 'http://service.yoho.yohoops.org/'); |
@@ -12,7 +12,7 @@ defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production'); | @@ -12,7 +12,7 @@ defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'production'); | ||
12 | 12 | ||
13 | define('EXHIBITION_TICKET', 51335912);//展览票skn | 13 | define('EXHIBITION_TICKET', 51335912);//展览票skn |
14 | 14 | ||
15 | -define('USE_INTER_FACE_SHUNT', false);//分流开关 | 15 | +define('USE_INTER_FACE_SHUNT', true);//分流开关 |
16 | 16 | ||
17 | define('API_URL', 'http://api.yoho.yohoops.org/'); | 17 | define('API_URL', 'http://api.yoho.yohoops.org/'); |
18 | define('SERVICE_URL', 'http://service.yoho.yohoops.org/'); | 18 | define('SERVICE_URL', 'http://service.yoho.yohoops.org/'); |
-
Please register or login to post a comment