Open Journal Systems
3.3.0
CurlAuthPlugin.php
1
<?php
2
3
namespace
Guzzle\Plugin\CurlAuth
;
4
5
use
Guzzle\Common\Event
;
6
use
Guzzle\Common\Version
;
7
use
Symfony\Component\EventDispatcher\EventSubscriberInterface
;
8
13
class
CurlAuthPlugin
implements
EventSubscriberInterface
14
{
15
private
$username;
16
private
$password;
17
private
$scheme;
18
24
public
function
__construct
($username, $password, $scheme=CURLAUTH_BASIC)
25
{
26
Version::warn
(__CLASS__ .
" is deprecated. Use \$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');"
);
27
$this->username = $username;
28
$this->password = $password;
29
$this->scheme = $scheme;
30
}
31
32
public
static
function
getSubscribedEvents
()
33
{
34
return
array(
'client.create_request'
=> array(
'onRequestCreate'
, 255));
35
}
36
42
public
function
onRequestCreate
(
Event
$event)
43
{
44
$event[
'request'
]->setAuth($this->username, $this->password, $this->scheme);
45
}
46
}
Symfony\Component\EventDispatcher\EventSubscriberInterface
Definition:
lib/vendor/symfony/event-dispatcher/EventSubscriberInterface.php:25
Guzzle\Plugin\CurlAuth\CurlAuthPlugin
Definition:
CurlAuthPlugin.php:13
Guzzle\Common\Version\warn
static warn($message)
Definition:
Version.php:23
Guzzle\Plugin\CurlAuth\CurlAuthPlugin\getSubscribedEvents
static getSubscribedEvents()
Definition:
CurlAuthPlugin.php:32
Guzzle\Common\Event
Definition:
lib/vendor/guzzle/guzzle/src/Guzzle/Common/Event.php:10
Guzzle\Common\Version
Definition:
Version.php:8
Guzzle\Plugin\CurlAuth\CurlAuthPlugin\onRequestCreate
onRequestCreate(Event $event)
Definition:
CurlAuthPlugin.php:42
Guzzle\Plugin\CurlAuth
Definition:
CurlAuthPlugin.php:3
Guzzle\Plugin\CurlAuth\CurlAuthPlugin\__construct
__construct($username, $password, $scheme=CURLAUTH_BASIC)
Definition:
CurlAuthPlugin.php:24
plugins
paymethod
paypal
lib
vendor
guzzle
guzzle
src
Guzzle
Plugin
CurlAuth
CurlAuthPlugin.php
Generated on Fri Aug 28 2020 14:51:21 for Open Journal Systems by
1.8.17