ClientInterface class

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
MarkDHamill
Registered User
Posts: 4885
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

ClientInterface class

Post by MarkDHamill »

\OAuth\Common\Http\Client\ClientInterface is an abstract class part of the lusitanian symfony library.

I'd like to create an object that uses it but can't find any examples in the phpBB source code or anywhere based on my research. My goal is to create an OAuth2 object, which needs a ClientInterface object. Can anyone point me to or provide an example?
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
Mike-on-Tour
Registered User
Posts: 460
Joined: Wed Jan 15, 2020 3:51 pm
Location: Germany
Name: Michael
Contact:

Re: ClientInterface class

Post by Mike-on-Tour »

This should do the trick:

Bind the class prior to your class in which you want to use it:

Code: Select all

use \OAuth\Common\Http\Client\ClientInterface;
and then just instatiate a new object using this classes classname:

Code: Select all

$client_interface = new \classname;
Watz fo lunch?
If you like my extensions or my support please consider a donation: Image
User avatar
MarkDHamill
Registered User
Posts: 4885
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA
Contact:

Re: ClientInterface class

Post by MarkDHamill »

Thanks. I sort of got it working based on your help and a little trial and error. Because the class is based on an abstract class there are methods that must be implemented in the class including parseUri and retrieveResponse. It's unclear to me what code should be in these methods although there are some hints. I need to read through the Symfony HTTP Client documentation. Hopefully it will become clearer.

https://symfony.com/doc/current/http_client.html
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
Post Reply

Return to “Extension Writers Discussion”