<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ibase.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.ibase-service-detach.php',
    1 => 'ibase_service_detach',
    2 => 'D&eacute;connexion du gestionnaire de service',
  ),
  'up' => 
  array (
    0 => 'ref.ibase.php',
    1 => 'Fonctions Firebird/InterBase',
  ),
  'prev' => 
  array (
    0 => 'function.ibase-service-attach.php',
    1 => 'ibase_service_attach',
  ),
  'next' => 
  array (
    0 => 'function.ibase-set-event-handler.php',
    1 => 'ibase_set_event_handler',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/ibase/functions/ibase-service-detach.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ibase-service-detach" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ibase_service_detach</h1>
  <p class="verinfo">(PHP 5, PHP 7 &lt; 7.4.0)</p><p class="refpurpose"><span class="refname">ibase_service_detach</span> &mdash; <span class="dc-title">Déconnexion du gestionnaire de service</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ibase-service-detach-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ibase_service_detach</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$service_handle</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.ibase-service-detach-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
    <dt><code class="parameter">service_handle</code></dt>
    <dd>
     <span class="simpara">
      Une connexion au serveur de base de données créée précédemment.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ibase-service-detach-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="simpara">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ibase-service-detach-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple avec <span class="function"><strong>ibase_service_detach()</strong></span></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">// S'attacher au serveur Firebird distant par une adresse ip<br />    </span><span style="color: #007700">if ((</span><span style="color: #0000BB">$service </span><span style="color: #007700">= </span><span style="color: #0000BB">ibase_service_attach</span><span style="color: #007700">(</span><span style="color: #DD0000">'10.1.1.199'</span><span style="color: #007700">, </span><span style="color: #DD0000">'sysdba'</span><span style="color: #007700">, </span><span style="color: #DD0000">'masterkey'</span><span style="color: #007700">)) != </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">) {<br /><br />        </span><span style="color: #FF8000">// Attaché avec succès.<br />        // Récupérer la version du serveur (qqch comme 'LI-V3.0.4.33054 Firebird 3.0')<br />        </span><span style="color: #0000BB">$server_version  </span><span style="color: #007700">= </span><span style="color: #0000BB">ibase_server_info</span><span style="color: #007700">(</span><span style="color: #0000BB">$service</span><span style="color: #007700">, </span><span style="color: #0000BB">IBASE_SVC_SERVER_VERSION</span><span style="color: #007700">);<br /><br />        </span><span style="color: #FF8000">// Récupérer l'implémentation serveur (qqch comme 'Firebird/Linux/AMD/Intel/x64')<br />        </span><span style="color: #0000BB">$server_implementation </span><span style="color: #007700">= </span><span style="color: #0000BB">ibase_server_info</span><span style="color: #007700">(</span><span style="color: #0000BB">$service</span><span style="color: #007700">, </span><span style="color: #0000BB">IBASE_SVC_IMPLEMENTATION</span><span style="color: #007700">);<br /><br />        </span><span style="color: #FF8000">// Se détacher du serveur (déconnexion)<br />        </span><span style="color: #007700">if(</span><span style="color: #0000BB">ibase_service_detach</span><span style="color: #007700">(</span><span style="color: #0000BB">$service</span><span style="color: #007700">) == </span><span style="color: #0000BB">FALSE</span><span style="color: #007700">) {<br />            echo </span><span style="color: #DD0000">"Erreur lors de la déconnexion du service."</span><span style="color: #007700">;<br />        }<br />        else {<br />            echo </span><span style="color: #DD0000">"Déconnexion du service réussie."</span><span style="color: #007700">;<br />        }<br /><br />    }<br />    else {<br />        </span><span style="color: #FF8000">// Afficher un message en cas d'erreur<br />        </span><span style="color: #0000BB">$conn_error </span><span style="color: #007700">= </span><span style="color: #0000BB">ibase_errmsg</span><span style="color: #007700">();<br />        die(</span><span style="color: #0000BB">$conn_error</span><span style="color: #007700">);<br />    }<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>

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