Authored by 梁志锋

Merge remote-tracking branch 'origin/master'

@@ -152,9 +152,11 @@ class Yohobuy @@ -152,9 +152,11 @@ class Yohobuy
152 * @parma mixed $cache 控制是否启用接口数据的缓存(时间单位为秒). 如3600表示缓存1小时, false表示不缓存 152 * @parma mixed $cache 控制是否启用接口数据的缓存(时间单位为秒). 如3600表示缓存1小时, false表示不缓存
153 * @param bool $returnJson 控制是否返回json格式数据 153 * @param bool $returnJson 控制是否返回json格式数据
154 * @param int $timeout 超时时间 154 * @param int $timeout 超时时间
  155 + * @param null $userAgent
  156 + * @param bool $useGzip 是否启用Gzip
155 * @return mixed 157 * @return mixed
156 */ 158 */
157 - public static function get($url, $data = array(), $cache = false, $returnJson = false, $timeout = 5, $userAgent = null) 159 + public static function get($url, $data = array(), $cache = false, $returnJson = false, $timeout = 5, $userAgent = null, $useGzip = true)
158 { 160 {
159 // 销毁私钥参数 161 // 销毁私钥参数
160 if (isset($data['private_key'])) { 162 if (isset($data['private_key'])) {
@@ -175,6 +177,9 @@ class Yohobuy @@ -175,6 +177,9 @@ class Yohobuy
175 curl_setopt($ch, CURLOPT_HEADER, 0); 177 curl_setopt($ch, CURLOPT_HEADER, 0);
176 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout); 178 curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
177 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 179 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  180 + if ($useGzip) {
  181 + curl_setopt($ch, CURLOPT_ENCODING, 'gzip');
  182 + }
178 if (!empty($userAgent)) { 183 if (!empty($userAgent)) {
179 curl_setopt($ch, CURLOPT_USERAGENT, $userAgent); 184 curl_setopt($ch, CURLOPT_USERAGENT, $userAgent);
180 } 185 }
@@ -31,7 +31,7 @@ class SearchData @@ -31,7 +31,7 @@ class SearchData
31 case 'production': 31 case 'production':
32 case 'release': 32 case 'release':
33 //return 'http://search.yoho.cn/yohosearch/search.json'; 33 //return 'http://search.yoho.cn/yohosearch/search.json';
34 - return 'http://101.201.178.220/yohosearch/search.json'; //return 'http://100.98.132.63/yohosearch/search.json'; 34 + return 'http://search.yohoops.org/yohosearch/search.json'; //return 'http://100.98.132.63/yohosearch/search.json';
35 case 'preview': 35 case 'preview':
36 return 'http://101.200.31.165/yohosearch/search.json'; 36 return 'http://101.200.31.165/yohosearch/search.json';
37 case 'test': 37 case 'test':
1 [memcached] 1 [memcached]
2 -master.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111  
3 -slave.hosts=192.168.166.16:12112,192.168.166.17:12112,192.168.166.18:12112  
4 -session.hosts=192.168.166.16:12111,192.168.166.17:12111,192.168.166.18:12111 2 +master.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
  3 +slave.hosts=memcache1.yohoops.org:12112,memcache2.yohoops.org:12112,memcache3.yohoops.org:12112
  4 +session.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
5 5
6 [redis] 6 [redis]
7 servers.hosts=127.0.0.1:6379 7 servers.hosts=127.0.0.1:6379
1 [memcached] 1 [memcached]
2 -master.hosts=10.66.1.6:12111,10.66.1.7:12111,10.66.1.8:12111  
3 -slave.hosts=10.66.1.6:12112,10.66.1.7:12112,10.66.1.8:12112  
4 -session.hosts=10.66.1.6:12111,10.66.1.7:12111,10.66.1.8:12111 2 +master.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
  3 +slave.hosts=memcache1.yohoops.org:12112,memcache2.yohoops.org:12112,memcache3.yohoops.org:12112
  4 +session.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
5 5
6 [redis] 6 [redis]
7 servers.hosts=127.0.0.1:6379 7 servers.hosts=127.0.0.1:6379
1 [memcached] 1 [memcached]
2 -master.hosts=10.66.1.6:12111,10.66.1.7:12111,10.66.1.8:12111  
3 -slave.hosts=10.66.1.6:12112,10.66.1.7:12112,10.66.1.8:12112  
4 -session.hosts=10.66.1.6:12111,10.66.1.7:12111,10.66.1.8:12111 2 +master.hosts=10.66.101.9:12111,10.66.101.9:12111,10.66.101.9:12111
  3 +slave.hosts=10.66.101.9:12112,10.66.101.9:12112,10.66.101.9:12112
  4 +session.hosts=10.66.101.9:12111,10.66.101.9:12111,10.66.101.9:12111
5 5
6 [redis] 6 [redis]
7 servers.hosts=127.0.0.1:6379 7 servers.hosts=127.0.0.1:6379
1 [memcached] 1 [memcached]
2 -master.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311  
3 -slave.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311  
4 -session.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311 2 +master.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
  3 +slave.hosts=memcache1.yohoops.org:12112,memcache2.yohoops.org:12112,memcache3.yohoops.org:12112
  4 +session.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
5 5
6 [redis] 6 [redis]
7 servers.hosts=127.0.0.1:6379 7 servers.hosts=127.0.0.1:6379
1 [memcached] 1 [memcached]
2 -master.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311  
3 -slave.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311  
4 -session.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311 2 +master.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
  3 +slave.hosts=memcache1.yohoops.org:12112,memcache2.yohoops.org:12112,memcache3.yohoops.org:12112
  4 +session.hosts=memcache1.yohoops.org:12111,memcache2.yohoops.org:12111,memcache3.yohoops.org:12111
5 5
6 [redis] 6 [redis]
7 servers.hosts=127.0.0.1:6379 7 servers.hosts=127.0.0.1:6379
1 [memcached] 1 [memcached]
2 -master.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311  
3 -slave.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311  
4 -session.hosts=10.66.101.9:11111,10.66.101.9:11211,10.66.101.9:11311 2 +master.hosts=10.66.101.9:12111,10.66.101.9:12111,10.66.101.9:12111
  3 +slave.hosts=10.66.101.9:12112,10.66.101.9:12112,10.66.101.9:12112
  4 +session.hosts=10.66.101.9:12111,10.66.101.9:12111,10.66.101.9:12111
5 5
6 [redis] 6 [redis]
7 servers.hosts=127.0.0.1:6379 7 servers.hosts=127.0.0.1:6379