Showing
1 changed file
with
7 additions
and
4 deletions
@@ -9,11 +9,11 @@ | @@ -9,11 +9,11 @@ | ||
9 | * @version 1.0 (2015-9-15 11:55:25) | 9 | * @version 1.0 (2015-9-15 11:55:25) |
10 | * @author fei.hong <fei.hong@yoho.cn> | 10 | * @author fei.hong <fei.hong@yoho.cn> |
11 | */ | 11 | */ |
12 | + | ||
12 | namespace Action; | 13 | namespace Action; |
13 | 14 | ||
14 | use Yaf\Controller_Abstract; | 15 | use Yaf\Controller_Abstract; |
15 | use Yaf\Dispatcher; | 16 | use Yaf\Dispatcher; |
16 | - | ||
17 | use Hood\Cache; | 17 | use Hood\Cache; |
18 | 18 | ||
19 | class AbstractAction extends Controller_Abstract | 19 | class AbstractAction extends Controller_Abstract |
@@ -67,9 +67,12 @@ class AbstractAction extends Controller_Abstract | @@ -67,9 +67,12 @@ class AbstractAction extends Controller_Abstract | ||
67 | */ | 67 | */ |
68 | protected function memcache($node = null, $childNode = 'hosts') | 68 | protected function memcache($node = null, $childNode = 'hosts') |
69 | { | 69 | { |
70 | + // WINDOWS | ||
70 | if (PATH_SEPARATOR === '\\') { | 71 | if (PATH_SEPARATOR === '\\') { |
71 | return Cache::memcache($node, $childNode); | 72 | return Cache::memcache($node, $childNode); |
72 | - } else { | 73 | + } |
74 | + // LINUX | ||
75 | + else { | ||
73 | return Cache::memcached($node, $childNode); | 76 | return Cache::memcached($node, $childNode); |
74 | } | 77 | } |
75 | } | 78 | } |
@@ -92,8 +95,8 @@ class AbstractAction extends Controller_Abstract | @@ -92,8 +95,8 @@ class AbstractAction extends Controller_Abstract | ||
92 | protected function echoJson($json) | 95 | protected function echoJson($json) |
93 | { | 96 | { |
94 | headers_sent() || header('Content-Type: application/json; charset=utf-8;'); | 97 | headers_sent() || header('Content-Type: application/json; charset=utf-8;'); |
95 | - if(is_array($json)) | ||
96 | - { | 98 | + |
99 | + if (is_array($json)) { | ||
97 | $json = json_encode($json); | 100 | $json = json_encode($json); |
98 | } | 101 | } |
99 | 102 |
-
Please register or login to post a comment