svn: /phpdoc/de/trunk/ features/commandline.xml language/basic-syntax.xml language/exceptions.xml language/oop5/cloning.xml reference/ldap/book.xml reference/ldap/examples.xml

[email protected] (Christoph Michael Becker)
Newsgroups php.doc.de
Message-ID <[email protected]>
cmb                                      Fri, 07 Dec 2018 17:48:02 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=346203

Log:
Sync with EN

This also fixes the build.

Changed paths:
    U   phpdoc/de/trunk/features/commandline.xml
    U   phpdoc/de/trunk/language/basic-syntax.xml
    U   phpdoc/de/trunk/language/exceptions.xml
    U   phpdoc/de/trunk/language/oop5/cloning.xml
    U   phpdoc/de/trunk/reference/ldap/book.xml
    U   phpdoc/de/trunk/reference/ldap/examples.xml
svn-diffs-346203.txt (text/x-diff, 9.1 KB)
Modified: phpdoc/de/trunk/features/commandline.xml
===================================================================
--- phpdoc/de/trunk/features/commandline.xml	2018-12-07 16:01:21 UTC (rev 346202)
+++ phpdoc/de/trunk/features/commandline.xml	2018-12-07 17:48:02 UTC (rev 346203)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 345240 Maintainer: nikic Status: ready -->
+<!-- EN-Revision: 346151 Maintainer: nikic Status: ready -->
 <!-- Credits: hholzgra, fa -->

 <chapter xml:id="features.commandline" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">

Modified: phpdoc/de/trunk/language/basic-syntax.xml
===================================================================
--- phpdoc/de/trunk/language/basic-syntax.xml	2018-12-07 16:01:21 UTC (rev 346202)
+++ phpdoc/de/trunk/language/basic-syntax.xml	2018-12-07 17:48:02 UTC (rev 346203)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 341083 Maintainer: cmb Status: ready -->
+<!-- EN-Revision: 346150 Maintainer: cmb Status: ready -->

  <chapter xml:id="language.basic-syntax" xmlns="http://docbook.org/ns/docbook">
   <title>Grundlagen der Syntax</title>
@@ -22,7 +22,7 @@
     <option>--enable-short-tags</option> Option konfiguriert wurde).
    </para>
    <para>
-    Ist eine Datei reiner PHP-Code, ist es besser, den schließenden PHP-Tag
+    Enthält eine Datei nur PHP-Code, ist es besser, den schließenden PHP-Tag
     am Ende der Datei wegzulassen. Das verhindert, dass versehentlich Whitespace
     oder Zeilenumbrüche nach dem schließenden PHP-Tag hinzugefügt werden,
     die unerwünschte Auswirkungen haben können, da PHP das Puffern der Ausgabe

Modified: phpdoc/de/trunk/language/exceptions.xml
===================================================================
--- phpdoc/de/trunk/language/exceptions.xml	2018-12-07 16:01:21 UTC (rev 346202)
+++ phpdoc/de/trunk/language/exceptions.xml	2018-12-07 17:48:02 UTC (rev 346203)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 344005 Maintainer: sammywg Status: ready -->
+<!-- EN-Revision: 346158 Maintainer: sammywg Status: ready -->

  <chapter xml:id="language.exceptions" xmlns="http://docbook.org/ns/docbook">
   <title>Ausnahmebehandlung (Exception-Handling)</title>
@@ -223,7 +223,7 @@

   <simplesect xml:id="language.exceptions.introduction">
    <para>
-    PHP 5 hat ein Exceptionmodell ähnlich dem anderer Programmiersprachen.
+    PHP hat ein Exceptionmodell ähnlich dem anderer Programmiersprachen.
     Eine Exception kann in PHP geworfen (&throw;) und abgefangen (&catch;)
     werden. Um das Abfangen potentieller Exceptions zu ermöglichen, sollte der
     jeweilige Code von einem &try;-Block umschlossen werden. Jeder &try;-Block

Modified: phpdoc/de/trunk/language/oop5/cloning.xml
===================================================================
--- phpdoc/de/trunk/language/oop5/cloning.xml	2018-12-07 16:01:21 UTC (rev 346202)
+++ phpdoc/de/trunk/language/oop5/cloning.xml	2018-12-07 17:48:02 UTC (rev 346203)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 340428 Maintainer: simp Status: ready -->
+<!-- EN-Revision: 346157 Maintainer: simp Status: ready -->
  <sect1 xml:id="language.oop5.cloning" xmlns="http://docbook.org/ns/docbook">
   <title>Objekte klonen</title>

@@ -35,7 +35,7 @@
   </informalexample>

   <para>
-   Wenn ein Objekt geklont wird, wird PHP 5 eine seichte Kopie der Eigenschaften
+   Wenn ein Objekt geklont wird, wird PHP eine seichte Kopie der Eigenschaften
    des Objektes durchführen. Alle Eigenschaften, die Referenzen auf andere
    Variablen sind, werden Referenzen bleiben.
   </para>

Modified: phpdoc/de/trunk/reference/ldap/book.xml
===================================================================
--- phpdoc/de/trunk/reference/ldap/book.xml	2018-12-07 16:01:21 UTC (rev 346202)
+++ phpdoc/de/trunk/reference/ldap/book.xml	2018-12-07 17:48:02 UTC (rev 346203)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 338390 Maintainer: hholzgra Status: ready -->
+<!-- EN-Revision: 346155 Maintainer: hholzgra Status: ready -->

 <book xml:id="book.ldap" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
  <?phpdoc extension-membership="bundledexternal" ?>
@@ -105,6 +105,7 @@
  &reference.ldap.setup;
  &reference.ldap.constants;
  &reference.ldap.using;
+ &reference.ldap.controls;
  &reference.ldap.examples;
  &reference.ldap.reference;


Modified: phpdoc/de/trunk/reference/ldap/examples.xml
===================================================================
--- phpdoc/de/trunk/reference/ldap/examples.xml	2018-12-07 16:01:21 UTC (rev 346202)
+++ phpdoc/de/trunk/reference/ldap/examples.xml	2018-12-07 17:48:02 UTC (rev 346203)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!-- $Revision$ -->
-<!-- EN-Revision: 325514 Maintainer: hholzgra Status: ready -->
+<!-- EN-Revision: 346192 Maintainer: hholzgra Status: ready -->

 <chapter xml:id="ldap.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
  &reftitle.examples;
@@ -60,6 +60,153 @@
    </programlisting>
   </example>
  </section>
+
+ <section xml:id="ldap.examples-controls">
+  <title>LDAP-Steuerbefehle</title>
+  <para>
+   Hier sind einige Beispiele für die Verwendung von LDAP-Steuerbefehlen unter PHP &gt;= 7.3.0.
+  </para>
+
+  <example>
+   <title>Binden mit Ppolicy Information</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+
+$user   = 'cn=admin,dc=example,dc=com';
+$passwd = 'adminpassword';
+
+$ds = ldap_connect('ldap://localhost');
+
+if ($ds) {
+  $r = ldap_bind_ext($ds, $user, $passwd, [['oid' => LDAP_CONTROL_PASSWORDPOLICYREQUEST]]);
+
+  if (ldap_parse_result($ds, $r, $errcode, $matcheddn, $errmsg, $referrals, $ctrls)) {
+    if ($errcode != 0) {
+      die("Fehler: $errmsg ($errcode)");
+    }
+    if (isset($ctrls[LDAP_CONTROL_PASSWORDPOLICYRESPONSE])) {
+      $value = $ctrls[LDAP_CONTROL_PASSWORDPOLICYRESPONSE]['value'];
+      echo "Verfällt in: ".$value['expire']." Sekunden\n";
+      echo "Anzahl der verfügbaren Authentifizierungsversuche: ".$value['grace']."\n";
+      if (isset($value['error'])) {
+        echo "Ppolicy Fehlercode: ".$value['error'];
+      }
+    }
+  }
+} else {
+  die("Verbindung mit dem LDAP-Server nicht möglich");
+}
+?>
+]]>
+   </programlisting>
+  </example>
+
+  <example>
+   <title>Ändern der Beschreibung, falls diese nicht leer ist</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+  // $link ist eine LDAP-Verbindung
+
+  $result = ldap_mod_replace_ext(
+    $link,
+    'o=test,dc=example,dc=com',
+    ['description' => 'New description'],
+    [
+      [
+        'oid'         => LDAP_CONTROL_ASSERT,
+        'iscritical'  => TRUE,
+        'value'       => ['filter' => '(!(description=*))']
+      ]
+    ]
+  );
+
+  // Nun ist ldap_parse_result zu verwenden
+?>
+]]>
+   </programlisting>
+  </example>
+
+  <example>
+   <title>Lesen einiger Werte vor dem Löschen</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+  // $link ist eine LDAP-Verbindung
+
+  $result = ldap_delete_ext(
+    $link,
+    'o=test,dc=example,dc=com',
+    [
+      [
+        'oid'         => LDAP_CONTROL_PRE_READ,
+        'iscritical'  => TRUE,
+        'value'       => ['attrs' => ['o', 'description']]
+      ]
+    ]
+  );
+
+  // Nun ist ldap_parse_result zu verwenden
+?>
+]]>
+   </programlisting>
+  </example>
+
+  <example>
+   <title>Löschen einer Referenz</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+  // $link ist eine LDAP-Verbindung
+
+  // Ohne den Steuerbefehl würde der referenzierte Knoten gelöscht.
+  // Der Steuerbefehl muss als kritisch markiert werden, um dies zu vermeiden.
+  $result = ldap_delete_ext(
+    $link,
+    'cn=reference,dc=example,dc=com',
+    [['oid' => LDAP_CONTROL_MANAGEDSAIT, 'iscritical' => TRUE]]
+  );
+
+  // Nun ist ldap_parse_result zu verwenden
+?>
+]]>
+   </programlisting>
+  </example>
+
+  <example>
+   <title>Paginierung für eine Suche verwenden</title>
+   <programlisting role="php">
+<![CDATA[
+<?php
+  // $link ist eine LDAP-Verbindung
+
+  $cookie = '';
+
+  do {
+    $result = ldap_search(
+      $link, 'dc=example,dc=base', '(cn=*)', ['cn'], 0, 0, 0, LDAP_DEREF_NEVER,
+      [['oid' => LDAP_CONTROL_PAGEDRESULTS, 'value' => ['size' => 2, 'cookie' => $cookie]]]
+    );
+    ldap_parse_result($link, $result, $errcode , $matcheddn , $errmsg , $referrals, $controls);
+    // Um das Beispiel übersichtlich zu halten, wird nicht auf Fehler geprüft
+    $entries = ldap_get_entries($link, $result);
+    foreach ($entries as $entry) {
+      echo "cn: ".$entry['cn'][0]."\n";
+    }
+    if (isset($controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'])) {
+      // Das Cookie des letzten Aufrufs muss an den Folgenden übergeben werden
+      $cookie = $controls[LDAP_CONTROL_PAGEDRESULTS]['value']['cookie'];
+    } else {
+      $cookie = '';
+    }
+    // Ein leeres Cookie bedeutet die letzte Seite
+  } while (!empty($cookie));
+?>
+]]>
+   </programlisting>
+  </example>
+ </section>
 </chapter>

 <!-- Keep this comment at the end of the file
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.