function.ldap-read.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 285 行
HTML
285 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Read an entry</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ldap-parse-result.html">ldap_parse_result</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ldap-rename.html">ldap_rename</a></div> <div class="up"><a href="ref.ldap.html">LDAP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.ldap-read" class="refentry"> <div class="refnamediv"> <h1 class="refname">ldap_read</h1> <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">ldap_read</span> — <span class="dc-title">Read an entry</span></p> </div> <div class="refsect1 description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><b><b>ldap_read</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$link_identifier</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$base_dn</tt></span> , <span class="methodparam"><span class="type">string</span> <tt class="parameter">$filter</tt></span> [, <span class="methodparam"><span class="type">array</span> <tt class="parameter">$attributes</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$attrsonly</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$sizelimit</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$timelimit</tt></span> [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$deref</tt></span> ]]]]] )</div> <p class="para rdfs-comment"> Performs the search for a specified <i><tt class="parameter">filter</tt></i> on the directory with the scope <b><tt>LDAP_SCOPE_BASE</tt></b>. So it is equivalent to reading an entry from the directory. </p> </div> <div class="refsect1 parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><i><tt class="parameter">link_identifier</tt></i></span> <dd> <p class="para"> An LDAP link identifier, returned by <a href="function.ldap-connect.html" class="function">ldap_connect()</a>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">base_dn</tt></i></span> <dd> <p class="para"> The base DN for the directory. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">filter</tt></i></span> <dd> <p class="para"> An empty filter is not allowed. If you want to retrieve absolutely all information for this entry, use a filter of <i>objectClass=*</i>. If you know which entry types are used on the directory server, you might use an appropriate filter such as <i>objectClass=inetOrgPerson</i>. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">attributes</tt></i></span> <dd> <p class="para"> An array of the required attributes, e.g. array("mail", "sn", "cn"). Note that the "dn" is always returned irrespective of which attributes types are requested. </p> <p class="para"> Using this parameter is much more efficient than the default action (which is to return all attributes and their associated values). The use of this parameter should therefore be considered good practice. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">attrsonly</tt></i></span> <dd> <p class="para"> Should be set to 1 if only attribute types are wanted. If set to 0 both attributes types and attribute values are fetched which is the default behaviour. </p> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">sizelimit</tt></i></span> <dd> <p class="para"> Enables you to limit the count of entries fetched. Setting this to 0 means no limit. </p> <blockquote><p><b class="note">Note</b>: This parameter can NOT override server-side preset sizelimit. You can set it lower though. <br /> Some directory server hosts will be configured to return no more than a preset number of entries. If this occurs, the server will indicate that it has only returned a partial results set. This also occurs if you use this parameter to limit the count of fetched entries. <br /> </p></blockquote> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">timelimit</tt></i></span> <dd> <p class="para"> Sets the number of seconds how long is spend on the search. Setting this to 0 means no limit. </p> <blockquote><p><b class="note">Note</b>: This parameter can NOT override server-side preset timelimit. You can set it lower though. <br /> </p></blockquote> </dd> </dt> <dt> <span class="term"><i><tt class="parameter">deref</tt></i></span> <dd> <p class="para"> Specifies how aliases should be handled during the search. It can be one of the following: <ul class="itemizedlist"> <li class="listitem"> <span class="simpara"> <b><tt>LDAP_DEREF_NEVER</tt></b> - (default) aliases are never dereferenced. </span> </li> <li class="listitem"> <span class="simpara"> <b><tt>LDAP_DEREF_SEARCHING</tt></b> - aliases should be dereferenced during the search but not when locating the base object of the search. </span> </li> <li class="listitem"> <span class="simpara"> <b><tt>LDAP_DEREF_FINDING</tt></b> - aliases should be dereferenced when locating the base object but not during the search. </span> </li> <li class="listitem"> <span class="simpara"> <b><tt>LDAP_DEREF_ALWAYS</tt></b> - aliases should be dereferenced always. </span> </li> </ul> </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns a search result identifier or <b><tt>FALSE</tt></b> on error. </p> </div> <div class="refsect1 changelog"> <h3 class="title">ChangeLog</h3> <p class="para"> <table class="informaltable"> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1">Version</th> <th colspan="1">Description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">4.0.5</td> <td colspan="1" rowspan="1" align="left"> Parallel searches support was added. See <a href="function.ldap-search.html" class="function">ldap_search()</a> for details. </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">4.0.2</td> <td colspan="1" rowspan="1" align="left"> The <i><tt class="parameter">attrsonly</tt></i>, <i><tt class="parameter">sizelimit</tt></i>, <i><tt class="parameter">timelimit</tt></i> and <i><tt class="parameter">deref</tt></i> were added. </td> </tr> </tbody> </colgroup> </table> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.ldap-parse-result.html">ldap_parse_result</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.ldap-rename.html">ldap_rename</a></div> <div class="up"><a href="ref.ldap.html">LDAP Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?