<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.dba.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.dba-popen.php',
    1 => 'dba_popen',
    2 => '&Ouml;ffnet eine persistente Datenbank-Verbindung',
  ),
  'up' => 
  array (
    0 => 'ref.dba.php',
    1 => 'DBA-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.dba-optimize.php',
    1 => 'dba_optimize',
  ),
  'next' => 
  array (
    0 => 'function.dba-replace.php',
    1 => 'dba_replace',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/dba/functions/dba-popen.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.dba-popen" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">dba_popen</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">dba_popen</span> &mdash; <span class="dc-title">Öffnet eine persistente Datenbank-Verbindung</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.dba-popen-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>dba_popen</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$path</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$mode</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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="language.types.string.php" class="type string">string</a></span></span> <code class="parameter">$handler</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$permission</code><span class="initializer"> = 0644</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$map_size</code><span class="initializer"> = 0</span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$flags</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><span class="type"><a href="class.dba-connection.php" class="type Dba\Connection">Dba\Connection</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="simpara">
   <span class="function"><strong>dba_popen()</strong></span> stellt eine persistente Datenbankinstanz für
   <code class="parameter">path</code> mit <code class="parameter">mode</code> her und benutzt
   dabei den Handler <code class="parameter">handler</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.dba-popen-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <dl>
   
    <dt><code class="parameter">path</code></dt>
    <dd>
     <span class="simpara">
      Ein gültiger Pfad im Dateisystem.
     </span>
    </dd>
   
   
    <dt><code class="parameter">mode</code></dt>
    <dd>
     <span class="simpara">
      Das ist <code class="literal">r</code> für lesenden Zugriff, <code class="literal">w</code>
      für lesenden und schreibenden Zugriff auf eine existierende Datenbank,
      <code class="literal">c</code> für lesenden und schreibenden Zugriff und
      Erstellen der Datenbank, falls sie noch nicht existiert, und
      <code class="literal">n</code> für das Erstellen einer Datenbank, bzw. deren
      Zurücksetzen auf die Größe 0, falls sie schon existiert, und lesenden
      und schreibenden Zugriff.
     </span>
    </dd>
   
   
    <dt><code class="parameter">handler</code></dt>
    <dd>
     <span class="simpara">
      Der Name des <a href="dba.requirements.php" class="link">Handler</a>s, der für
      den Zugriff auf <code class="parameter">path</code> benutzt werden soll. Er
      bekommt alle optionalen Argumente übergeben, die der Funktion
      <span class="function"><strong>dba_popen()</strong></span> mitgegeben wurden, und kann damit in
      deren Name verfahren. Wenn <code class="parameter">handler</code> <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> ist,
      wird der Standard-Handler aufgerufen.
     </span>
    </dd>
   
   
    <dt><code class="parameter">permission</code></dt>
    <dd>
     <span class="simpara">
      Ein optionaler <a href="language.types.integer.php" class="link">Integer</a>-Parameter, der an den Treiber übergeben wird.
      Er hat dieselbe Bedeutung wie der Parameter
      <code class="literal">permissions</code> bei <span class="function"><a href="function.chmod.php" class="function">chmod()</a></span>. Der
      Standardwert ist <code class="literal">0644</code>.
     </span>
     <span class="simpara">
      Der Parameter <code class="parameter">permission</code> wird vom
      <code class="literal">db1</code>-, <code class="literal">db2</code>-,
      <code class="literal">db3</code>-, <code class="literal">db4</code>-,
      <code class="literal">dbm</code>-, <code class="literal">gdbm</code>-,
      <code class="literal">ndbm</code>- und <code class="literal">lmdb</code>-Treiber
      unterstützt.
     </span>
    </dd>
   
   
    <dt><code class="parameter">map_size</code></dt>
    <dd>
     <span class="simpara">
      Ein optionaler <a href="language.types.integer.php" class="link">Integer</a>-Parameter, der an den Treiber übergeben wird.
      Sein Wert sollte ein Vielfaches der Größe einer Speicherseite (Page
      Size) des Betriebssystems sein. Wenn Null angegeben wird, wird die
      Standard-Map-Size verwendet.
     </span>
     <span class="simpara">
      Der Parameter <code class="parameter">map_size</code> wird nur vom
      <code class="literal">lmdb</code>-Treiber akzeptiert.
     </span>
    </dd>
   
   
    <dt><code class="parameter">flags</code></dt>
    <dd>
     <span class="simpara">
      Die Flags, die an den Datenbanktreiber übergeben werden. Derzeit
      unterstützt nur der LMDB-Treiber die Flags
      <strong><code><a href="dba.constants.php#constant.dba-lmdb-use-sub-dir">DBA_LMDB_USE_SUB_DIR</a></code></strong> und
      <strong><code><a href="dba.constants.php#constant.dba-lmdb-no-sub-dir">DBA_LMDB_NO_SUB_DIR</a></code></strong>.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.dba-popen-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="simpara">
   Gibt bei Erfolg eine Instanz von <span class="classname"><a href="class.dba-connection.php" class="classname">Dba\Connection</a></span>
   zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.dba-popen-errors">
  <h3 class="title">Fehler/Exceptions</h3>
  <p class="simpara">
   Wenn <code class="parameter">handler</code> <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> ist, aber kein Standard-Handler
   zur Verfügung steht, wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben und ein Fehler der Stufe
   <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> ausgegeben.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.dba-popen-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Beschreibung</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.4.0</td>
      <td>
       Gibt nun eine Instanz von <span class="classname"><a href="class.dba-connection.php" class="classname">Dba\Connection</a></span> zurück;
       zuvor wurde eine <a href="language.types.resource.php" class="link">Ressource</a> zurückgegeben.
      </td>
     </tr>

     <tr>
      <td>8.2.0</td>
      <td>
       Der Parameter <code class="parameter">flags</code> wurde hinzugefügt.
      </td>
     </tr>

     <tr>
      <td>8.1.0</td>
      <td>
       Der Parameter <code class="parameter">handler</code> ist nun nullable
       (akzeptiert den <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>-Wert).
      </td>
     </tr>

     <tr>
      <td>7.3.14, 7.4.2</td>
      <td>
       Der <code class="literal">lmdb</code>-Treiber unterstützt nun zusätzlich den
       Parmeter <code class="parameter">map_size</code>.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.dba-popen-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.dba-open.php" class="function" rel="rdfs-seeAlso">dba_open()</a> - &Ouml;ffnet eine Datenbank</span></li>
   <li><span class="function"><a href="function.dba-close.php" class="function" rel="rdfs-seeAlso">dba_close()</a> - Schlie&szlig;t eine DBA-Datenbank</span></li>
  </ul>
 </div>


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