Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

Commit

Permalink
Removed support for FlatBuffers
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRow committed Jul 3, 2020
1 parent daa1e16 commit ecd7367
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 25 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ Thanks a lot for the work and effort of
- [jaimehgb/RaiBlocksPHP](https://github.com/jaimehgb/RaiBlocksPHP)
- [Textalk/websocket-php](https://github.com/Textalk/websocket-php)
- [aceat64/EasyBitcoin-PHP](https://github.com/aceat64/EasyBitcoin-PHP)
- [google/flatbuffers](https://github.com/google/flatbuffers)
- [FriendsOfPHP/PHP-CS-Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
- [squizlabs/PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer)
- [Sergey Kroshnin](https://github.com/SergiySW)
Expand Down
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@
"ext-gmp" : "*",
"ext-mbstring" : "*",
"ext-openssl" : "*",
"textalk/websocket" : "*",
"google/flatbuffers" : "*"
"textalk/websocket" : "*"
},
"suggest" : {
"ext-blake2" : "Install blake2 extension in order to speed up some functions: https://github.com/strawbrary/php-blake2"
Expand Down
13 changes: 4 additions & 9 deletions src/NanoIPC.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace php4nano;

use \Exception;
use \Google\FlatBuffers;

class NanoIPCException extends Exception{}

Expand Down Expand Up @@ -205,7 +204,7 @@ public function __call($method, array $params)
return false;
}

// Response size
// Response lenght
$size = fread($this->transport, 4);
if ($size === false) {
$this->error = 'Unable to receive response lenght';
Expand Down Expand Up @@ -248,14 +247,10 @@ public function __call($method, array $params)
} elseif ($this->encoding == 4) {
$this->responseType = $this->response['message_type'];

if (isset($this->response['time'])) {
$this->responseTime = (int) $this->response['time'];
}
$this->responseTime = (int) $this->response['time'];

if (isset($this->response['correlation_id'])) {
if ((int) $this->response['correlation_id'] != $this->id) {
$this->error = 'Correlation ID doesn\'t match';
}
if ((int) $this->response['correlation_id'] != $this->id) {
$this->error = 'Correlation ID doesn\'t match';
}

if ($this->response['message_type'] == 'Error') {
Expand Down
21 changes: 8 additions & 13 deletions src/NanoRPC.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace php4nano;

use \Exception;
use \Google\FlatBuffers;

class NanoRPCException extends Exception{}

Expand Down Expand Up @@ -53,11 +52,11 @@ public function __construct(string $hostname = 'localhost', int $port = 7076, st
}
}

$this->hostname = $hostname;
$this->port = $port;
$this->url = $url;
$this->proto = 'http';
$this->API = 1;
$this->hostname = $hostname;
$this->port = $port;
$this->url = $url;
$this->proto = 'http';
$this->API = 1;
}


Expand Down Expand Up @@ -264,14 +263,10 @@ public function __call($method, array $params)
} elseif ($this->API == 2) {
$this->responseType = $this->response['message_type'];

if (isset($this->response['time'])) {
$this->responseTime = (int) $this->response['time'];
}
$this->responseTime = (int) $this->response['time'];

if (isset($this->response['correlation_id'])) {
if ((int) $this->response['correlation_id'] != $this->id) {
$this->error = 'Correlation ID doesn\'t match';
}
if ((int) $this->response['correlation_id'] != $this->id) {
$this->error = 'Correlation ID doesn\'t match';
}

if ($this->response['message_type'] == 'Error') {
Expand Down

0 comments on commit ecd7367

Please sign in to comment.