Open Journal Systems  3.3.0
Guzzle\Service\Client Class Reference
Inheritance diagram for Guzzle\Service\Client:
Guzzle\Http\Client Guzzle\Service\ClientInterface Guzzle\Common\AbstractHasDispatcher Guzzle\Http\ClientInterface Guzzle\Http\ClientInterface Guzzle\Common\FromConfigInterface Guzzle\Common\HasDispatcherInterface Guzzle\Common\HasDispatcherInterface Guzzle\Common\HasDispatcherInterface Guzzle\Tests\Service\Mock\MockClient

Public Member Functions

 __call ($method, $args)
 
 enableMagicMethods ($isEnabled)
 
 execute ($command)
 
 getCommand ($name, array $args=array())
 
 getDescription ()
 
 getInflector ()
 
 getIterator ($command, array $commandOptions=null, array $iteratorOptions=array())
 
 setCommandFactory (CommandFactoryInterface $factory)
 
 setDescription (ServiceDescriptionInterface $service)
 
 setInflector (InflectorInterface $inflector)
 
 setResourceIteratorFactory (ResourceIteratorFactoryInterface $factory)
 
- Public Member Functions inherited from Guzzle\Http\Client
 __construct ($baseUrl='', $config=null)
 
 createRequest ($method='GET', $uri=null, $headers=null, $body=null, array $options=array())
 
 delete ($uri=null, $headers=null, $body=null, array $options=array())
 
 get ($uri=null, $headers=null, $options=array())
 
 getBaseUrl ($expand=true)
 
 getConfig ($key=false)
 
 getCurlMulti ()
 
 getDefaultHeaders ()
 
 getDefaultOption ($keyOrPath)
 
 getDefaultUserAgent ()
 
 head ($uri=null, $headers=null, array $options=array())
 
 options ($uri=null, array $options=array())
 
 patch ($uri=null, $headers=null, $body=null, array $options=array())
 
 post ($uri=null, $headers=null, $postBody=null, array $options=array())
 
 preparePharCacert ($md5Check=true)
 
 put ($uri=null, $headers=null, $body=null, array $options=array())
 
 send ($requests)
 
 setBaseUrl ($url)
 
 setConfig ($config)
 
 setCurlMulti (CurlMultiInterface $curlMulti)
 
 setDefaultHeaders ($headers)
 
 setDefaultOption ($keyOrPath, $value)
 
 setRequestFactory (RequestFactoryInterface $factory)
 
 setSslVerification ($certificateAuthority=true, $verifyPeer=true, $verifyHost=2)
 
 setUriTemplate (UriTemplateInterface $uriTemplate)
 
 setUserAgent ($userAgent, $includeDefault=false)
 
- Public Member Functions inherited from Guzzle\Common\AbstractHasDispatcher
 addSubscriber (EventSubscriberInterface $subscriber)
 
 dispatch ($eventName, array $context=array())
 
 getEventDispatcher ()
 
 setEventDispatcher (EventDispatcherInterface $eventDispatcher)
 

Static Public Member Functions

static factory ($config=array())
 
static getAllEvents ()
 
- Static Public Member Functions inherited from Guzzle\Http\Client
static extractPharCacert ($pharCacertPath)
 

Data Fields

const COMMAND_PARAMS = 'command.params'
 
- Data Fields inherited from Guzzle\Http\Client
const CURL_OPTIONS = 'curl.options'
 
const DEFAULT_SELECT_TIMEOUT = 1.0
 
const DISABLE_REDIRECTS = RedirectPlugin::DISABLE
 
const MAX_HANDLES = 3
 
const REQUEST_OPTIONS = 'request.options'
 
const REQUEST_PARAMS = 'request.params'
 
const SSL_CERT_AUTHORITY = 'ssl.certificate_authority'
 
- Data Fields inherited from Guzzle\Http\ClientInterface
const CREATE_REQUEST = 'client.create_request'
 
const HTTP_DATE = 'D, d M Y H:i:s \G\M\T'
 

Protected Member Functions

 executeMultiple ($commands)
 
 getCommandFactory ()
 
 getResourceIteratorFactory ()
 
 prepareCommand (CommandInterface $command)
 
- Protected Member Functions inherited from Guzzle\Http\Client
 expandTemplate ($template, array $variables=null)
 
 getUriTemplate ()
 
 initSsl ()
 
 prepareRequest (RequestInterface $request, array $options=array())
 
 sendMultiple (array $requests)
 

Protected Attributes

 $commandFactory
 
 $inflector
 
 $resourceIteratorFactory
 
 $serviceDescription
 
- Protected Attributes inherited from Guzzle\Http\Client
 $defaultHeaders
 
 $requestFactory
 
 $userAgent
 
- Protected Attributes inherited from Guzzle\Common\AbstractHasDispatcher
 $eventDispatcher
 

Detailed Description

Client object for executing commands on a web service.

Definition at line 25 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

Member Function Documentation

◆ __call()

Guzzle\Service\Client::__call (   $method,
  $args 
)

Magic method used to retrieve a command

Parameters
string$methodName of the command object to instantiate
array$argsArguments to pass to the command
Returns
mixed Returns the result of the command
Exceptions
BadMethodCallExceptionwhen a command is not found

Definition at line 86 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Client\getCommand().

◆ enableMagicMethods()

Guzzle\Service\Client::enableMagicMethods (   $isEnabled)
Deprecated:
@codeCoverageIgnore

Definition at line 305 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Common\Version\warn().

◆ execute()

Guzzle\Service\Client::execute (   $command)

Execute one or more commands

Parameters
CommandInterface | array | Traversable$commandCommand, array of commands or Traversable object containing commands to execute
Returns
mixed Returns the result of the executed command or an array of commands if executing multiple commands
Exceptions
InvalidArgumentExceptionif an invalid command is passed
CommandTransferExceptionif an exception is encountered when transferring multiple commands

Implements Guzzle\Service\ClientInterface.

Definition at line 145 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Common\AbstractHasDispatcher\dispatch(), Guzzle\Service\Client\executeMultiple(), Guzzle\Service\Client\prepareCommand(), and Guzzle\Http\Client\send().

◆ executeMultiple()

Guzzle\Service\Client::executeMultiple (   $commands)
protected

Execute multiple commands in parallel

Parameters
array | Traversable$commandsArray of CommandInterface objects to execute
Returns
array Returns an array of the executed commands
Exceptions
Exception

Definition at line 233 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Common\AbstractHasDispatcher\dispatch(), Guzzle\Service\Exception\CommandTransferException\fromMultiTransferException(), Guzzle\Http\Exception\MultiTransferException\getFailedRequests(), Guzzle\Service\Client\prepareCommand(), and Guzzle\Http\Client\send().

Referenced by Guzzle\Service\Client\execute().

◆ factory()

static Guzzle\Service\Client::factory (   $config = array())
static

Basic factory method to create a new client. Extend this method in subclasses to build more complex clients.

Parameters
array | Collection$configConfiguration data
Returns
Client

Implements Guzzle\Common\FromConfigInterface.

Reimplemented in Guzzle\Tests\Service\Mock\MockClient.

Definition at line 60 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

Referenced by Guzzle\Service\Client\getCommand(), Guzzle\Tests\Service\ClientTest\testFactoryCreatesClient(), and Guzzle\Tests\Service\ClientTest\testFactoryDoesNotRequireBaseUrl().

◆ getAllEvents()

static Guzzle\Service\Client::getAllEvents ( )
static

Get a list of all of the events emitted from the class

Returns
array

Reimplemented from Guzzle\Http\Client.

Definition at line 65 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

Referenced by Guzzle\Tests\Service\ClientTest\testDescribesEvents().

◆ getCommand()

Guzzle\Service\Client::getCommand (   $name,
array  $args = array() 
)

Get a command by name. First, the client will see if it has a service description and if the service description defines a command by the supplied name. If no dynamic command is found, the client will look for a concrete command class exists matching the name supplied. If neither are found, an InvalidArgumentException is thrown.

Parameters
string$nameName of the command to retrieve
array$argsArguments to pass to the command
Returns
CommandInterface
Exceptions
InvalidArgumentExceptionif no command can be found by name

Implements Guzzle\Service\ClientInterface.

Definition at line 91 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Common\AbstractHasDispatcher\dispatch(), Guzzle\Service\Client\factory(), Guzzle\Service\Client\getCommandFactory(), and Guzzle\Http\Client\getConfig().

Referenced by Guzzle\Service\Client\__call(), and Guzzle\Service\Client\getIterator().

◆ getCommandFactory()

Guzzle\Service\Client::getCommandFactory ( )
protected

Get the command factory associated with the client

Returns
CommandFactoryInterface

Definition at line 292 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Client\$commandFactory, and Guzzle\Service\Command\Factory\CompositeFactory\getDefaultChain().

Referenced by Guzzle\Service\Client\getCommand(), and Guzzle\Service\Client\setDescription().

◆ getDescription()

Guzzle\Service\Client::getDescription ( )

Get the service description of the client

Returns
ServiceDescriptionInterface|null

Implements Guzzle\Service\ClientInterface.

Definition at line 174 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Client\$serviceDescription.

◆ getInflector()

Guzzle\Service\Client::getInflector ( )

Get the inflector used with the client

Returns
self

Definition at line 198 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Client\$inflector, and Guzzle\Inflection\Inflector\getDefault().

◆ getIterator()

Guzzle\Service\Client::getIterator (   $command,
array  $commandOptions = null,
array  $iteratorOptions = array() 
)

Get a resource iterator from the client.

Parameters
string | CommandInterface$commandCommand class or command name.
array$commandOptionsCommand options used when creating commands.
array$iteratorOptionsIterator options passed to the iterator when it is instantiated.
Returns
ResourceIteratorInterface

Implements Guzzle\Service\ClientInterface.

Definition at line 136 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Client\getCommand(), and Guzzle\Service\Client\getResourceIteratorFactory().

◆ getResourceIteratorFactory()

Guzzle\Service\Client::getResourceIteratorFactory ( )
protected

◆ prepareCommand()

Guzzle\Service\Client::prepareCommand ( CommandInterface  $command)
protected

Prepare a command for sending and get the RequestInterface object created by the command

Parameters
CommandInterface$commandCommand to prepare
Returns
RequestInterface

Definition at line 214 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Common\AbstractHasDispatcher\dispatch(), Guzzle\Service\Command\CommandInterface\setClient(), and Guzzle\Http\Message\RequestInterface\STATE_NEW.

Referenced by Guzzle\Service\Client\execute(), and Guzzle\Service\Client\executeMultiple().

◆ setCommandFactory()

Guzzle\Service\Client::setCommandFactory ( CommandFactoryInterface  $factory)

Set the command factory used to create commands by name

Parameters
CommandFactoryInterface$factoryCommand factory
Returns
self

Definition at line 115 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

◆ setDescription()

Guzzle\Service\Client::setDescription ( ServiceDescriptionInterface  $service)

Set the service description of the client

Parameters
ServiceDescriptionInterface$serviceService description
Returns
ClientInterface

Implements Guzzle\Service\ClientInterface.

Definition at line 158 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Description\ServiceDescriptionInterface\getBaseUrl(), Guzzle\Service\Client\getCommandFactory(), and Guzzle\Http\Client\setBaseUrl().

◆ setInflector()

Guzzle\Service\Client::setInflector ( InflectorInterface  $inflector)

Set the inflector used with the client

Parameters
InflectorInterface$inflectorInflection object
Returns
self

Definition at line 186 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

References Guzzle\Service\Client\$inflector.

◆ setResourceIteratorFactory()

Guzzle\Service\Client::setResourceIteratorFactory ( ResourceIteratorFactoryInterface  $factory)

Set the resource iterator factory associated with the client

Parameters
ResourceIteratorFactoryInterface$factoryResource iterator factory
Returns
self

Definition at line 129 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

Field Documentation

◆ $commandFactory

CommandFactoryInterface Guzzle\Service\Client::$commandFactory
protected

◆ $inflector

InflectorInterface Guzzle\Service\Client::$inflector
protected

Inflector associated with the service/client

Definition at line 51 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

Referenced by Guzzle\Service\Client\getInflector(), and Guzzle\Service\Client\setInflector().

◆ $resourceIteratorFactory

ResourceIteratorFactoryInterface Guzzle\Service\Client::$resourceIteratorFactory
protected

◆ $serviceDescription

ServiceDescriptionInterface Guzzle\Service\Client::$serviceDescription
protected

Description of the service and possible commands

Definition at line 33 of file lib/vendor/guzzle/guzzle/src/Guzzle/Service/Client.php.

Referenced by Guzzle\Service\Client\getDescription().

◆ COMMAND_PARAMS


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