Open Journal Systems  3.3.0
Guzzle\Plugin\CurlAuth\CurlAuthPlugin Class Reference
Inheritance diagram for Guzzle\Plugin\CurlAuth\CurlAuthPlugin:
Symfony\Component\EventDispatcher\EventSubscriberInterface

Public Member Functions

 __construct ($username, $password, $scheme=CURLAUTH_BASIC)
 
 onRequestCreate (Event $event)
 

Static Public Member Functions

static getSubscribedEvents ()
 

Detailed Description

Adds specified curl auth to all requests sent from a client. Defaults to CURLAUTH_BASIC if none supplied.

Deprecated:
Use $client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');

Definition at line 13 of file CurlAuthPlugin.php.

Constructor & Destructor Documentation

◆ __construct()

Guzzle\Plugin\CurlAuth\CurlAuthPlugin::__construct (   $username,
  $password,
  $scheme = CURLAUTH_BASIC 
)
Parameters
string$usernameHTTP basic auth username
string$passwordPassword
int$schemeCurl auth scheme

Definition at line 24 of file CurlAuthPlugin.php.

References Guzzle\Common\Version\warn().

Member Function Documentation

◆ getSubscribedEvents()

static Guzzle\Plugin\CurlAuth\CurlAuthPlugin::getSubscribedEvents ( )
static

Returns an array of event names this subscriber wants to listen to.

The array keys are event names and the value can be:

  • The method name to call (priority defaults to 0)
  • An array composed of the method name to call and the priority
  • An array of arrays composed of the method names to call and respective priorities, or 0 if unset

For instance:

  • array('eventName' => 'methodName')
  • array('eventName' => array('methodName', $priority))
  • array('eventName' => array(array('methodName1', $priority), array('methodName2')))
Returns
array The event names to listen to

Implements Symfony\Component\EventDispatcher\EventSubscriberInterface.

Definition at line 32 of file CurlAuthPlugin.php.

◆ onRequestCreate()

Guzzle\Plugin\CurlAuth\CurlAuthPlugin::onRequestCreate ( Event  $event)

Add basic auth

Parameters
Event$event

Definition at line 42 of file CurlAuthPlugin.php.


The documentation for this class was generated from the following file: