Class Guzzle\Service\Client

InheritanceGuzzle\Service\Client » Guzzle\Http\Client » Guzzle\Common\AbstractHasDispatcher
ImplementsGuzzle\Common\HasDispatcherInterface, Guzzle\Http\ClientInterface, Guzzle\Service\ClientInterface

Client object for executing commands on a web service.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__call() Magic method used to retrieve a command Guzzle\Service\Client
__construct() Guzzle\Http\Client
addSubscriber() Guzzle\Common\AbstractHasDispatcher
createRequest() Guzzle\Http\Client
delete() Guzzle\Http\Client
dispatch() Guzzle\Common\AbstractHasDispatcher
enableMagicMethods() Guzzle\Service\Client
execute() Guzzle\Service\Client
extractPharCacert() Copies the phar cacert from a phar into the temp directory. Guzzle\Http\Client
factory() Basic factory method to create a new client. Extend this method in subclasses to build more complex clients. Guzzle\Service\Client
get() Guzzle\Http\Client
getAllEvents() Guzzle\Service\Client
getBaseUrl() Guzzle\Http\Client
getCommand() Guzzle\Service\Client
getConfig() Guzzle\Http\Client
getCurlMulti() Guzzle\Http\Client
getDefaultHeaders() Guzzle\Http\Client
getDefaultOption() Retrieve a default request option from the client Guzzle\Http\Client
getDefaultUserAgent() Get the default User-Agent string to use with Guzzle Guzzle\Http\Client
getDescription() Guzzle\Service\Client
getEventDispatcher() Guzzle\Common\AbstractHasDispatcher
getInflector() Get the inflector used with the client Guzzle\Service\Client
getIterator() Guzzle\Service\Client
head() Guzzle\Http\Client
options() Guzzle\Http\Client
patch() Guzzle\Http\Client
post() Guzzle\Http\Client
preparePharCacert() Guzzle\Http\Client
put() Guzzle\Http\Client
send() Guzzle\Http\Client
setBaseUrl() Guzzle\Http\Client
setCommandFactory() Set the command factory used to create commands by name Guzzle\Service\Client
setConfig() Guzzle\Http\Client
setCurlMulti() Set a curl multi object to be used internally by the client for transferring requests. Guzzle\Http\Client
setDefaultHeaders() Guzzle\Http\Client
setDefaultOption() Set a default request option on the client that will be used as a default for each request Guzzle\Http\Client
setDescription() Guzzle\Service\Client
setEventDispatcher() Guzzle\Common\AbstractHasDispatcher
setInflector() Set the inflector used with the client Guzzle\Service\Client
setRequestFactory() Guzzle\Http\Client
setResourceIteratorFactory() Set the resource iterator factory associated with the client Guzzle\Service\Client
setSslVerification() Guzzle\Http\Client
setUriTemplate() Set the URI template expander to use with the client Guzzle\Http\Client
setUserAgent() Guzzle\Http\Client

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
executeMultiple() Execute multiple commands in parallel Guzzle\Service\Client
expandTemplate() Expand a URI template while merging client config settings into the template variables Guzzle\Http\Client
getCommandFactory() Get the command factory associated with the client Guzzle\Service\Client
getResourceIteratorFactory() Guzzle\Service\Client
getUriTemplate() Get the URI template expander used by the client Guzzle\Http\Client
initSsl() Initializes SSL settings Guzzle\Http\Client
prepareCommand() Prepare a command for sending and get the RequestInterface object created by the command Guzzle\Service\Client
prepareRequest() Prepare a request to be sent from the Client by adding client specific behaviors and properties to the request. Guzzle\Http\Client
sendMultiple() Send multiple requests in parallel Guzzle\Http\Client

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
COMMAND_PARAMS 'command.params' Guzzle\Service\Client
CURL_OPTIONS 'curl.options' Guzzle\Http\Client
DEFAULT_SELECT_TIMEOUT 1.0 Guzzle\Http\Client
DISABLE_REDIRECTS \Guzzle\Http\RedirectPlugin::DISABLE Guzzle\Http\Client
MAX_HANDLES 3 Guzzle\Http\Client
REQUEST_OPTIONS 'request.options' Guzzle\Http\Client
REQUEST_PARAMS 'request.params' Guzzle\Http\Client
SSL_CERT_AUTHORITY 'ssl.certificate_authority' Guzzle\Http\Client

Property Details

$commandFactory protected property
$inflector protected property

Inflector associated with the service/client

$resourceIteratorFactory protected property
$serviceDescription protected property

Description of the service and possible commands

Method Details

__call() public method

Magic method used to retrieve a command

public mixed __call ( $method, $args )
$method string

Name of the command object to instantiate

$args array

Arguments to pass to the command

return mixed

Returns the result of the command

throws Guzzle\Common\Exception\BadMethodCallException

when a command is not found

enableMagicMethods() public method

public void enableMagicMethods ( $isEnabled )
$isEnabled
execute() public method

public void execute ( $command )
$command
executeMultiple() protected method

Execute multiple commands in parallel

protected array executeMultiple ( $commands )
$commands array|\Guzzle\Service\Traversable

Array of CommandInterface objects to execute

return array

Returns an array of the executed commands

throws Guzzle\Service\Exception\CommandTransferException
factory() public static method

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

public static Guzzle\Service\Client factory ( $config = [] )
$config array|Guzzle\Common\Collection

Configuration data

getAllEvents() public static method

public static void getAllEvents ( )
getCommand() public method

public void getCommand ( $name, array $args = [] )
$name
$args
getCommandFactory() protected method

Get the command factory associated with the client

protected Guzzle\Service\Command\Factory\FactoryInterface getCommandFactory ( )
getDescription() public method

public void getDescription ( )
getInflector() public method

Get the inflector used with the client

public self getInflector ( )
getIterator() public method

public void getIterator ( $command, array $commandOptions null, array $iteratorOptions = [] )
$command
$commandOptions
$iteratorOptions
getResourceIteratorFactory() protected method

protected void getResourceIteratorFactory ( )
prepareCommand() protected method

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

protected Guzzle\Http\Message\RequestInterface prepareCommand ( Guzzle\Service\Command\CommandInterface $command )
$command Guzzle\Service\Command\CommandInterface

Command to prepare

setCommandFactory() public method

Set the command factory used to create commands by name

public self setCommandFactory ( Guzzle\Service\Command\Factory\FactoryInterface $factory )
$factory Guzzle\Service\Command\Factory\FactoryInterface

Command factory

setDescription() public method

public void setDescription ( Guzzle\Service\Description\ServiceDescriptionInterface $service )
$service
setInflector() public method

Set the inflector used with the client

public self setInflector ( Guzzle\Inflection\InflectorInterface $inflector )
$inflector Guzzle\Inflection\InflectorInterface

Inflection object

setResourceIteratorFactory() public method

Set the resource iterator factory associated with the client

public self setResourceIteratorFactory ( Guzzle\Service\Resource\ResourceIteratorFactoryInterface $factory )
$factory Guzzle\Service\Resource\ResourceIteratorFactoryInterface

Resource iterator factory