<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.imap.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.imap-get-quota.php',
    1 => 'imap_get_quota',
    2 => 'Liefert Quota-Einstellungen und Nutzungsstatistik der Postf&auml;cher',
  ),
  'up' => 
  array (
    0 => 'ref.imap.php',
    1 => 'IMAP Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.imap-gc.php',
    1 => 'imap_gc',
  ),
  'next' => 
  array (
    0 => 'function.imap-get-quotaroot.php',
    1 => 'imap_get_quotaroot',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/imap/functions/imap-get-quota.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.imap-get-quota" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">imap_get_quota</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.0.5, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">imap_get_quota</span> &mdash; <span class="dc-title">Liefert Quota-Einstellungen und Nutzungsstatistik der Postfächer</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.imap-get-quota-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>imap_get_quota</strong></span>(<span class="methodparam"><span class="type"><a href="class.imap-connection.php" class="type IMAP\Connection">IMAP\Connection</a></span> <code class="parameter">$imap</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$quota_root</code></span>): <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.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>imap_get_quota()</strong></span> ermittelt die aktuellen
   Quota-Einstellungen und tatsächlich genutzten Ressourcen für Postfächer.
  </p>
  <p class="para">
   Für die Ausführung dieser Funktion ist ein IMAP-Benutzer mit
   Administrationsrechten erforderlich, eine nichtadministrative Variante der
   Funktion ist <span class="function"><a href="function.imap-get-quotaroot.php" class="function">imap_get_quotaroot()</a></span>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.imap-get-quota-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    <dt>
<code class="parameter">imap</code></dt><dd><p class="para">Eine <span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>-Instanz.</p></dd>
    
     <dt><code class="parameter">quota_root</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">quota_root</code> sollte normalerweise in der Form
       <code class="literal">user.name</code> angegeben werden. name ist dabei der Name
       des Postfachs, für das Informationen geliefert werden sollen.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.imap-get-quota-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt ein Array mit den zwei Integer-Elementen limit und usage zurück, die
   den insgesamt verfügbaren und den zur Zeit vom Postfach genutzten
   Speicherplatz angeben. Im Fehlerfall wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
  <p class="para">
   Ab PHP 4.3 hält sich die Funktion genauer an die Vorgaben aus
   <a href="https://datatracker.ietf.org/doc/html/rfc2087" class="link external">&raquo;&nbsp;RFC2087</a>. Das Ergebnisarray
   unterstützt nun eine unbegrenzte Anzahl von Ressourcenwerten (d. h. der
   Nachrichten oder Unterordner). Für jede Ressource wird ein Arrayelement mit
   dem Namen der Ressource als Key angelegt, die einzelnen Arrayelemente sind
   wiederum Arrays mit Angaben zu Limit und Nutzung.
  </p>
  <p class="para">
   Aus Gründen der Rückwärtskompatibilität werden außerdem weiterhin die
   beiden ursprünglichen Arrayelemente limit und usage zurückgegeben, ihre
   weitere Nutzung wird allerdings nicht empfohlen.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.imap-get-quota-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.1.0</td>
 <td>
  Der Parameter <code class="parameter">imap</code> erwartet nun eine
  <span class="classname"><a href="class.imap-connection.php" class="classname">IMAP\Connection</a></span>-Instanz; vorher wurde eine gültige
  <code class="literal">imap</code>-<a href="language.types.resource.php" class="link">Ressource</a> erwartet.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.imap-get-quota-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>imap_get_quota()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$mbox </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org}"</span><span style="color: #007700">, </span><span style="color: #DD0000">"mailadmin"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password"</span><span style="color: #007700">, </span><span style="color: #0000BB">OP_HALFOPEN</span><span style="color: #007700">)<br />      or die(</span><span style="color: #DD0000">"Kann keine Verbindung aufbauen: " </span><span style="color: #007700">. </span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$quota_value </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_get_quota</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">, </span><span style="color: #DD0000">"user.kalowsky"</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$quota_value</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"Aktuell genutzt: " </span><span style="color: #007700">. </span><span style="color: #0000BB">$quota_value</span><span style="color: #007700">[</span><span style="color: #DD0000">'usage'</span><span style="color: #007700">];<br />    echo </span><span style="color: #DD0000">"Verfügbar (Limit): " </span><span style="color: #007700">. </span><span style="color: #0000BB">$quota_value</span><span style="color: #007700">[</span><span style="color: #DD0000">'limit'</span><span style="color: #007700">];<br />}<br /><br /></span><span style="color: #0000BB">imap_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 Beispiel für <span class="function"><strong>imap_get_quota()</strong></span> ab 4.3 und aufwärts</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$mbox </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_open</span><span style="color: #007700">(</span><span style="color: #DD0000">"{imap.example.org}"</span><span style="color: #007700">, </span><span style="color: #DD0000">"mailadmin"</span><span style="color: #007700">, </span><span style="color: #DD0000">"password"</span><span style="color: #007700">, </span><span style="color: #0000BB">OP_HALFOPEN</span><span style="color: #007700">)<br />      or die(</span><span style="color: #DD0000">"Kann keine Verbindung aufbauen: " </span><span style="color: #007700">. </span><span style="color: #0000BB">imap_last_error</span><span style="color: #007700">());<br /><br /></span><span style="color: #0000BB">$quota_values </span><span style="color: #007700">= </span><span style="color: #0000BB">imap_get_quota</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">, </span><span style="color: #DD0000">"user.kalowsky"</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$quota_values</span><span style="color: #007700">)) {<br />   </span><span style="color: #0000BB">$storage </span><span style="color: #007700">= </span><span style="color: #0000BB">$quota_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'STORAGE'</span><span style="color: #007700">];<br />   echo </span><span style="color: #DD0000">"Speicherplatz (aktuell genutzt): " </span><span style="color: #007700">.  </span><span style="color: #0000BB">$storage</span><span style="color: #007700">[</span><span style="color: #DD0000">'usage'</span><span style="color: #007700">];<br />   echo </span><span style="color: #DD0000">"Speicherplatz (Limit): " </span><span style="color: #007700">.  </span><span style="color: #0000BB">$storage</span><span style="color: #007700">[</span><span style="color: #DD0000">'limit'</span><span style="color: #007700">];<br /><br />   </span><span style="color: #0000BB">$message </span><span style="color: #007700">= </span><span style="color: #0000BB">$quota_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'MESSAGE'</span><span style="color: #007700">];<br />   echo </span><span style="color: #DD0000">"Anzahl Nachrichten (aktuell): " </span><span style="color: #007700">.  </span><span style="color: #0000BB">$message</span><span style="color: #007700">[</span><span style="color: #DD0000">'usage'</span><span style="color: #007700">];<br />   echo </span><span style="color: #DD0000">"Anzahl Nachrichten (Limit): " </span><span style="color: #007700">.  </span><span style="color: #0000BB">$message</span><span style="color: #007700">[</span><span style="color: #DD0000">'limit'</span><span style="color: #007700">];<br /><br />   </span><span style="color: #FF8000">/* ...  */<br /></span><span style="color: #007700">}<br /><br /></span><span style="color: #0000BB">imap_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$mbox</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

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


 <div class="refsect1 notes" id="refsect1-function.imap-get-quota-notes">
  <h3 class="title">Anmerkungen</h3>
  <p class="para">
   Diese Funktion ist aktuell erst ab der Bibliotheksversion c-client2000
   verfügbar.
  </p>
  <p class="para">
   Der angegebene <code class="parameter">imap</code> muss als Mail-Administrator
   geöffnet werden, sonst schlägt diese Funktion fehl.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.imap-get-quota-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.imap-open.php" class="function" rel="rdfs-seeAlso">imap_open()</a> - &Ouml;ffnet einen IMAP-Stream zu einem Postfach</span></li>
    <li><span class="function"><a href="function.imap-set-quota.php" class="function" rel="rdfs-seeAlso">imap_set_quota()</a> - Legt die Gr&ouml;&szlig;enbeschr&auml;nkung f&uuml;r ein Postfach fest</span></li>
    <li><span class="function"><a href="function.imap-get-quotaroot.php" class="function" rel="rdfs-seeAlso">imap_get_quotaroot()</a> - Liefert die Quota-Einstellungen f&uuml;r ein Benutzerpostfach</span></li>
   </ul>
  </p>
 </div>


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