Class: DB_ldap2
Source Location: /DB_ldap2-0.3/ldap2.php
DB_common
|
--DB_ldap2
LDAP2 DB interface class
Author(s):
Version:
|
|
Child classes:
|
Inherited Variables
|
Inherited Methods
|
Class Details
Method Detail
DB_ldap2 (Constructor) [line 119]
Constructor, calls DB_common constructor
affectedRows [line 638]
Gets the number of rows affected by the last query. if the last query was a select, returns 0.
base [line 690]
void base(
[mixed
$base_dn = null])
|
|
connect [line 173]
int connect(
$dsn
$dsninfo, [boolean
$persistent = false])
|
|
Connect and bind to LDAPv2 server with either anonymous or authenticated bind depending on dsn info The format of the supplied DSN: ldap2://binddn:bindpw@host:port/basedn I.e.: ldap2://uid=dexter,ou=People,dc=example,dc=net:secret@127.0.0.1/dc=example,dc=net
Overridden in child classes as:
- DB_ldap3::connect()
- Connect and bind to LDAPv3 server with either anonymous or authenticated bind depending on dsn info
Parameters:
createSequence [line 815]
mixed createSequence(
string
$seq_name)
|
|
Create the sequence The sequence entry is based on core schema with extensibleObject, so it should work with any LDAP server which doesn't check schema or supports extensibleObject object class. Format of the entry: dn: $seq_dn objectClass: top objectClass: extensibleObject sn: $seq_id cn: $seq_value uid: $seq_uniq
Parameters:
disconnect [line 232]
dropSequence [line 843]
mixed dropSequence(
string
$seq_name)
|
|
Drop a sequence
Parameters:
errorNative [line 624]
Get the native error code of the last error (if any) that occured on the current connection.
executeEmulateQuery [line 1013]
mixed executeEmulateQuery(
resource
$stmt, [array
$data = false])
|
|
Emulates the execute statement.
Parameters:
fetchInto [line 446]
int fetchInto(
$result
$result, $arr
&$arr, $fetchmode
$fetchmode, [$rownum
$rownum = null])
|
|
Fetch a row and insert the data into an existing array. DB_FETCHMODE_ORDERED returns a flat array of values ("value", "val1", "val2"). DB_FETCHMODE_ASSOC returns an array of structuralized data ("field_name1" => "value", "field_name2" => array("val1", "val2")).
Parameters:
fetchRow [line 415]
array fetchRow(
$result
$result, [$fetchmode
$fetchmode = DB_FETCHMODE_DEFAULT], [$rownum
$rownum = null])
|
|
Fetch and return a row of data (it uses fetchInto for that)
Parameters:
freeResult [line 542]
bool freeResult(
$result
$result)
|
|
Free the internal resources associated with $result.
Parameters:
getListOf [line 663]
int getListOf(
mixed
$type)
|
|
Returns the query needed to get some backend info. This function is used only for compatibility reasons.
getTables [line 649]
isManip [line 679]
boolean isManip(
string
$action)
|
|
Tell whether an action is a data manipulation action (add, compare, delete, modify, mod_add, mod_del, mod_replace, rename)
Parameters:
ldapExplodeDN [line 1235]
array ldapExplodeDN(
string
$dn, [int
$with_attrib = 0])
|
|
Splits the DN and breaks it up into its component parts. Each part is known as Relative Distinguished Name, or RDN.
Parameters:
ldapGetOption [line 1214]
bool ldapGetOption(
int
$option, mixed
&$retval)
|
|
Gets the current value for given option.
Parameters:
ldapGetParam [line 1172]
mixed ldapGetParam(
string
$param)
|
|
Gets the default parameters for query.
Parameters:
ldapRaiseError [line 865]
mixed ldapRaiseError(
[int
$errno = null])
|
|
Generate error message for LDAP errors.
Parameters:
ldapSetAction [line 715]
void ldapSetAction(
[mixed
$action = 'search'])
|
|
ldapSetBaseDN [line 702]
void ldapSetBaseDN(
[mixed
$base_dn = null])
|
|
ldapSetOption [line 1193]
bool ldapSetOption(
int
$option, mixed
$newval)
|
|
Sets the value of the given option.
Parameters:
ldapSetParam [line 1150]
mixed ldapSetParam(
string
$param, string
$value)
|
|
Sets the default parameters for query.
Parameters:
nextId [line 737]
a nextId(
string
$seq_name, [bool
$ondemand = true])
|
|
Get the next value in a sequence. LDAP provides transactions for only one entry and we need to prevent race condition. If unique value before and after modify aren't equal then wait and try again.
Parameters:
nextResult [line 399]
true nextResult(
a
$result)
|
|
Move the internal ldap result pointer to the next available result
Parameters:
numCols [line 591]
int numCols(
$result
$result)
|
|
Get the number of columns in a result set. This function is used only for compatibility reasons.
Parameters:
numRows [line 606]
int numRows(
$result
$result)
|
|
Get the number of rows in a result set.
Parameters:
prepare [line 930]
resource prepare(
mixed
$query)
|
|
Prepares a query for multiple execution with execute(). This behaviour is emulated for LDAP backend. prepare() requires a generic query as an array with special characters (wildcards) as values. Types of wildcards: ? - a quoted scalar value, i.e. strings, integers & - requires a file name, the content of the file insert into the query (i.e. saving binary data in a db) ! - value is inserted 'as is' Example: $sth = $dbh->prepare( array( array( 'dn' => '?', 'objectClass' => '?', 'cn' => '?', 'sn' => '?', 'description' => '&' ), 'action' => 'add' ); ); $sigfile = "/home/dexter/.signature"; $res = $dbh->execute($sth, array( 'cn=Piotr Roszatycki,dc=example,dc=com', array('top', 'person'), 'Piotr Roszatycki', 'Roszatycki', $sigfile ));
Parameters:
quote [line 574]
mixed quote(
[$string
$str = null])
|
|
Quote the given string so it can be safely used within string delimiters in a query.
Parameters:
simpleQuery [line 293]
int simpleQuery(
mixed
$query)
|
|
Performs a request against the LDAP server The type of request depend on $query parameter. If $query is string, perform simple searching query with filter in $query parameter. If $query is array, the first element of array is filter string (for reading operations) or data array (for writing operations). Another elements of $query array are query parameters which overrides the default parameters. The following parameters can be passed for search queries: <li />base_dn <li />attributes - array, the attributes that shall be returned <li />attrsonly <li />sizelimit - integer, the max number of results to be returned <li />timelimit - integer, the timelimit after which to stop searching <li />deref - <li/>sort - string, which tells the attribute name by which to sort I.e.:
Parameters:
Documentation generated on Sat, 1 May 2004 00:39:53 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.
|
|