Skip to content

Commit

Permalink
fix ccxt#876, fix#862, fix#891
Browse files Browse the repository at this point in the history
  • Loading branch information
kroitor committed Dec 18, 2017
2 parents 1817f11 + a79cb3e commit b1fd5eb
Show file tree
Hide file tree
Showing 112 changed files with 135 additions and 421 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ ccxt.sublime-workspace
.idea
yarn.lock
keys.local.json
nbproject/
vendor/
5 changes: 0 additions & 5 deletions ccxt.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,3 @@
if (file_exists ($file))
require_once ($file);
} );

require_once ('php/base/errors.php');
require_once ('php/base/Exchange.php');

?>
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,16 @@
"psr-4": {
"ccxt\\": "php"
}
},
"archive": {
"exclude": [
"/build",
"/ccxt.wiki",
"/doc",
"/examples",
"/js",
"/python",
"/wiki"
]
}
}
19 changes: 19 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion export-exchanges.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ try {
replacement: "exchanges = [\n" + " '" + ids.join ("',\n '") + "'," + "\n]",
},
{
file: './php/base/Exchange.php',
file: './php/Exchange.php',
regex: /public static \$exchanges \= array \([^\)]+\)/,
replacement: "public static $exchanges = array (\n '" + ids.join ("',\n '") + "',\n )",
},
Expand Down
7 changes: 7 additions & 0 deletions php/AuthenticationError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class AuthenticationError extends ExchangeError {

}
9 changes: 9 additions & 0 deletions php/BaseError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

namespace ccxt;

use Exception;

class BaseError extends Exception {

}
7 changes: 7 additions & 0 deletions php/CancelPending.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class CancelPending extends InvalidOrder {

}
7 changes: 7 additions & 0 deletions php/DDoSProtection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class DDoSProtection extends NetworkError {

}
7 changes: 2 additions & 5 deletions php/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@

namespace ccxt;

include_once ('errors.php');

$version = '1.9.282';

abstract class Exchange {
Expand Down Expand Up @@ -652,7 +650,8 @@ public function jwt ($request, $secret, $alg = 'HS256', $hash = 'sha256') {
}

public function raise_error ($exception_type, $url, $method = 'GET', $error = null, $details = null) {
throw new $exception_type (implode (' ', array (
$exception_class = __NAMESPACE__ . '\\' . $exception_type;
throw new $exception_class (implode (' ', array (
$this->id,
$method,
$url,
Expand Down Expand Up @@ -1429,5 +1428,3 @@ function __call ($function, $params) {
}
}
}

?>
7 changes: 7 additions & 0 deletions php/ExchangeError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class ExchangeError extends BaseError {

}
7 changes: 7 additions & 0 deletions php/ExchangeNotAvailable.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class ExchangeNotAvailable extends NetworkError {

}
7 changes: 7 additions & 0 deletions php/InsufficientFunds.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class InsufficientFunds extends ExchangeError {

}
7 changes: 7 additions & 0 deletions php/InvalidNonce.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class InvalidNonce extends ExchangeError {

}
7 changes: 7 additions & 0 deletions php/InvalidOrder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class InvalidOrder extends ExchangeError {

}
7 changes: 7 additions & 0 deletions php/NetworkError.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class NetworkError extends BaseError {

}
7 changes: 7 additions & 0 deletions php/NotSupported.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class NotSupported extends ExchangeError {

}
7 changes: 7 additions & 0 deletions php/OrderNotCached.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class OrderNotCached extends InvalidOrder {

}
7 changes: 7 additions & 0 deletions php/OrderNotFound.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class OrderNotFound extends InvalidOrder {

}
7 changes: 7 additions & 0 deletions php/RequestTimeout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace ccxt;

class RequestTimeout extends NetworkError {

}
Loading

0 comments on commit b1fd5eb

Please sign in to comment.