Commit 21f3b6a7 authored by shajiaiming's avatar shajiaiming

fix

parent 385d80db
......@@ -33,7 +33,7 @@ class Bitfinex extends Exchange implements ExchangeInterface
public function setSupportedSymbol()
{
$curl = new Curl();
$result = $curl->get('https://api.bitfinex.com/v1/symbols');
$result = $curl->get('https://api.bitfinex.com/v1/symbols', false);
if ($result) {
foreach ($result as $item) {
$this->redis->sadd($this->supported_symbol, 't' . strtoupper($item));
......@@ -46,7 +46,8 @@ class Bitfinex extends Exchange implements ExchangeInterface
$symbols = $this->redis->smembers($this->supported_symbol);
$query = '?symbols=' . implode(',', $symbols);
$curl = new Curl();
$res = $curl->get('https://api.bitfinex.com/v2/tickers' . $query);
$res = $curl->get('https://api.bitfinex.com/v2/tickers' . $query, false);
if(false == $res){
return;
}
......
......@@ -25,7 +25,7 @@ class Bittrex extends Exchange implements ExchangeInterface
{
$api = 'https://bittrex.com/api/v1.1/public/getmarkets';
$curl = new Curl();
$rev = $curl->get($api);
$rev = $curl->get($api, false);
if ($rev && $rev['success']) {
$lists = $rev['result'];
foreach ($lists as $item) {
......
......@@ -48,7 +48,7 @@ class Bty extends Exchange implements ExchangeInterface
$platforms = ['HKJB', 'BB360'];
$curl = new Curl();
foreach($platforms as $platform) {
$content = $curl->get($this->base_url . $platform);
$content = $curl->get($this->base_url . $platform, false);
if (is_array($content) && isset($content['code']) && $content['code'] == 200) {
$data = $content['data']['USDT'];
foreach ($data as $item) {
......
......@@ -21,7 +21,7 @@ class Hadax extends HuoBi
{
$curl = new Curl();
$api = $this->base_url . '/v1/hadax/common/symbols';
$res = $curl->get($api);//json
$res = $curl->get($api, false);//json
if ($res && $res['status'] == 'ok') {
$data = $res['data'];
foreach ($data as $item) {
......
......@@ -24,9 +24,9 @@ class HuoBi extends Exchange implements ExchangeInterface
public function setSupportedSymbol()
{
$api = $this->base_url . '/v1/common/symbols';
$curl = new Curl();
$res = $curl->get($api);//json
$api = $this->base_url . '/v1/common/symbols';
$res = $curl->get($api, false);//json
if ($res && $res['status'] == 'ok') {
$data = $res['data'];
foreach ($data as $item) {
......@@ -38,8 +38,8 @@ class HuoBi extends Exchange implements ExchangeInterface
public function setQuotation()
{
$api = $this->base_url . '/market/tickers';
$curl = new Curl();
$api = $this->base_url . '/market/tickers';
$res = $curl->get($api, false);
if ($res && $res['status'] == 'ok') {
$datas = $res['data'];
......
......@@ -55,7 +55,7 @@ class Token7 extends Exchange implements ExchangeInterface
public function setQuotation()
{
$curl = new Curl();
$content = $curl->get($this->base_url);
$content = $curl->get($this->base_url, false);
if (is_array($content) && isset($content['date']) && isset($content['ticker'])) {
$data = $content['ticker'];
foreach ($data as $item) {
......
......@@ -29,7 +29,7 @@ class Zb extends Exchange implements ExchangeInterface
{
$api = "http://api.zb.com/data/v1/markets";
$curl = new Curl();
$rev = $curl->get($api);
$rev = $curl->get($api, false);
if ($rev) {
$keys = array_keys($rev);
foreach ($keys as $key) {
......@@ -42,7 +42,7 @@ class Zb extends Exchange implements ExchangeInterface
{
$api = 'http://api.zb.com/data/v1/allTicker';
$curl = new Curl();
$rev = $curl->get($api);
$rev = $curl->get($api, false);
if ($rev) {
foreach ($rev as $key => $item) {
$this->redis->hmset($this->quotation_prefix . $key, 'low', $item['low'], 'high', $item['high'], 'last',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment