Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Guzzle4Bridge doesn't exit #10

Closed
hlecorche opened this issue Nov 6, 2015 · 4 comments
Closed

Guzzle4Bridge doesn't exit #10

hlecorche opened this issue Nov 6, 2015 · 4 comments

Comments

@hlecorche
Copy link

fxmlrpc can be used but this example does not work because Guzzle4Bridge has been deleted.

$client = new Client(
    'http://127.0.0.1:9001/RPC2',
    new Guzzle4Bridge(new \GuzzleHttp\Client(['defaults' => ['auth' => ['user', '123']]]))
);

We used to ship our own bridges for interoperability with various HTTP clients but moved that responsibility to a 3rd party library called Ivory HTTP Adapter

...But Ivory HTTP Adapter is now deprecated... (lstrojny/fxmlrpc#56)

@sagikazarmark
Copy link
Contributor

Hey @hlecorche,

It is not deprecated yet, but it is very close to it. As you might have realized, I am the developer of httplug, fxmlrpc and supervisor as well. Httplug is already in alpha. As soon as it hits beta (in a few days) I am going to release an alpha of fXmlRpc's next version. After that Supervisor comes.

However, Guzzle 4 is already EOL, you might want to use a more recent HTTP Client in the meantime as Guzzle 4 is not going to be available in Httplug (at least not in the near future).

Thanks for the heads up anyway.

@hlecorche
Copy link
Author

Ok, thanks. Good news :-)

@hlecorche
Copy link
Author

With fxmlrpc 0.20 , the README corection is :

Before :

use Supervisor\Supervisor;
use Supervisor\Connector\XmlRpc;
use fXmlRpc\Client;
use fXmlRpc\Transport\Guzzle4Bridge;

// Pass the url and the bridge to the XmlRpc Client
$client = new Client(
    'http://127.0.0.1:9001/RPC2',
    new Guzzle4Bridge(new \GuzzleHttp\Client(['defaults' => ['auth' => ['user', '123']]]))
);

// Pass the client to the connector
// See the full list of connectors bellow
$connector = new XmlRpc($client);

$supervisor = new Supervisor($connector);

After :

use Supervisor\Supervisor;
use Supervisor\Connector\XmlRpc;
use fXmlRpc\Client;
use fXmlRpc\Transport\HttpAdapterTransport;
use Ivory\HttpAdapter\Guzzle6HttpAdapter;

//Create GuzzleHttp client
$guzzleClient = new \GuzzleHttp\Client(['auth' => ['user', '123']]);

// Pass the url and the guzzle client to the XmlRpc Client
$client = new Client(
    'http://127.0.0.1:9001/RPC2',
    new HttpAdapterTransport(new Guzzle6HttpAdapter($guzzleClient))
);

// Pass the client to the connector
// See the full list of connectors bellow
$connector = new XmlRpc($client);

$supervisor = new Supervisor($connector);

@sagikazarmark
Copy link
Contributor

Thanks for the example update, I just pushed it to the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants