PHP Class LdapTools\Configuration

Author: Chad Sikorra ([email protected])
Inheritance: use trait ConfigurationParseTrait
Show file Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$config array
$domains DomainConfiguration objects in the form of 'domainName' => object.
$eventDispatcher The event dispatcher that should be used.
$logger The logger that should be used.
$yamlConfigMap Maps the config values to their array key values in this class.

Public Methods

Method Description
__construct ( variadic $domains )
addDomain ( variadic $domains ) Add domain configurations. Accepts an arbitrary amount of domain configurations.
getAttributeConverters ( ) : array Get the attribute converters that will be registered.
getCacheOptions ( ) : array Get the cache options for the cache type.
getCacheType ( ) : string Get the configured cache type.
getDefaultDomain ( ) : string Get the name of the default domain to be used when there are multiple domains.
getDomainConfiguration ( null | string $domain = null ) : DomainConfiguration[] | DomainConfiguration Get the DomainConfiguration for a specific domain, or an array of all DomainConfiguration objects if none is specified.
getEventDispatcher ( ) : LdapTools\Event\EventDispatcherInterface | null Get the explicitly set event dispatcher to be used.
getLogger ( ) : LdapTools\Log\LdapLoggerInterface | null Get the logger to be used.
getSchemaFolder ( ) : string Get the location where the schema definitions exist.
getSchemaFormat ( ) : string Get the schema definition format.
load ( string $file ) Load the LDAP configuration from a YAML file. See the 'resources/config' folder for an example.
loadFromArray ( array $config ) Load the configuration from an array of values. They should be in the same format/name as the YAML format.
setAttributeConverters ( array $attributeConverters ) Set attribute converters that should be registered. In the form:
setCacheOptions ( $options ) Set the caching options for the cache type.
setCacheType ( $type ) Set the cache type to use.
setDefaultDomain ( $domain ) Set the default domain that should be used by the LdapManager. In the absence of multiple domains, this does not have to be set.
setEventDispatcher ( LdapTools\Event\EventDispatcherInterface $eventDispatcher ) Set an event dispatcher, other than the default, to be used.
setLogger ( LdapTools\Log\LdapLoggerInterface $logger ) Set a logger to be used.
setSchemaFolder ( $folder ) Set the location where the schema definitions exist.
setSchemaFormat ( $type ) Set the schema definition format.

Protected Methods

Method Description
loadDomainConfiguration ( array $config ) Iterates through and loads the domain section of the configuration.

Method Details

__construct() public method

public __construct ( variadic $domains )
$domains variadic

addDomain() public method

Add domain configurations. Accepts an arbitrary amount of domain configurations.
public addDomain ( variadic $domains )
$domains variadic

getAttributeConverters() public method

Get the attribute converters that will be registered.
public getAttributeConverters ( ) : array
return array

getCacheOptions() public method

Get the cache options for the cache type.
public getCacheOptions ( ) : array
return array

getCacheType() public method

Get the configured cache type.
public getCacheType ( ) : string
return string

getDefaultDomain() public method

Get the name of the default domain to be used when there are multiple domains.
public getDefaultDomain ( ) : string
return string

getDomainConfiguration() public method

Get the DomainConfiguration for a specific domain, or an array of all DomainConfiguration objects if none is specified.
public getDomainConfiguration ( null | string $domain = null ) : DomainConfiguration[] | DomainConfiguration
$domain null | string
return DomainConfiguration[] | DomainConfiguration

getEventDispatcher() public method

Get the explicitly set event dispatcher to be used.
public getEventDispatcher ( ) : LdapTools\Event\EventDispatcherInterface | null
return LdapTools\Event\EventDispatcherInterface | null

getLogger() public method

Get the logger to be used.
public getLogger ( ) : LdapTools\Log\LdapLoggerInterface | null
return LdapTools\Log\LdapLoggerInterface | null

getSchemaFolder() public method

Get the location where the schema definitions exist.
public getSchemaFolder ( ) : string
return string

getSchemaFormat() public method

Get the schema definition format.
public getSchemaFormat ( ) : string
return string

load() public method

Load the LDAP configuration from a YAML file. See the 'resources/config' folder for an example.
public load ( string $file )
$file string The path to the file.

loadDomainConfiguration() protected method

Iterates through and loads the domain section of the configuration.
protected loadDomainConfiguration ( array $config )
$config array

loadFromArray() public method

ie. [ 'general' => [ ... ], 'domains' => [ ... ] ]
public loadFromArray ( array $config )
$config array

setAttributeConverters() public method

[ 'converter_name' => '\Full\Class\Name' ]
public setAttributeConverters ( array $attributeConverters )
$attributeConverters array

setCacheOptions() public method

Set the caching options for the cache type.
public setCacheOptions ( $options )

setCacheType() public method

Set the cache type to use.
public setCacheType ( $type )
$type

setDefaultDomain() public method

Set the default domain that should be used by the LdapManager. In the absence of multiple domains, this does not have to be set.
public setDefaultDomain ( $domain )
$domain

setEventDispatcher() public method

Set an event dispatcher, other than the default, to be used.
public setEventDispatcher ( LdapTools\Event\EventDispatcherInterface $eventDispatcher )
$eventDispatcher LdapTools\Event\EventDispatcherInterface

setLogger() public method

Set a logger to be used.
public setLogger ( LdapTools\Log\LdapLoggerInterface $logger )
$logger LdapTools\Log\LdapLoggerInterface

setSchemaFolder() public method

Set the location where the schema definitions exist.
public setSchemaFolder ( $folder )
$folder string The full path to the folder.

setSchemaFormat() public method

Set the schema definition format.
public setSchemaFormat ( $type )
$type string The schema type (ie. yml).

Property Details

$config protected property

protected array $config
return array

$domains protected property

DomainConfiguration objects in the form of 'domainName' => object.
protected $domains

$eventDispatcher protected property

The event dispatcher that should be used.
protected $eventDispatcher

$logger protected property

The logger that should be used.
protected $logger

$yamlConfigMap protected property

Maps the config values to their array key values in this class.
protected $yamlConfigMap