PHP Interface LdapTools\Connection\LdapConnectionInterface

Author: Chad Sikorra ([email protected])
Datei anzeigen Open project: ldaptools/ldaptools Interface Usage Examples

Public Methods

Method Description
close ( ) If the connection is bound, this closes the LDAP connection.
connect ( string | null $username = null, string | null $password = null, boolean $anonymous = false, string | null $server = null ) Connect and bind to LDAP.
execute ( LdapTools\Operation\LdapOperationInterface $operation ) : mixed Execute an operation against LDAP (Add, Modify, Delete, Move, Query, etc).
getConfig ( ) : DomainConfiguration Get the DomainConfiguration instance in use by the connection.
getConnection ( ) : resource Get the LDAP connection resource.
getDiagnosticMessage ( ) : string Get the full diagnostic message from the LDAP server for the last operation.
getExtendedErrorNumber ( ) : integer Get the extended error number from LDAP for the last operation.
getIdleTime ( ) : integer Get the time, in seconds, that the connection has been idle. If not connected this will always return 0.
getLastError ( ) : string Get the message from the LDAP server for the last operation.
getRootDse ( ) : LdapObject Return a RootDse LDAP object for this connection.
getServer ( ) : string | null Get the LDAP server that the connection is currently connected to.
isBound ( ) : boolean Determine whether the connection is currently bound to LDAP with a username/password.
setControl ( LdapControl $control ) Set the LDAP control for the connection.

Method Details

close() public method

If the connection is bound, this closes the LDAP connection.
public close ( )

connect() public method

Connect and bind to LDAP.
public connect ( string | null $username = null, string | null $password = null, boolean $anonymous = false, string | null $server = null )
$username string | null The username to connect with. If not specified, the one in the config is used.
$password string | null The password for the username.
$anonymous boolean Whether this is an attempt to bind anonymously, ignoring the username and password.
$server string | null The server to connect to. If not specified, the server(s) in the config are used.

execute() public method

Execute an operation against LDAP (Add, Modify, Delete, Move, Query, etc).
public execute ( LdapTools\Operation\LdapOperationInterface $operation ) : mixed
$operation LdapTools\Operation\LdapOperationInterface
return mixed

getConfig() public method

Get the DomainConfiguration instance in use by the connection.
public getConfig ( ) : DomainConfiguration
return LdapTools\DomainConfiguration

getConnection() public method

Get the LDAP connection resource.
public getConnection ( ) : resource
return resource

getDiagnosticMessage() public method

Get the full diagnostic message from the LDAP server for the last operation.
public getDiagnosticMessage ( ) : string
return string

getExtendedErrorNumber() public method

Get the extended error number from LDAP for the last operation.
public getExtendedErrorNumber ( ) : integer
return integer

getIdleTime() public method

Get the time, in seconds, that the connection has been idle. If not connected this will always return 0.
public getIdleTime ( ) : integer
return integer

getLastError() public method

Get the message from the LDAP server for the last operation.
public getLastError ( ) : string
return string

getRootDse() public method

Return a RootDse LDAP object for this connection.
public getRootDse ( ) : LdapObject
return LdapTools\Object\LdapObject

getServer() public method

Get the LDAP server that the connection is currently connected to.
public getServer ( ) : string | null
return string | null

isBound() public method

Determine whether the connection is currently bound to LDAP with a username/password.
public isBound ( ) : boolean
return boolean

setControl() public method

Set the LDAP control for the connection.
public setControl ( LdapControl $control )
$control LdapControl