<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ldap.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'function.ldap-get-option.php',
    1 => 'ldap_get_option',
    2 => 'Obt&eacute;m o valor atual para a op&ccedil;&atilde;o informada',
  ),
  'up' => 
  array (
    0 => 'ref.ldap.php',
    1 => 'Fun&ccedil;&otilde;es do LDAP',
  ),
  'prev' => 
  array (
    0 => 'function.ldap-get-entries.php',
    1 => 'ldap_get_entries',
  ),
  'next' => 
  array (
    0 => 'function.ldap-get-values.php',
    1 => 'ldap_get_values',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'pt_BR',
    'path' => 'reference/ldap/functions/ldap-get-option.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ldap-get-option" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_get_option</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ldap_get_option</span> &mdash; <span class="dc-title">Obtém o valor atual para a opção informada</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ldap-get-option-description">
  <h3 class="title">Descrição</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_get_option</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="class.ldap-connection.php" class="type LDAP\Connection">LDAP\Connection</a></span></span> <code class="parameter">$ldap</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$option</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter reference">&$value</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Obtém o valor da opção especificada e armazena em <code class="parameter">value</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-get-option-parameters">
  <h3 class="title">Parâmetros</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">ldap</code></dt>
     <dd>
      <p class="para">
       Uma instância de <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span> retornada por
       <span class="function"><a href="function.ldap-connect.php" class="function">ldap_connect()</a></span>, para obter a opção para essa conexão,
       ou <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> para obter a opção global.
      </p>
     </dd>
    
    
     <dt><code class="parameter">option</code></dt>
     <dd>
      <p class="para">
       O parâmetro <code class="parameter">option</code> pode ser um destes valores:
       <table class="doctable informaltable">
        
         <thead>
          <tr>
           <th>Opção</th>
           <th>Tipo</th>
           <th>desde</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-deref">LDAP_OPT_DEREF</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-sizelimit">LDAP_OPT_SIZELIMIT</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-timelimit">LDAP_OPT_TIMELIMIT</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-network-timeout">LDAP_OPT_NETWORK_TIMEOUT</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-protocol-version">LDAP_OPT_PROTOCOL_VERSION</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-error-number">LDAP_OPT_ERROR_NUMBER</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-diagnostic-message">LDAP_OPT_DIAGNOSTIC_MESSAGE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-referrals">LDAP_OPT_REFERRALS</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-restart">LDAP_OPT_RESTART</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-host-name">LDAP_OPT_HOST_NAME</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-error-string">LDAP_OPT_ERROR_STRING</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-matched-dn">LDAP_OPT_MATCHED_DN</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-server-controls">LDAP_OPT_SERVER_CONTROLS</a></code></strong></td>
           <td><span class="type"><a href="language.types.array.php" class="type array">array</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-client-controls">LDAP_OPT_CLIENT_CONTROLS</a></code></strong></td>
           <td><span class="type"><a href="language.types.array.php" class="type array">array</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-keepalive-idle">LDAP_OPT_X_KEEPALIVE_IDLE</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-keepalive-probes">LDAP_OPT_X_KEEPALIVE_PROBES</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-keepalive-interval">LDAP_OPT_X_KEEPALIVE_INTERVAL</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-cacertdir">LDAP_OPT_X_TLS_CACERTDIR</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-cacertfile">LDAP_OPT_X_TLS_CACERTFILE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-certfile">LDAP_OPT_X_TLS_CERTFILE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-cipher-suite">LDAP_OPT_X_TLS_CIPHER_SUITE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-crlcheck">LDAP_OPT_X_TLS_CRLCHECK</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-crl-none">LDAP_OPT_X_TLS_CRL_NONE</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-crl-peer">LDAP_OPT_X_TLS_CRL_PEER</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-crl-all">LDAP_OPT_X_TLS_CRL_ALL</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-crlfile">LDAP_OPT_X_TLS_CRLFILE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-dhfile">LDAP_OPT_X_TLS_DHFILE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-keyfile">LDAP_OPT_X_TLS_KEYFILE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-package">LDAP_OPT_X_TLS_PACKAGE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-protocol-min">LDAP_OPT_X_TLS_PROTOCOL_MIN</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-random-file">LDAP_OPT_X_TLS_RANDOM_FILE</a></code></strong></td>
           <td><span class="type"><a href="language.types.string.php" class="type string">string</a></span></td>
           <td>7.1</td>
          </tr>

          <tr>
           <td><strong><code><a href="ldap.constants.php#constant.ldap-opt-x-tls-require-cert">LDAP_OPT_X_TLS_REQUIRE_CERT</a></code></strong></td>
           <td><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></td>
           <td class="empty">&nbsp;</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">value</code></dt>
     <dd>
      <p class="para">
       Esta variável po referência irá armazenar o valor da opção informada.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-get-option-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="para">
   Retorna <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> em caso de sucesso ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> em caso de falha.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ldap-get-option-changelog">
  <h3 class="title">Registro de Alterações</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Versão</th>
      <th>Descrição</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.5.0</td>
      <td>
       <code class="parameter">ldap</code> agora pode ser nulo.
      </td>
     </tr>

     <tr>
 <td>8.1.0</td>
 <td>
  O parâmetro <code class="parameter">ldap</code> agora espera uma instância de <span class="classname"><a href="class.ldap-connection.php" class="classname">LDAP\Connection</a></span>;
  anteriormente, um <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="literal">ldap link</code> válido era esperado.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.ldap-get-option-examples">
  <h3 class="title">Exemplos</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemplo #1 Verifica a versão do protocolo</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// $ds é uma instância válida de LDAP\Connection para um servidor de diretório<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">ldap_get_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$ds</span><span style="color: #007700">, </span><span style="color: #0000BB">LDAP_OPT_PROTOCOL_VERSION</span><span style="color: #007700">, </span><span style="color: #0000BB">$version</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"Usando protocolo versão </span><span style="color: #0000BB">$version</span><span style="color: #DD0000">\n"</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #DD0000">"Não foi possível determinar a versão do protocolo\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.ldap-get-option-notes">
  <h3 class="title">Notas</h3>
  <blockquote class="note"><p><strong class="note">Nota</strong>: 
   <p class="para">
    Esta função está disponível somente ao usar OpenLDAP 2.x.x OU Netscape
    Directory SDK x.x.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ldap-get-option-seealso">
  <h3 class="title">Veja Também</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.ldap-set-option.php" class="function" rel="rdfs-seeAlso">ldap_set_option()</a> - Define o valor para a op&ccedil;&atilde;o informada</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>