\phpDocumentor\ConfigurationLoader

Loads the template and user-defined configuration file from disk and creates a Configuration object from it.

This class will merge the template file and the user-defined configuration file together and serialize it into a configuration object (defaults to phpDocumentor\Configuration).

Summary

Methods
Properties
Constants
__construct()
load()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
fetchUserConfigFileFromCommandLineOptions()
isValidFile()
createConfigurationObject()
$serializer
$merger
N/A

Properties

$serializer

$serializer : \JMS\Serializer\Serializer

Type

\JMS\Serializer\Serializer — Object used to serialize configuration files to objects.

Methods

__construct()

__construct(\JMS\Serializer\Serializer  $serializer, \phpDocumentor\Configuration\Merger  $merger) 

Registers the dependencies with the loader.

Parameters

\JMS\Serializer\Serializer $serializer

Object used to serialize configuration files to objects.

\phpDocumentor\Configuration\Merger $merger

Object that merges variables, including objects.

load()

load(string  $templatePath, string  $userConfigurationPath, string  $class = 'phpDocumentor\Configuration') : object

Loads the configuration from the provided paths and returns a populated configuration object.

Parameters

string $templatePath

Path to configuration file containing default settings.

string $userConfigurationPath

Path to a file containing user overrides.

string $class

The class to instantiate and populate with these options.

Returns

object

fetchUserConfigFileFromCommandLineOptions()

fetchUserConfigFileFromCommandLineOptions() : boolean|string

Reads the `--config`, or `-c`, command line option and returns a path to the configuration file from those options or false if no existing path was given.

Returns

boolean|string

isValidFile()

isValidFile(boolean|string  $path) : boolean

Verifies if the given path is valid and readable.

Parameters

boolean|string $path

Returns

boolean

createConfigurationObject()

createConfigurationObject(string  $templatePath, string  $defaultUserConfigPath, null|boolean|string  $customUserConfigPath, string  $class) : null|object

Combines the given configuration files and serializes a new Configuration object from them.

Parameters

string $templatePath

Path to the template configuration file.

string $defaultUserConfigPath

Path to the phpdoc.xml or phpdoc,dist.xml in the current working directory.

null|boolean|string $customUserConfigPath

Path to the user-defined config file given using the command-line.

string $class

Base Configuration class name to construct and populate.

Returns

null|object