Open Journal Systems
3.3.0
|
Public Member Functions | |
__construct (array $serviceBuilderConfig=array()) | |
addGlobalPlugin (EventSubscriberInterface $plugin) | |
get ($name, $throwAway=false) | |
getData ($name) | |
offsetExists ($offset) | |
offsetGet ($offset) | |
offsetSet ($offset, $value) | |
offsetUnset ($offset) | |
serialize () | |
set ($key, $service) | |
unserialize ($serialized) | |
![]() | |
addSubscriber (EventSubscriberInterface $subscriber) | |
dispatch ($eventName, array $context=array()) | |
getEventDispatcher () | |
setEventDispatcher (EventDispatcherInterface $eventDispatcher) | |
Static Public Member Functions | |
static | factory ($config=null, array $globalParameters=array()) |
static | getAllEvents () |
Protected Attributes | |
$builderConfig = array() | |
$clients = array() | |
$plugins = array() | |
![]() | |
$eventDispatcher | |
Static Protected Attributes | |
static | $cachedFactory |
{}
Clients and data can be set, retrieved, and removed by accessing the service builder like an associative array.
Definition at line 16 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::__construct | ( | array | $serviceBuilderConfig = array() | ) |
array | $serviceBuilderConfig | Service configuration settings:
|
Definition at line 67 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::addGlobalPlugin | ( | EventSubscriberInterface | $plugin | ) |
Attach a plugin to every client created by the builder
EventSubscriberInterface | $plugin | Plugin to attach to each client |
Definition at line 94 of file ServiceBuilder.php.
|
static |
Create a new ServiceBuilder using configuration data sourced from an array, .js|.json or .php file.
array | string | $config | The full path to an .json|.js or .php file, or an associative array |
array | $globalParameters | Array of global parameters to pass to every service as it is instantiated. |
ServiceBuilderException | if a file cannot be opened |
ServiceNotFoundException | when trying to extend a missing client |
Definition at line 50 of file ServiceBuilder.php.
Referenced by Guzzle\Service\Builder\ServiceBuilder\get(), Guzzle\Tests\Service\ServiceBuilderTest\testAllowsSerialization(), Guzzle\Tests\Service\ServiceBuilderTest\testBuilderAllowsReferencesBetweenClients(), Guzzle\Tests\Service\ServiceBuilderTest\testCanAddGlobalParametersToServicesOnLoad(), Guzzle\Tests\Service\ServiceBuilderTest\testDelegatesFactoryMethodToAbstractFactory(), Guzzle\Tests\Service\ServiceBuilderTest\testEmitsEventsWhenClientsAreCreated(), Guzzle\Tests\Service\ServiceBuilderTest\testFactoryCanCreateFromArray(), Guzzle\Tests\Service\ServiceBuilderTest\testFactoryCanCreateFromJson(), Guzzle\Tests\Service\ServiceBuilderTest\testFactoryDoesNotRequireParams(), Guzzle\Tests\Service\ServiceBuilderTest\testStoresClientCopy(), Guzzle\Tests\Service\ServiceBuilderTest\testThrowsExceptionWhenGettingInvalidClient(), and Guzzle\Tests\Service\ServiceBuilderTest\testUsedAsArray().
Guzzle\Service\Builder\ServiceBuilder::get | ( | $name, | |
$throwAway = false |
|||
) |
Get a ClientInterface object or arbitrary data from the service builder
string | $name | Name of the registered service or data to retrieve |
bool | array | $throwAway | Only pertains to retrieving client objects built using a configuration array. 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 of the client if the client implements { |
ServiceNotFoundException | when a client or data cannot be found by the given name |
Implements Guzzle\Service\Builder\ServiceBuilderInterface.
Definition at line 113 of file ServiceBuilder.php.
References Guzzle\Common\AbstractHasDispatcher\dispatch(), and Guzzle\Service\Builder\ServiceBuilder\factory().
|
static |
Get a list of all of the events emitted from the class
Reimplemented from Guzzle\Common\AbstractHasDispatcher.
Definition at line 72 of file ServiceBuilder.php.
Referenced by Guzzle\Tests\Service\ServiceBuilderTest\testEmitsEventsWhenClientsAreCreated().
Guzzle\Service\Builder\ServiceBuilder::getData | ( | $name | ) |
Get data from the service builder without triggering the building of a service
string | $name | Name of the service to retrieve |
Definition at line 108 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::offsetExists | ( | $offset | ) |
Definition at line 189 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::offsetGet | ( | $offset | ) |
Definition at line 194 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::offsetSet | ( | $offset, | |
$value | |||
) |
Definition at line 178 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::offsetUnset | ( | $offset | ) |
Definition at line 183 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::serialize | ( | ) |
Definition at line 82 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::set | ( | $key, | |
$service | |||
) |
Register a service or arbitrary data by name with the service builder
string | $key | Name of the client or data to register |
mixed | $service | Client configuration array or arbitrary data to register. The client configuration array must include a 'class' (string) and 'params' (array) key. |
Implements Guzzle\Service\Builder\ServiceBuilderInterface.
Definition at line 167 of file ServiceBuilder.php.
Guzzle\Service\Builder\ServiceBuilder::unserialize | ( | $serialized | ) |
Definition at line 77 of file ServiceBuilder.php.
|
protected |
Service builder configuration data
Definition at line 22 of file ServiceBuilder.php.
|
staticprotected |
Cached instance of the service builder loader
Definition at line 32 of file ServiceBuilder.php.
|
protected |
Instantiated client objects
Definition at line 28 of file ServiceBuilder.php.
|
protected |
Definition at line 37 of file ServiceBuilder.php.