Overview

Namespaces

  • Contrib
    • Bundle
      • CoverallsBundle
        • Console
        • Entity
      • CoverallsV1Bundle
        • Api
        • Collector
        • Command
        • Config
        • Entity
          • Git
    • Component
      • File
      • Log
      • System
        • Git
  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
  • PHP
  • Psr
    • Log
  • Symfony
    • Component
      • Config
        • Definition
          • Builder
          • Exception
        • Exception
        • Loader
        • Resource
        • Util
      • Console
        • Command
        • Formatter
        • Helper
        • Input
        • Output
        • Tester
      • EventDispatcher
        • Debug
      • Finder
        • Adapter
        • Comparator
        • Exception
        • Expression
        • Iterator
        • Shell
      • Stopwatch
      • Yaml
        • Exception

Classes

  • ServiceBuilder
  • ServiceBuilderLoader

Interfaces

  • ServiceBuilderInterface
  • Overview
  • Namespace
  • Class
  • Tree
  • Todo

Class ServiceBuilder

Service builder to generate service builders and service clients from configuration settings

Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
Extended by Guzzle\Service\Builder\ServiceBuilder implements Guzzle\Service\Builder\ServiceBuilderInterface, ArrayAccess, Serializable
Namespace: Guzzle\Service\Builder
Located at Guzzle/Service/Builder/ServiceBuilder.php
Methods summary
public static Guzzle\Service\Builder\ServiceBuilderInterface
# factory( array|string $config = null, array $globalParameters = array() )

Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.

Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.

Parameters

$config
array|string
$config The full path to an .json|.js or .php file, or an associative array
$globalParameters
array
$globalParameters Array of global parameters to pass to every service as it is instantiated.

Returns

Guzzle\Service\Builder\ServiceBuilderInterface

Throws

Guzzle\Service\Exception\ServiceBuilderException
if a file cannot be opened
Guzzle\Service\Exception\ServiceNotFoundException
when trying to extend a missing client
public
# __construct( array $serviceBuilderConfig )

Construct a new service builder

Construct a new service builder

Parameters

$serviceBuilderConfig
array
$serviceBuilderConfig Service configuration settings: - name: Name of the service - class: Client class to instantiate using a factory method - params: array of key value pair configuration settings for the builder
public static array
# getAllEvents( )

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

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

Returns

array

Overrides

Guzzle\Common\AbstractHasDispatcher::getAllEvents()
public
# unserialize( string $serialized )

Restores the service builder from JSON

Restores the service builder from JSON

Parameters

$serialized
string
$serialized JSON data to restore from

Implementation of

Serializable::unserialize()
public array
# serialize( )

Represents the service builder as a string

Represents the service builder as a string

Returns

array

Implementation of

Serializable::serialize()
public Guzzle\Service\Builder\ServiceBuilder
# addGlobalPlugin( Symfony\Component\EventDispatcher\EventSubscriberInterface $plugin )

Attach a plugin to every client created by the builder

Attach a plugin to every client created by the builder

Parameters

$plugin
Symfony\Component\EventDispatcher\EventSubscriberInterface
$plugin Plugin to attach to each client

Returns

Guzzle\Service\Builder\ServiceBuilder
public array|null
# getData( string $name )

Get data from the service builder without triggering the building of a service

Get data from the service builder without triggering the building of a service

Parameters

$name
string
$name Name of the service to retrieve

Returns

array|null
public FromConfigInterface
# get( string $name, boolean|array $throwAway = false )

Get a service using a registered builder

Get a service using a registered builder

Parameters

$name
string
$name Name of the registered client to retrieve
$throwAway
boolean|array
$throwAway Set to TRUE to not store the client for later retrieval from the ServiceBuilder. If an array is specified, that data will overwrite the configured params

Returns

FromConfigInterface

Throws

Guzzle\Service\Exception\ServiceNotFoundException
when a client cannot be found by name

Implementation of

Guzzle\Service\Builder\ServiceBuilderInterface::get()
public Guzzle\Service\Builder\ServiceBuilderInterface
# set( string $key, mixed $service )

Register a service by name with the service builder

Register a service by name with the service builder

Parameters

$key
string
$key Name of the client to register
$service
mixed
$service Service to register

Returns

Guzzle\Service\Builder\ServiceBuilderInterface

Implementation of

Guzzle\Service\Builder\ServiceBuilderInterface::set()
public
# offsetSet( string $offset, Guzzle\Http\ClientInterface $value )

Register a client by name with the service builder

Register a client by name with the service builder

Parameters

$offset
string
$offset Name of the client to register
$value
Guzzle\Http\ClientInterface
$value Client to register

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( string $offset )

Remove a registered client by name

Remove a registered client by name

Parameters

$offset
string
$offset Client to remove by name

Implementation of

ArrayAccess::offsetUnset()
public boolean
# offsetExists( string $offset )

Check if a client is registered with the service builder by name

Check if a client is registered with the service builder by name

Parameters

$offset
string
$offset Name to check to see if a client exists

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public Guzzle\Http\ClientInterface
# offsetGet( string $offset )

Get a registered client by name

Get a registered client by name

Parameters

$offset
string
$offset Registered client name to retrieve

Returns

Guzzle\Http\ClientInterface

Implementation of

ArrayAccess::offsetGet()
Methods inherited from Guzzle\Common\AbstractHasDispatcher
addSubscriber(), dispatch(), getEventDispatcher(), setEventDispatcher()
Properties summary
protected array $builderConfig array()
#

Service builder configuration data

Service builder configuration data

protected array $clients array()
#

Instantiated client objects

Instantiated client objects

protected static Guzzle\Service\Builder\ServiceBuilderLoader $cachedFactory
#

Cached instance of the service builder loader

Cached instance of the service builder loader

protected array $plugins array()
#

Plugins to attach to each client created by the service builder

Plugins to attach to each client created by the service builder

Properties inherited from Guzzle\Common\AbstractHasDispatcher
$eventDispatcher
php-coveralls API documentation generated by ApiGen 2.8.0