From 20d781e8cfcbc9534a3d1fce58b3c7119b1296e1 Mon Sep 17 00:00:00 2001 From: Thorsten Krug Date: Mon, 19 Feb 2018 19:14:24 +0000 Subject: [PATCH] Moving include to constructor and remove the not working autoload in composer.json. --- composer.json | 5 +---- src/Ethereum.php | 7 ++++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/composer.json b/composer.json index 2dd2d25..0118399 100644 --- a/composer.json +++ b/composer.json @@ -21,10 +21,7 @@ "autoload": { "psr-4": { "Ethereum\\": "src/" - }, - "files": [ - "src/helpers/ethereum-client-workaround-helpers.php" - ] + } }, "license": "MIT", "authors": [ diff --git a/src/Ethereum.php b/src/Ethereum.php index be63389..06eb200 100644 --- a/src/Ethereum.php +++ b/src/Ethereum.php @@ -8,8 +8,6 @@ use Ethereum\EthDataType; use Exception; -require_once __DIR__ . '/helpers/ethereum-client-workaround-helpers.php'; - /** * @defgroup client Ethereum Client * @@ -66,8 +64,11 @@ class Ethereum extends EthereumStatic implements JsonRpcInterface */ public function __construct($url = 'http://localhost:8545') { + // Require the workaround helpers, as autoload files in composer + // doesn't work as expected. + require_once __DIR__ . '/helpers/ethereum-client-workaround-helpers.php'; - $this->client = RpcClient::factory($url, [ + $this->client = RpcClient::factory($url, [ // Debug JsonRPC requests. 'debug' => false, ]);