monero-integrations / monerophp

Monero PHP library + JsonRPC Client
MIT License
119 stars 76 forks source link

use Guzzle #138

Closed recanman closed 10 months ago

recanman commented 1 year ago

This does break compatibility with other daemon RPC methods, so I am leaving it as a draft for now. It is very simple to fix and make it compatible with the other methods, but I will not, as I am waiting to port the classes to PHP 8.

This also adds composer.lock, which for some reason, is not included.

Closes #81, #92

BrianHenryIE commented 1 year ago

Ideally, Guzzle should not be in require. Instead, the PSR interfaces should be required:

    "psr/http-client-implementation": "*",
    "psr/http-factory-implementation": "*"

And Guzzle passed in in the constructor

/**
 * Constructor
 *
 * @param RequestFactoryInterface $requestFactory
 * @param ClientInterface $client A PSR HTTP client.
 */
public function __construct(RequestFactoryInterface $requestFactory, ClientInterface $client, ...

E.g. for WordPress plugins, I don't use Guzzle, I use a PSR library that builds on WordPress's Requests library.

This also allows for easier testing.

recanman commented 10 months ago

Closing in favor of merging refring's repository, which has a new structure.