Skip to content

Commit 150aed4

Browse files
committed
php/test enableRateLimit is on by default
1 parent e6a7ecb commit 150aed4

File tree

54 files changed

+345
-312
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+345
-312
lines changed

examples/php/arbitrage-pairs.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44

55
include $root . '/ccxt.php';
66
include 'Console/Table.php'; // pear-install it from here: https://pear.php.net/package/Console_Table/
77

8-
date_default_timezone_set ('UTC');
8+
date_default_timezone_set('UTC');
99

1010
function style ($s, $style) { return $style . $s . "\033[0m"; }
1111
function green ($s) { return style ($s, "\033[92m"); }

examples/php/async-cancel-order.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
$id = 'binance';
1010
$exchange_class = '\\ccxtpro\\' . $id;
1111
$exchange = new $exchange_class(array(
12-
'enableRateLimit' => true,
1312
'apiKey' => 'YOUR_API_KEY',
1413
'secret' => 'YOUR_SECRET',
1514
));

examples/php/async-multiple-tickers-one-exchange.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44
include_once $root . '/vendor/autoload.php';
55

66
use ccxt\async;
77
use React\Promise;
88

99
$exchange = new async\binance([
10-
'enableRateLimit' => true,
1110
'verbose' => true,
1211
]);
1312

examples/php/async-poll-multiple-exchange-orderbooks-yield.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,9 @@
55

66
use ccxt\async;
77

8-
$binance = new async\binance([
9-
'enableRateLimit' => true,
10-
]);
11-
12-
$bitfinex = new async\bitfinex2([
13-
'enableRateLimit' => true,
14-
]);
15-
16-
$poloniex = new async\poloniex([
17-
'enableRateLimit' => true,
18-
]);
8+
$binance = new async\binance();
9+
$bitfinex = new async\bitfinex2();
10+
$poloniex = new async\poloniex();
1911

2012
$exchanges = array($binance, $bitfinex, $poloniex);
2113

examples/php/async-poll-orderbook-yield.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use ccxt\async;
77

88
$exchange = new async\binance([
9-
'enableRateLimit' => true,
109
'verbose' => true,
1110
]);
1211

examples/php/basic-error-handling.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44

55
include $root . '/ccxt.php';
66

7-
date_default_timezone_set ('UTC');
7+
date_default_timezone_set('UTC');
88

99
$exchange = new \ccxt\bittrex ();
1010

@@ -18,10 +18,10 @@
1818
} catch (Exception $e) {
1919

2020
// print it
21-
echo $e->getMessage () . "\n";
21+
echo $e->getMessage() . "\n";
2222

2323
// save to $message (for whatever needs)
24-
$message = $e->getMessage ();
24+
$message = $e->getMessage();
2525
}
2626

2727
?>

examples/php/basic-fetch-ticker-async-2.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44

55
include $root . '/ccxt.php';
66

7-
date_default_timezone_set ('UTC');
7+
date_default_timezone_set('UTC');
88

9-
$exchange = new \ccxt\async\binance (array (
10-
'enableRateLimit' => true,
11-
// 'verbose' => true,
12-
));
9+
$exchange = new \ccxt\async\binance();
1310

1411
$exchange->execute_and_run(function () use ($exchange) {
1512
try {

examples/php/basic-fetch-ticker-async.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,15 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44

55
include $root . '/ccxt.php';
66

7-
date_default_timezone_set ('UTC');
7+
date_default_timezone_set('UTC');
88

99
$kernel = \ccxt\async\Exchange::get_kernel();
1010

1111
$kernel->execute(function () {
12-
$exchange = new \ccxt\async\binance (array (
13-
'enableRateLimit' => true,
14-
// 'verbose' => true,
15-
));
12+
$exchange = new \ccxt\async\binance();
1613
try {
1714
$result = yield $exchange->fetch_ticker('ETH/BTC');
1815
echo var_export($result, true) . "\n";

examples/php/basic-order.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44

55
include $root . '/ccxt.php';
66

7-
date_default_timezone_set ('UTC');
7+
date_default_timezone_set('UTC');
88

99
$exchange = new \ccxt\binance (array(
1010
'apiKey' => 'YOUR_API_KEY', // change for your keys

examples/php/binance-cancel-order.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
11
<?php
22

3-
$root = dirname (dirname (dirname (__FILE__)));
3+
$root = dirname(dirname(dirname(__FILE__)));
44

55
include $root . '/ccxt.php';
66

7-
date_default_timezone_set ('UTC');
7+
date_default_timezone_set('UTC');
88

9-
$exchange = new \ccxt\binance (array (
9+
$exchange = new \ccxt\binance(array(
1010
'apiKey' => 'YOUR_API_KEY', // ←------------ replace with your keys
1111
'secret' => 'YOUR_SECRET',
1212
'verbose' => true,
13-
'enableRateLimit' => true,
1413
));
1514

1615
try {
1716

1817
$orderId = 'xxxxxxxx'; // ←--------- replace with your order id
1918
$symbol = 'XRP/BTC'; // ←--------- replace with your symbol
2019

21-
$exchange->cancelOrder ($orderId, $symbol);
20+
$exchange->cancel_order($orderId, $symbol);
2221

2322
} catch (\ccxt\NetworkError $e) {
24-
echo '[Network Error] ' . $e->getMessage () . "\n";
23+
echo '[Network Error] ' . $e->getMessage() . "\n";
2524
} catch (\ccxt\ExchangeError $e) {
26-
echo '[Exchange Error] ' . $e->getMessage () . "\n";
25+
echo '[Exchange Error] ' . $e->getMessage() . "\n";
2726
} catch (Exception $e) {
28-
echo '[Error] ' . $e->getMessage () . "\n";
27+
echo '[Error] ' . $e->getMessage() . "\n";
2928
}
3029

3130
?>

0 commit comments

Comments
 (0)