cvs: peardoc /en/package/networking net-ldap.xml /en/package/networking/net-ldap connect.xml query.xml results.xml search.xml

From: Date: Fri, 22 Jun 2007 11:16:02 +0000
Subject: cvs: peardoc /en/package/networking net-ldap.xml /en/package/networking/net-ldap connect.xml query.xml results.xml search.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-9801@lists.php.net to get a copy of this message
beni Fri Jun 22 11:16:02 2007 UTC Added files: /peardoc/en/package/networking/net-ldap search.xml Removed files: /peardoc/en/package/networking/net-ldap query.xml results.xml Modified files: /peardoc/en/package/networking net-ldap.xml /peardoc/en/package/networking/net-ldap connect.xml Log: * Started documenting Net_LDAP

http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/networking/net-ldap.xml diff -u peardoc/en/package/networking/net-ldap.xml:1.1 peardoc/en/package/networking/net-ldap.xml:1.2 --- peardoc/en/package/networking/net-ldap.xml:1.1 Mon Apr 9 18:19:13 2007 +++ peardoc/en/package/networking/net-ldap.xml Fri Jun 22 11:16:02 2007 @@ -1,17 +1,20 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <sect1 id="package.networking.net-ldap"> - <title>Net_LDAP</title> - - <para> - Query LDAP (Lightweight Directory Access Protocol) servers. - </para> - - &package.networking.net-ldap.connect; - &package.networking.net-ldap.query; - &package.networking.net-ldap.results; - <!-- FIXME: write more sections --> - + <title>Net_LDAP</title> + + <para> + Net_LDAP allows you to query and manipulate the data stored in directory + servers using PHP in an object-oriented way. + </para> + <para> + Detailed usage examples are available at: <literal>/your/pear/path/docs/Net_LDAP/examples/</literal> + </para> + + &package.networking.net-ldap.introduction; + &package.networking.net-ldap.errorhandling; + &package.networking.net-ldap.connect; + &package.networking.net-ldap.search; </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/connect.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/networking/net-ldap/connect.xml diff -u peardoc/en/package/networking/net-ldap/connect.xml:1.1 peardoc/en/package/networking/net-ldap/connect.xml:1.2 --- peardoc/en/package/networking/net-ldap/connect.xml:1.1 Mon Apr 9 18:19:13 2007 +++ peardoc/en/package/networking/net-ldap/connect.xml Fri Jun 22 11:16:02 2007 @@ -1,119 +1,126 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> -<sect2 id="package.networking.net-ldap.connecting"> - <title>Connecting to an LDAP server</title> - - <para> - To connect to an LDAP server, you should use - <classname>Net_LDAP</classname>'s static <function>connect</function> method. - It takes one parameter, an array full of configuration options, - and either returns - a <classname>Net_LDAP</classname> object if connecting works, or a - <classname>PEAR_Error</classname> object in case of a failure. - </para> - - <para> - The following table lists all configuration options. If the default - value for an option fits your needs, you don't need add it to your - configuration array. - - <table> - <title>Possible configuration options</title> - <tgroup cols="3"> - <thead> - <row> - <entry>Name</entry> - <entry>Description</entry> - <entry>Default</entry> - </row> - </thead> - <tbody> - <row> - <entry><literal>host</literal></entry> - <entry>LDAP server name to connect to</entry> - <entry><literal>localhost</literal></entry> - </row> - - <row> - <entry><literal>port</literal></entry> - <entry>Port on the server</entry> - <entry>389</entry> - </row> - - <row> - <entry><literal>version</literal></entry> - <entry>LDAP version</entry> - <entry><literal>3</literal></entry> - </row> - - <row> - <entry><literal>starttls</literal></entry> - <entry>TLS is started after connecting</entry> - <entry><literal>false</literal></entry> - </row> - - <row> - <entry><literal>binddn</literal></entry> - <entry>The distinguished name to bind as (username)</entry> - <entry>(none)</entry> - </row> - - <row> - <entry><literal>bindpw</literal></entry> - <entry>Password for the <literal>binddn</literal></entry> - <entry>(none)</entry> - </row> - - <row> - <entry><literal>basedn</literal></entry> - <entry>LDAP base name (root directory)</entry> - <entry>(none)</entry> - </row> - - <row> - <entry><literal>options</literal></entry> - <entry>Array of additional ldap options as key-value pairs</entry> - <entry><literal>array()</literal></entry> - </row> - - <row> - <entry><literal>filter</literal></entry> - <entry>Default search filter</entry> - <entry><literal>(objectClass=*)</literal></entry> - </row> - - <row> - <entry><literal>scope</literal></entry> - <entry>Default search scope, see <function>search</function></entry> - <entry><literal>sub</literal></entry> - </row> - - </tbody> - </tgroup> - </table> - </para> - - <example> - <title>Connecting to an LDAP server</title> - <programlisting role="php"><![CDATA[ +<!-- $Revision: 1.2 $ --> +<refentry id="package.networking.net-ldap.connecting"> + <refnamediv> + <refname>Configuration and connecting</refname> + <refpurpose>How to configure Net_LDAP and connect to an LDAP server</refpurpose> + </refnamediv> + + <refsect1> + <title>Connecting to an LDAP server</title> + + <para> + To connect to an LDAP server, you should use + <classname>Net_LDAP</classname>'s static <function>connect</function> method. + It takes one parameter, an array full of configuration options, + and either returns + a <classname>Net_LDAP</classname> object if connecting works, or a + <classname>PEAR_Error</classname> object in case of a failure. + </para> + + <para> + The following table lists all configuration options. If the default + value for an option fits your needs, you don't need add it to your + configuration array. + + <table> + <title>Possible configuration options</title> + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Description</entry> + <entry>Default</entry> + </row> + </thead> + <tbody> + <row> + <entry><literal>host</literal></entry> + <entry>LDAP server name to connect to</entry> + <entry><literal>localhost</literal></entry> + </row> + + <row> + <entry><literal>port</literal></entry> + <entry>Port on the server</entry> + <entry>389</entry> + </row> + + <row> + <entry><literal>version</literal></entry> + <entry>LDAP version</entry> + <entry><literal>3</literal></entry> + </row> + + <row> + <entry><literal>starttls</literal></entry> + <entry>TLS is started after connecting</entry> + <entry><literal>false</literal></entry> + </row> + + <row> + <entry><literal>binddn</literal></entry> + <entry>The distinguished name to bind as (username)</entry> + <entry>(none)</entry> + </row> + + <row> + <entry><literal>bindpw</literal></entry> + <entry>Password for the <literal>binddn</literal></entry> + <entry>(none)</entry> + </row> + + <row> + <entry><literal>basedn</literal></entry> + <entry>LDAP base name (root directory)</entry> + <entry>(none)</entry> + </row> + + <row> + <entry><literal>options</literal></entry> + <entry>Array of additional ldap options as key-value pairs</entry> + <entry><literal>array()</literal></entry> + </row> + + <row> + <entry><literal>filter</literal></entry> + <entry>Default search filter</entry> + <entry><literal>(objectClass=*)</literal></entry> + </row> + + <row> + <entry><literal>scope</literal></entry> + <entry>Default search scope, see <function>search</function></entry> + <entry><literal>sub</literal></entry> + </row> + + </tbody> + </tgroup> + </table> + </para> + + <example> + <title>Connecting to an LDAP server</title> + <programlisting role="php"><![CDATA[ require_once 'Net/LDAP.php'; $config = array ( - 'binddn' => 'cn=admin,ou=users,dc=example,dc=org', - 'bindpw' => 'password', - 'basedn' => 'ou=addressbook,dc=example,dc=org', - 'host' => 'ldap.example.org' - ); + 'binddn' => 'cn=admin,ou=users,dc=example,dc=org', + 'bindpw' => 'password', + 'basedn' => 'ou=addressbook,dc=example,dc=org', + 'host' => 'ldap.example.org' +); $ldap = Net_LDAP::connect($config); if (PEAR::isError($ldap)) { - die($ldap->getMessage() . "\n"); + die($ldap->getMessage() . "\n"); } ]]></programlisting> - </example> + </example> -</sect2> + </refsect1> +</refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/search.xml?view=markup&rev=1.1 Index: peardoc/en/package/networking/net-ldap/search.xml +++ peardoc/en/package/networking/net-ldap/search.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.networking.net-ldap.search"> <refnamediv> <refname>Search</refname> <refpurpose>How to search entries</refpurpose> </refnamediv> <refsect1> <title>Searching some entries</title> <para> After connecting to the server, you can use <classname>Net_LDAP</classname>'s <function>search</function> method to search the directory. The method takes three parameters: <itemizedlist> <listitem> <para> <literal>$base</literal> is the base search DN. If kept <literal>null</literal>, the default search DN configured when connecting is used. </para> </listitem> <listitem> <para> <literal>$filter</literal> is the query filter that determines which results are returned. </para> </listitem> <listitem> <para> <literal>$params</literal> is an array of configuration options for the current query. <table> <title>Possible configuration parameters</title> <tgroup cols="3"> <thead> <row> <entry>Name</entry> <entry>Description</entry> <entry>Default</entry> </row> </thead> <tbody> <row> <entry><literal>scope</literal></entry> <entry> The scope used for searching: <itemizedlist> <listitem> <para> <literal>base</literal> - Just one entry </para> </listitem> <listitem> <para> <literal>sub</literal> - The whole tree </para> </listitem> <listitem> <para> <literal>one</literal> - Immediately below <literal>$base</literal> </para> </listitem> </itemizedlist> </entry> <entry><literal>sub</literal></entry> </row> <row> <entry><literal>sizelimit</literal></entry> <entry>Number of entries returned at maximum</entry> <entry><literal>0</literal> (no limit)</entry> </row> <row> <entry><literal>timelimit</literal></entry> <entry>Seconds to spent for searching</entry> <entry><literal>0</literal> (no limit)</entry> </row> <row> <entry><literal>attrsonly</literal></entry> <entry>If <literal>true</literal>, only attribute names are returned</entry> <entry><literal>false</literal></entry> </row> <row> <entry><literal>attributes</literal></entry> <entry> Array of attribute names, which the entry should contain. It is good practice to limit this to just the ones you need. </entry> <entry><literal>array()</literal> (all attributes)</entry> </row> </tbody> </tgroup> </table> </para> </listitem> </itemizedlist> </para> <example> <title>Making a search query</title> <programlisting role="php"><![CDATA[ $filter = 'sn=Joe*'; $searchbase = 'ou=addressbook,dc=example,dc=org'; $options = array( 'scope' => 'sub', 'attributes' => array('sn') ); $result = $ldap->search($searchbase, $filter, $options); if (PEAR::isError($result)) { die($result->getMessage() . "\n"); } ]]></programlisting> </example> </refsect1> </refentry> <!-- Keep this comment at the end of the file Local variables: mode: sgml sgml-omittag:t sgml-shorttag:t sgml-minimize-attributes:nil sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t sgml-parent-document:nil sgml-default-dtd-file:"../../../manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.pear.doc (#9801) next »