PHP Class LdapTools\DomainConfiguration

Author: Chad Sikorra ([email protected])
Inheritance: use trait ConfigurationParseTrait
显示文件 Open project: ldaptools/ldaptools Class Usage Examples

Protected Properties

Property Type Description
$config The configuration values.
$required These values must be set for the configuration to be valid.
$yamlConfigMap Maps YAML domain config values to their array key values.

Public Methods

Method Description
__construct ( string $domainName = '' )
getBaseDn ( ) : string The base distinguished name in use.
getBindFormat ( ) : string Get the format a username should be bound as.
getConnectTimeout ( ) : integer Get the initial connection timeout value (seconds). This is how long it will wait when making the initial connection attempt to the LDAP server before it considers it unreachable/down.
getDomainName ( ) : string Get the fully qualified domain name.
getEncoding ( ) : string Get the encoding type to use.
getIdleReconnect ( ) : integer Get the elapsed time (in seconds) when an idle connection will attempt to reconnect to LDAP. A value of 0 means never.
getLazyBind ( ) : boolean Get whether or not the connection should bind on construction, or what until necessary.
getLdapOptions ( ) : array Get the array of LDAP_OPT_* constants and values that will be used when connecting.
getLdapType ( ) : string Get the LDAP type set for this domain (ie. Active Directory, OpenLDAP, etc).
getOperationInvoker ( ) : LdapTools\Operation\Invoker\LdapOperationInvokerInterface Get the operation invoker used in the LDAP connection.
getPageSize ( ) : integer Get the page size for paging operations.
getPassword ( ) : string Set the password to use when binding.
getPort ( ) : integer Get the port number to connect to.
getSchemaName ( ) : string Get the schema name set for this domain. If none is set explicitly, it will return the LDAP type name.
getServerSelection ( ) : mixed Get the server selection method to be used.
getServers ( ) : array Get the LDAP server names or IP addresses.
getUsePaging ( ) : boolean Get whether or not LDAP paging control should be used.
getUseSsl ( ) : boolean Whether SSL will be used for the connection or not.
getUseTls ( ) : boolean Get whether TLS will be used for the connection or not.
getUsername ( ) : string Get the username to use when binding.
load ( array $config ) Load a configuration from an array of values. The keys must be the same name as their YAML config names.
setBaseDn ( string $baseDn ) The base distinguished name to use (ie. "dc=example,dc=com").
setBindFormat ( string $bindFormat ) Set the format a username should be bound as.
setConnectTimeout ( $seconds ) Set the initial connection timeout value (seconds). This is how long it will wait when making the initial connection attempt to the LDAP server before it considers it unreachable/down.
setDomainName ( string $domainName ) Set the fully qualified domain name (ie. "example.com").
setEncoding ( string $encoding ) Set the encoding type to use.
setIdleReconnect ( integer $seconds ) Set the elapsed time (in seconds) when an idle connection will attempt to reconnect to LDAP. If you want to set it so an idle reconnect never happens, set the value to 0.
setLazyBind ( boolean $lazyBind ) Set whether or not the connection should bind on construction, or what until necessary.
setLdapOption ( string | integer $option, $value ) Set a specific LDAP_OPT_* constant and value.
setLdapOptions ( array $ldapOptions ) Set the LDAP_OPT_* constants to be used when connecting. This should be in the form of:
setLdapType ( string $ldapType ) Set the LDAP type for this domain.
setOperationInvoker ( LdapTools\Operation\Invoker\LdapOperationInvokerInterface $operationInvoker ) Set the operation invoker used in the LDAP connection.
setPageSize ( integer $pageSize ) Set the page size for paging operations.
setPassword ( string $password ) Set the password to use when binding.
setPort ( integer $port ) The port number to connect to.
setSchemaName ( string $schemaName ) Set the schema name to use for this domain.
setServerSelection ( $type ) Set the server selection method that should be used. Let the LdapServerPool take care of validation.
setServers ( array $servers ) Set the LDAP servers as an array of names or IP addresses.
setUsePaging ( boolean $paging ) Set whether or not LDAP paging control should be used.
setUseSsl ( boolean $useSsl ) Set whether SSL will be used for the connection or not.
setUseTls ( boolean $useTls ) Set whether TLS will be used for the connection or not.
setUsername ( string $username ) Set the username to use when binding.

Protected Methods

Method Description
isParsedConfigValid ( array $config ) : boolean Checks whether all required values for the configuration have been set.
validateInteger ( mixed $value, string $name ) : integer This is a helper since an integer could simply be passed as a string, which is still valid.

Method Details

__construct() public method

public __construct ( string $domainName = '' )
$domainName string

getBaseDn() public method

The base distinguished name in use.
public getBaseDn ( ) : string
return string

getBindFormat() public method

Get the format a username should be bound as.
public getBindFormat ( ) : string
return string

getConnectTimeout() public method

Get the initial connection timeout value (seconds). This is how long it will wait when making the initial connection attempt to the LDAP server before it considers it unreachable/down.
public getConnectTimeout ( ) : integer
return integer

getDomainName() public method

Get the fully qualified domain name.
public getDomainName ( ) : string
return string

getEncoding() public method

Get the encoding type to use.
public getEncoding ( ) : string
return string

getIdleReconnect() public method

Get the elapsed time (in seconds) when an idle connection will attempt to reconnect to LDAP. A value of 0 means never.
public getIdleReconnect ( ) : integer
return integer

getLazyBind() public method

Get whether or not the connection should bind on construction, or what until necessary.
public getLazyBind ( ) : boolean
return boolean

getLdapOptions() public method

Get the array of LDAP_OPT_* constants and values that will be used when connecting.
public getLdapOptions ( ) : array
return array

getLdapType() public method

Get the LDAP type set for this domain (ie. Active Directory, OpenLDAP, etc).
public getLdapType ( ) : string
return string

getOperationInvoker() public method

Get the operation invoker used in the LDAP connection.
public getOperationInvoker ( ) : LdapTools\Operation\Invoker\LdapOperationInvokerInterface
return LdapTools\Operation\Invoker\LdapOperationInvokerInterface

getPageSize() public method

Get the page size for paging operations.
public getPageSize ( ) : integer
return integer

getPassword() public method

Set the password to use when binding.
public getPassword ( ) : string
return string

getPort() public method

Get the port number to connect to.
public getPort ( ) : integer
return integer

getSchemaName() public method

Get the schema name set for this domain. If none is set explicitly, it will return the LDAP type name.
public getSchemaName ( ) : string
return string

getServerSelection() public method

Get the server selection method to be used.
public getServerSelection ( ) : mixed
return mixed

getServers() public method

Get the LDAP server names or IP addresses.
public getServers ( ) : array
return array

getUsePaging() public method

Get whether or not LDAP paging control should be used.
public getUsePaging ( ) : boolean
return boolean

getUseSsl() public method

Whether SSL will be used for the connection or not.
public getUseSsl ( ) : boolean
return boolean

getUseTls() public method

Get whether TLS will be used for the connection or not.
public getUseTls ( ) : boolean
return boolean

getUsername() public method

Get the username to use when binding.
public getUsername ( ) : string
return string

isParsedConfigValid() protected method

Checks whether all required values for the configuration have been set.
protected isParsedConfigValid ( array $config ) : boolean
$config array
return boolean

load() public method

Load a configuration from an array of values. The keys must be the same name as their YAML config names.
public load ( array $config )
$config array

setBaseDn() public method

The base distinguished name to use (ie. "dc=example,dc=com").
public setBaseDn ( string $baseDn )
$baseDn string

setBindFormat() public method

Set the format a username should be bound as.
public setBindFormat ( string $bindFormat )
$bindFormat string

setConnectTimeout() public method

Set the initial connection timeout value (seconds). This is how long it will wait when making the initial connection attempt to the LDAP server before it considers it unreachable/down.
public setConnectTimeout ( $seconds )

setDomainName() public method

Set the fully qualified domain name (ie. "example.com").
public setDomainName ( string $domainName )
$domainName string

setEncoding() public method

Set the encoding type to use.
public setEncoding ( string $encoding )
$encoding string

setIdleReconnect() public method

Set the elapsed time (in seconds) when an idle connection will attempt to reconnect to LDAP. If you want to set it so an idle reconnect never happens, set the value to 0.
public setIdleReconnect ( integer $seconds )
$seconds integer

setLazyBind() public method

Set whether or not the connection should bind on construction, or what until necessary.
public setLazyBind ( boolean $lazyBind )
$lazyBind boolean

setLdapOption() public method

Set a specific LDAP_OPT_* constant and value.
public setLdapOption ( string | integer $option, $value )
$option string | integer
$value

setLdapOptions() public method

[ LDAP_OPT_* => value, ] ...where LDAP_OPT_* is either the int value of the constant, or the constant name in the form of a string.
public setLdapOptions ( array $ldapOptions )
$ldapOptions array

setLdapType() public method

Set the LDAP type for this domain.
public setLdapType ( string $ldapType )
$ldapType string The LDAP type.

setOperationInvoker() public method

Set the operation invoker used in the LDAP connection.
public setOperationInvoker ( LdapTools\Operation\Invoker\LdapOperationInvokerInterface $operationInvoker )
$operationInvoker LdapTools\Operation\Invoker\LdapOperationInvokerInterface

setPageSize() public method

Set the page size for paging operations.
public setPageSize ( integer $pageSize )
$pageSize integer

setPassword() public method

Set the password to use when binding.
public setPassword ( string $password )
$password string

setPort() public method

The port number to connect to.
public setPort ( integer $port )
$port integer

setSchemaName() public method

Set the schema name to use for this domain.
public setSchemaName ( string $schemaName )
$schemaName string

setServerSelection() public method

Set the server selection method that should be used. Let the LdapServerPool take care of validation.
public setServerSelection ( $type )
$type

setServers() public method

Set the LDAP servers as an array of names or IP addresses.
public setServers ( array $servers )
$servers array

setUsePaging() public method

Set whether or not LDAP paging control should be used.
public setUsePaging ( boolean $paging )
$paging boolean

setUseSsl() public method

Set whether SSL will be used for the connection or not.
public setUseSsl ( boolean $useSsl )
$useSsl boolean

setUseTls() public method

Set whether TLS will be used for the connection or not.
public setUseTls ( boolean $useTls )
$useTls boolean

setUsername() public method

Set the username to use when binding.
public setUsername ( string $username )
$username string

validateInteger() protected method

This is a helper since an integer could simply be passed as a string, which is still valid.
protected validateInteger ( mixed $value, string $name ) : integer
$value mixed
$name string
return integer

Property Details

$config protected_oe property

The configuration values.
protected $config

$required protected_oe property

These values must be set for the configuration to be valid.
protected $required

$yamlConfigMap protected_oe property

Maps YAML domain config values to their array key values.
protected $yamlConfigMap