Working with LDAP recently, it is easy to find the API for each language in the officially recommended Client-apis to interact with the LDAP server. But in the use of Apachedirectorystudio, the software can show the schema data, and then carefully read the official documents, or do not see a description of the schema data query where (if there is a small partner in the document to see the relevant instructions, I hope to leave a message to tell me). But found in PHP written by the client phpldapadmin, and then through its source code, found how to query schema data.
Using the official documentation, we found that the schema data contains the following four sections
syntaxes
Attributes
Matching_rules
Objectclasses
To query objectclasses as an example (you can also query one time), the corresponding query method is as follows
First case
$read _ret = Ldap_read ($ds, ' Cn=subschema ', ' (Objectclass=subschema) ', [' objectclasses ']); $read _ret = Ldap_read ($ds, ' Cn=subschema ', ' (objectclass=*) ', [' objectclasses ']);
If the first query is not available, the second type of
$read _ret = Ldap_read ($ds, ' cn=aggregate,cn=schema,cn=configuration,dc=example,dc=com ', ' (objectclass=*) '; $read _ ret = Ldap_read ($ds, ' cn=schema,cn=configuration,dc=example,dc=com ', ' (objectclass=*) ', [' objectclasses ']); $read _ ret = Ldap_read ($ds, ' cn=schema,ou=admin,dc=example,dc=com ', ' (objectclass=*) ', [' objectclasses ']);
If the second query is not available, the third type of
$read _ret = Ldap_read ($ds, ' cn=schema,cn=config ', ' (objectclass=*) ', [' objectclasses ']);