LDAPConnector
in package
uses
FileConfiguration
Table of Contents
Constants
- CONFIG_FILE = "ldap.connector"
Properties
- $configs : array<string, array<string|int, mixed>>
- $handle : Connection|false
- $password : string
- $port : int
- $url : string
- $user : string
Methods
- __construct() : mixed
- Uses either parameters or global config properties to prep for connecting to an LDAP server
- getConnection() : Connection|false
- Returns the value of the property with the given name
- configurationFileExists() : bool
- Checks for the existence of a file with the given filename
- getConfigurationFromFileName() : array<string|int, mixed>
- Retrieves a config array by its corresponding filename
- getProperty() : mixed
- Returns the value of the property with the given name
- setProperty() : void
- Assigns a property on the class with the given $name and $value
- bind() : bool
- configIsValid() : bool
- Checks the given parameters for validity
- loadConfigurationFile() : void
- Loads and parses a php ini file into an array keyed by ini sections
Constants
CONFIG_FILE
private
mixed
CONFIG_FILE
= "ldap.connector"
Properties
$configs
private
array<string, array<string|int, mixed>>
$configs
= []
An array of configuration arrays
$handle
private
Connection|false
$handle
The LDAP Connection
$password
private
string
$password
The password to connect with
$port
private
int
$port
The port to connect to
$url
private
string
$url
The url to connect to
$user
private
string
$user
The user to connect with
Methods
__construct()
Uses either parameters or global config properties to prep for connecting to an LDAP server
public
__construct([string|null $url = NULL ][, int|null $port = NULL ][, string|null $user = NULL ][, string|null $password = NULL ]) : mixed
Parameters
- $url : string|null = NULL
-
The url to connect to
- $port : int|null = NULL
-
The port to connect to
- $user : string|null = NULL
-
The user to connect with
- $password : string|null = NULL
-
The password to connect with
getConnection()
Returns the value of the property with the given name
public
getConnection() : Connection|false
Return values
Connection|falseconfigurationFileExists()
Checks for the existence of a file with the given filename
protected
configurationFileExists(string $configurationFileName) : bool
Parameters
- $configurationFileName : string
-
The name of the file without extension or path
Return values
boolgetConfigurationFromFileName()
Retrieves a config array by its corresponding filename
protected
getConfigurationFromFileName(string $configurationFileName) : array<string|int, mixed>
Parameters
- $configurationFileName : string
-
The name of the file without extension or path
Return values
array<string|int, mixed>getProperty()
Returns the value of the property with the given name
protected
getProperty(string $name) : mixed
Parameters
- $name : string
-
The name of the property
setProperty()
Assigns a property on the class with the given $name and $value
protected
setProperty(string $name, mixed $value) : void
Parameters
- $name : string
-
The name of the property to create
- $value : mixed
-
The value of the property to create
bind()
private
bind() : bool
Return values
boolconfigIsValid()
Checks the given parameters for validity
private
static configIsValid(string|null $url, int|null $port, string|null $user, string|null $password) : bool
Parameters
- $url : string|null
-
An ldap url
- $port : int|null
-
The port of the ldap server
- $user : string|null
-
The user to connect as
- $password : string|null
-
The password to authenticate with
Return values
boolloadConfigurationFile()
Loads and parses a php ini file into an array keyed by ini sections
private
loadConfigurationFile(string $configurationFileName) : void
Parameters
- $configurationFileName : string
-
The name of the file without extension or path