NOTE: For Version 3 of the AWS SDK for PHP, please see the V3 User Guide and V3 API Reference.

# Class AbstractConfigLoader

Abstract config loader

  Guzzle\Service\AbstractConfigLoader implements Guzzle\Service\ConfigLoaderInterface

### Direct known subclasses

`Guzzle\Service\Builder\ServiceBuilderLoader`, `Guzzle\Service\Description\ServiceDescriptionLoader`

Abstract
Namespace: Guzzle\Service
Located at Guzzle/Service/AbstractConfigLoader.php

## Methods summary

- `public` `load ( mixed $config, array $options = array() )`

  Loads configuration data and returns an array of the loaded result

- `public` `addAlias ( string $filename, string $alias )`

  Add an include alias to the loader

- `public` `removeAlias ( string $alias )`

  Remove an alias from the loader

- `abstract protected` `build ( array $config, array $options )`

  Perform the parsing of a config file and create the end result

- `protected` `loadFile ( string $filename )`

  Load a configuration file (can load JSON or PHP files that return an array when included)

- `protected` `mergeIncludes ( array & $config, string $basePath = null )`

  Merges in all include files

- `protected` `mergeData ( array $a, array $b )`

  Default implementation for merging two arrays of data (uses array_merge_recursive)

## Methods detail

# `public mixed`
`load( mixed $config, array $options = array() )`

Loads configuration data and returns an array of the loaded result

#### Parameters

$config
  `mixed`
  $config Data to load (filename or array of data)
$options
  `array`
  $options Array of options to use when loading

#### Returns

`mixed`

#### Implementation of

`Guzzle\Service\ConfigLoaderInterface::load()`
# `public `Guzzle\Service\AbstractConfigLoader``
`addAlias( string $filename, string $alias )`

Add an include alias to the loader

#### Parameters

$filename
  `string`
  $filename Filename to alias (e.g. _foo)
$alias
  `string`
  $alias Actual file to use (e.g. /path/to/foo.json)

#### Returns

``Guzzle\Service\AbstractConfigLoader``
# `public `Guzzle\Service\AbstractConfigLoader``
`removeAlias( string $alias )`

Remove an alias from the loader

#### Parameters

$alias
  `string`
  $alias Alias to remove

#### Returns

``Guzzle\Service\AbstractConfigLoader``
# `abstract protected mixed`
`build( array $config, array $options )`

Perform the parsing of a config file and create the end result

#### Parameters

$config
  `array`
  $config Configuration data
$options
  `array`
  $options Options to use when building

#### Returns

`mixed`
# `protected array`
`loadFile( string $filename )`

Load a configuration file (can load JSON or PHP files that return an array when included)

#### Parameters

$filename
  `string`
  $filename File to load

#### Returns

`array`

#### Throws

``Guzzle\Common\Exception\InvalidArgumentException``
``Guzzle\Common\Exception\RuntimeException``
when the JSON cannot be parsed
# `protected array`
`mergeIncludes( array & $config, string $basePath = null )`

Merges in all include files

#### Parameters

$config
  `array`
  $config Config data that contains includes
$basePath
  `string`
  $basePath Base path to use when a relative path is encountered

#### Returns

`array`
Returns the merged and included data
# `protected array`
`mergeData( array $a, array $b )`

Default implementation for merging two arrays of data (uses array_merge_recursive)

#### Parameters

$a
  `array`
  $a Original data
$b
  `array`
  $b Data to merge into the original and overwrite existing values

#### Returns

`array`

### Magic methods summary

## Properties summary

`protected array` | $aliases | # Array of aliases for actual filenames
`protected array` | $loadedFiles | # Hash of previously loaded filenames
`protected static array` | $jsonErrors | # JSON error code mappings