cvs: peardoc /en/package/networking net-ldap.xml /en/package/networking/net-ldap attributes.xml entries.xml errorhandling.xml fetching.xml
| From: | Benedikt Hallinger | Date: | Thu, 28 Jun 2007 07:58:29 +0000 |
| Subject: | cvs: peardoc /en/package/networking net-ldap.xml /en/package/networking/net-ldap attributes.xml entries.xml errorhandling.xml fetching.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-9833@lists.php.net to get a copy of this message | ||
beni Thu Jun 28 07:58:29 2007 UTC
Added files:
/peardoc/en/package/networking/net-ldap entries.xml
Modified files:
/peardoc/en/package/networking net-ldap.xml
/peardoc/en/package/networking/net-ldap attributes.xml
errorhandling.xml
fetching.xml
Log:
* finished net-ldap docs so far, i think
http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap.xml?r1=1.6&r2=1.7&diff_format=u Index: peardoc/en/package/networking/net-ldap.xml diff -u peardoc/en/package/networking/net-ldap.xml:1.6 peardoc/en/package/networking/net-ldap.xml:1.7 --- peardoc/en/package/networking/net-ldap.xml:1.6 Tue Jun 26 08:58:03 2007 +++ peardoc/en/package/networking/net-ldap.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="package.networking.net-ldap"> <title>Net_LDAP</title> @@ -17,6 +17,7 @@ &package.networking.net-ldap.search; &package.networking.net-ldap.fetching; &package.networking.net-ldap.attributes; + &package.networking.net-ldap.entries; </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/attributes.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/networking/net-ldap/attributes.xml diff -u peardoc/en/package/networking/net-ldap/attributes.xml:1.2 peardoc/en/package/networking/net-ldap/attributes.xml:1.3 --- peardoc/en/package/networking/net-ldap/attributes.xml:1.2 Tue Jun 26 14:07:01 2007 +++ peardoc/en/package/networking/net-ldap/attributes.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.networking.net-ldap.attributes"> <refnamediv> <refname>Attributes</refname> @@ -10,7 +10,7 @@ <title>Reading attributes</title> <para> - Reading attribute values depends on the selection of those attributes at search time. + Reading attribute values depends on the selection of those attributes at search time. You can only access attributes that where selected! You can read attribute values using either <classname>Net_LDAP_Entry</classname>'s <function>getValues</function> or <function>getValue</function> method. <function>getValue</function> will return an array where the keys are the attributes names. If you use <function>getValues</function> you may pass an option: http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/errorhandling.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/networking/net-ldap/errorhandling.xml diff -u peardoc/en/package/networking/net-ldap/errorhandling.xml:1.1 peardoc/en/package/networking/net-ldap/errorhandling.xml:1.2 --- peardoc/en/package/networking/net-ldap/errorhandling.xml:1.1 Mon Jun 25 06:27:06 2007 +++ peardoc/en/package/networking/net-ldap/errorhandling.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.networking.net-ldap.errorhandling"> <refnamediv> <refname>Errorhandling</refname> @@ -10,9 +10,9 @@ <title>Errorhandling</title> <para> - Most of Net_LDAPs methods return a <classname>Net_LDAP_Error</classname>-object if something went wrong. - You always should check for errors if you perform an action to be sure that your - application doesn't things you dont want it to do. + Nearly all of Net_LDAPs methods return a <classname>Net_LDAP_Error</classname>-object if something went wrong. + You always should check for errors after you performed an action to be sure that your + application doesn't do things you don't want it to do. </para> <para> @@ -33,14 +33,14 @@ // Perform an arbitrary action: $result = $ldap->search($searchbase, $filter, $options); -// Check, if an error occured and halt script execution. +// Check, if an error occured and do something. // Here we use die() to show the message of the error. if (PEAR::isError($result)) { die($result->getMessage()); } ]]></programlisting> </example> - + <table> <title>Error codes Net_LDAP</title> <tgroup cols="2"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/fetching.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/networking/net-ldap/fetching.xml diff -u peardoc/en/package/networking/net-ldap/fetching.xml:1.2 peardoc/en/package/networking/net-ldap/fetching.xml:1.3 --- peardoc/en/package/networking/net-ldap/fetching.xml:1.2 Tue Jun 26 14:07:01 2007 +++ peardoc/en/package/networking/net-ldap/fetching.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.networking.net-ldap.fetching"> <refnamediv> <refname>Fetching entries</refname> @@ -86,7 +86,7 @@ <row> <entry><function>sorted_as_struct</function></entry> - <entry>Like <function>as_struct</function>, this returns the entries as multidimensional array, but in this case sorted.</entry> + <entry>Like <function>as_struct</function>, this returns the entries as multidimensional array, but in this case sorted. For parameters, see <function>sorted</function></entry> </row> <row> @@ -130,8 +130,8 @@ <example> <title>Fetching all entries from searchresult: sorted</title> <programlisting role="php"><![CDATA[ -// return sorted by first 'sn' then 'gn': -$entry = $search->sorted(array('sn', 'gn'))); +// return sorted by first 'sn' then 'gn', but descending: +$entry = $search->sorted(array('sn', 'gn'), SORT_DESC)); ]]></programlisting> </example> @@ -142,7 +142,7 @@ while ( $entry = $search->shiftEntry() ) { // do something, like printing the DN of the entry; // in a real case, dont forget to test for errors! - echo "ENTRY: " . $entry->dn() . "; + echo "ENTRY: " . $entry->dn(); } ]]></programlisting> </example> http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/entries.xml?view=markup&rev=1.1 Index: peardoc/en/package/networking/net-ldap/entries.xml +++ peardoc/en/package/networking/net-ldap/entries.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.networking.net-ldap.entries"> <refnamediv> <refname>Managing entries</refname> <refpurpose>Renaming/moving/deleting entries</refpurpose> </refnamediv> <refsect1> <title>Adding (fresh or old) entries to the directory</title> <para> Adding new entries is performed in two ways. First, you need to establish a fresh <classname>Net_LDAP_Entry</classname> object. After that, you can add that entry like you would add already-existent entries using <classname>Net_LDAP</classname>'s <function>add</function> method. </para> <example> <title>Adding a fresh entry</title> <programlisting role="php"><![CDATA[ // Build a new fresh entry: $dn = 'cn=new-admin,o=example,dc=org'; $attributes = array( 'cn' => 'new-admin', 'mail' => array('new-admin@exaple.org', 'n.admin@example.de'), 'telephoneNumber' => '1234567890' ); $entry = Net_LDAP_Entry::createFresh(); // Add the entry to the directory: $ldap->add($entry); ]]></programlisting> </example> </refsect1> <refsect1> <title>Renaming or moving entries</title> <para> Renaming and/or moving an entry is an operation on the DN of an entry. Moving an entry means, to rename a DN in such a way, that the entry becomes a new base-DN. You can rename or move an entry, if you call the <function>dn</function> method of the entry you want to relocate. Alternatively, you may call <classname>Net_LDAP</classname>'s <function>move</function> method that also ca handle only DNs. Remember that you must call the entires <function>update</function> method to carry out the move/rename. <classname>Net_LDAP</classname>'s <function>move</function> will move the entry immediately. If you use an entryobject togehter with <classname>Net_LDAP</classname>'s <function>move</function>, you are able to perform cross directory moves. <example> <title>Moving an entry using Net_LDAP_Entry</title> <programlisting role="php"><![CDATA[ // Defining the DN we want to fetch; $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin,o=new-example,dc=org'; $entry = $ldap->getEntry($dn); $entry->dn($newdn); ]]></programlisting> </example> <example> <title>Moving an entry using Net_LDAP and Net_LDAP_Entry</title> <programlisting role="php"><![CDATA[ // Defining the DN we want to fetch; $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin,o=new-example,dc=org'; $entry = $ldap->getEntry($dn); $ldap->move($entry, $newdn); ]]></programlisting> </example> <example> <title>Renaming an entry using Net_LDAP and DNs</title> <programlisting role="php"><![CDATA[ // Defining the DN we want to fetch; $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin2,o=new-example,dc=org'; $ldap->move($dn, $newdn); ]]></programlisting> </example> <example> <title>Performing a cross directory move</title> <programlisting role="php"><![CDATA[ // $ldap_src is the source ldap and $ldap_tgt the target $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin,o=new-example,dc=org'; $entry = $ldap_src->getEntry($dn); $ldap_src->move($entry, $newdn, &$ldap_tgt); ]]></programlisting> </example> </refsect1> <refsect1> <title>Deleting entries</title> <para> Deleting entries is performed using <classname>Net_LDAP</classname>'s <function>delete</function> method. Just pass the <classname>Net_LDAP_Entry</classname> object or the DN of the entry you want to delete. In the case that the DN contains subentrys, you need to pass <literal>TRUE</literal> as second parameter which will make <function>delete</function> delete recursive. </para> <para> A second way exist: You may simply call <function>delete</function> from the <classname>Net_LDAP_Entry</classname> you want to delete. Don't forget that you must call <function>update</function> to carry out the delete in this case. </para> <example> <title>Deleting an entry</title> <programlisting role="php"><![CDATA[ $dn = 'cn=new-admin,o=example,dc=org'; $ldap->delete($dn); ]]></programlisting> </example> <example> <title>Deleting an entry using a Net_LDAP_Entry object</title> <programlisting role="php"><![CDATA[ $entry->delete(); $entry->update(); ]]></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 -->
http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap.xml?r1=1.6&r2=1.7&diff_format=u Index: peardoc/en/package/networking/net-ldap.xml diff -u peardoc/en/package/networking/net-ldap.xml:1.6 peardoc/en/package/networking/net-ldap.xml:1.7 --- peardoc/en/package/networking/net-ldap.xml:1.6 Tue Jun 26 08:58:03 2007 +++ peardoc/en/package/networking/net-ldap.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.6 $ --> +<!-- $Revision: 1.7 $ --> <sect1 id="package.networking.net-ldap"> <title>Net_LDAP</title> @@ -17,6 +17,7 @@ &package.networking.net-ldap.search; &package.networking.net-ldap.fetching; &package.networking.net-ldap.attributes; + &package.networking.net-ldap.entries; </sect1> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/attributes.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/networking/net-ldap/attributes.xml diff -u peardoc/en/package/networking/net-ldap/attributes.xml:1.2 peardoc/en/package/networking/net-ldap/attributes.xml:1.3 --- peardoc/en/package/networking/net-ldap/attributes.xml:1.2 Tue Jun 26 14:07:01 2007 +++ peardoc/en/package/networking/net-ldap/attributes.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.networking.net-ldap.attributes"> <refnamediv> <refname>Attributes</refname> @@ -10,7 +10,7 @@ <title>Reading attributes</title> <para> - Reading attribute values depends on the selection of those attributes at search time. + Reading attribute values depends on the selection of those attributes at search time. You can only access attributes that where selected! You can read attribute values using either <classname>Net_LDAP_Entry</classname>'s <function>getValues</function> or <function>getValue</function> method. <function>getValue</function> will return an array where the keys are the attributes names. If you use <function>getValues</function> you may pass an option: http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/errorhandling.xml?r1=1.1&r2=1.2&diff_format=u Index: peardoc/en/package/networking/net-ldap/errorhandling.xml diff -u peardoc/en/package/networking/net-ldap/errorhandling.xml:1.1 peardoc/en/package/networking/net-ldap/errorhandling.xml:1.2 --- peardoc/en/package/networking/net-ldap/errorhandling.xml:1.1 Mon Jun 25 06:27:06 2007 +++ peardoc/en/package/networking/net-ldap/errorhandling.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.1 $ --> +<!-- $Revision: 1.2 $ --> <refentry id="package.networking.net-ldap.errorhandling"> <refnamediv> <refname>Errorhandling</refname> @@ -10,9 +10,9 @@ <title>Errorhandling</title> <para> - Most of Net_LDAPs methods return a <classname>Net_LDAP_Error</classname>-object if something went wrong. - You always should check for errors if you perform an action to be sure that your - application doesn't things you dont want it to do. + Nearly all of Net_LDAPs methods return a <classname>Net_LDAP_Error</classname>-object if something went wrong. + You always should check for errors after you performed an action to be sure that your + application doesn't do things you don't want it to do. </para> <para> @@ -33,14 +33,14 @@ // Perform an arbitrary action: $result = $ldap->search($searchbase, $filter, $options); -// Check, if an error occured and halt script execution. +// Check, if an error occured and do something. // Here we use die() to show the message of the error. if (PEAR::isError($result)) { die($result->getMessage()); } ]]></programlisting> </example> - + <table> <title>Error codes Net_LDAP</title> <tgroup cols="2"> http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/fetching.xml?r1=1.2&r2=1.3&diff_format=u Index: peardoc/en/package/networking/net-ldap/fetching.xml diff -u peardoc/en/package/networking/net-ldap/fetching.xml:1.2 peardoc/en/package/networking/net-ldap/fetching.xml:1.3 --- peardoc/en/package/networking/net-ldap/fetching.xml:1.2 Tue Jun 26 14:07:01 2007 +++ peardoc/en/package/networking/net-ldap/fetching.xml Thu Jun 28 07:58:29 2007 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" ?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <refentry id="package.networking.net-ldap.fetching"> <refnamediv> <refname>Fetching entries</refname> @@ -86,7 +86,7 @@ <row> <entry><function>sorted_as_struct</function></entry> - <entry>Like <function>as_struct</function>, this returns the entries as multidimensional array, but in this case sorted.</entry> + <entry>Like <function>as_struct</function>, this returns the entries as multidimensional array, but in this case sorted. For parameters, see <function>sorted</function></entry> </row> <row> @@ -130,8 +130,8 @@ <example> <title>Fetching all entries from searchresult: sorted</title> <programlisting role="php"><![CDATA[ -// return sorted by first 'sn' then 'gn': -$entry = $search->sorted(array('sn', 'gn'))); +// return sorted by first 'sn' then 'gn', but descending: +$entry = $search->sorted(array('sn', 'gn'), SORT_DESC)); ]]></programlisting> </example> @@ -142,7 +142,7 @@ while ( $entry = $search->shiftEntry() ) { // do something, like printing the DN of the entry; // in a real case, dont forget to test for errors! - echo "ENTRY: " . $entry->dn() . "; + echo "ENTRY: " . $entry->dn(); } ]]></programlisting> </example> http://cvs.php.net/viewvc.cgi/peardoc/en/package/networking/net-ldap/entries.xml?view=markup&rev=1.1 Index: peardoc/en/package/networking/net-ldap/entries.xml +++ peardoc/en/package/networking/net-ldap/entries.xml <?xml version="1.0" encoding="utf-8" ?> <!-- $Revision: 1.1 $ --> <refentry id="package.networking.net-ldap.entries"> <refnamediv> <refname>Managing entries</refname> <refpurpose>Renaming/moving/deleting entries</refpurpose> </refnamediv> <refsect1> <title>Adding (fresh or old) entries to the directory</title> <para> Adding new entries is performed in two ways. First, you need to establish a fresh <classname>Net_LDAP_Entry</classname> object. After that, you can add that entry like you would add already-existent entries using <classname>Net_LDAP</classname>'s <function>add</function> method. </para> <example> <title>Adding a fresh entry</title> <programlisting role="php"><![CDATA[ // Build a new fresh entry: $dn = 'cn=new-admin,o=example,dc=org'; $attributes = array( 'cn' => 'new-admin', 'mail' => array('new-admin@exaple.org', 'n.admin@example.de'), 'telephoneNumber' => '1234567890' ); $entry = Net_LDAP_Entry::createFresh(); // Add the entry to the directory: $ldap->add($entry); ]]></programlisting> </example> </refsect1> <refsect1> <title>Renaming or moving entries</title> <para> Renaming and/or moving an entry is an operation on the DN of an entry. Moving an entry means, to rename a DN in such a way, that the entry becomes a new base-DN. You can rename or move an entry, if you call the <function>dn</function> method of the entry you want to relocate. Alternatively, you may call <classname>Net_LDAP</classname>'s <function>move</function> method that also ca handle only DNs. Remember that you must call the entires <function>update</function> method to carry out the move/rename. <classname>Net_LDAP</classname>'s <function>move</function> will move the entry immediately. If you use an entryobject togehter with <classname>Net_LDAP</classname>'s <function>move</function>, you are able to perform cross directory moves. <example> <title>Moving an entry using Net_LDAP_Entry</title> <programlisting role="php"><![CDATA[ // Defining the DN we want to fetch; $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin,o=new-example,dc=org'; $entry = $ldap->getEntry($dn); $entry->dn($newdn); ]]></programlisting> </example> <example> <title>Moving an entry using Net_LDAP and Net_LDAP_Entry</title> <programlisting role="php"><![CDATA[ // Defining the DN we want to fetch; $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin,o=new-example,dc=org'; $entry = $ldap->getEntry($dn); $ldap->move($entry, $newdn); ]]></programlisting> </example> <example> <title>Renaming an entry using Net_LDAP and DNs</title> <programlisting role="php"><![CDATA[ // Defining the DN we want to fetch; $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin2,o=new-example,dc=org'; $ldap->move($dn, $newdn); ]]></programlisting> </example> <example> <title>Performing a cross directory move</title> <programlisting role="php"><![CDATA[ // $ldap_src is the source ldap and $ldap_tgt the target $dn = 'cn=admin,o=example,dc=org'; $newdn = 'cn=admin,o=new-example,dc=org'; $entry = $ldap_src->getEntry($dn); $ldap_src->move($entry, $newdn, &$ldap_tgt); ]]></programlisting> </example> </refsect1> <refsect1> <title>Deleting entries</title> <para> Deleting entries is performed using <classname>Net_LDAP</classname>'s <function>delete</function> method. Just pass the <classname>Net_LDAP_Entry</classname> object or the DN of the entry you want to delete. In the case that the DN contains subentrys, you need to pass <literal>TRUE</literal> as second parameter which will make <function>delete</function> delete recursive. </para> <para> A second way exist: You may simply call <function>delete</function> from the <classname>Net_LDAP_Entry</classname> you want to delete. Don't forget that you must call <function>update</function> to carry out the delete in this case. </para> <example> <title>Deleting an entry</title> <programlisting role="php"><![CDATA[ $dn = 'cn=new-admin,o=example,dc=org'; $ldap->delete($dn); ]]></programlisting> </example> <example> <title>Deleting an entry using a Net_LDAP_Entry object</title> <programlisting role="php"><![CDATA[ $entry->delete(); $entry->update(); ]]></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 -->