[ZF-10089] Zend_Log
[zend.git] / documentation / manual / fr / module_specs / Zend_Ldap-LDIF.xml
blob74d1abc41c60d7267729c2447aff5b60ca5f000a
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- EN-Revision: 21496 -->
3 <!-- Reviewed: no -->
4 <sect1 id="zend.ldap.ldif">
5     <title>Serialiser des données LDAP depuis/vers LDIF</title>
7     <sect2 id="zend.ldap.ldif.encode">
8         <title>Serialiser une entrée LDAP vers LDIF</title>
10         <programlisting language="php"><![CDATA[
11 $data = array(
12     'dn'                         => 'uid=rogasawara,ou=営業部,o=Airius',
13     'objectclass'                => array('top',
14                                           'person',
15                                           'organizationalPerson',
16                                           'inetOrgPerson'),
17     'uid'                        => array('rogasawara'),
18     'mail'                       => array('rogasawara@airius.co.jp'),
19     'givenname;lang-ja'          => array('ロドニー'),
20     'sn;lang-ja'                 => array('小笠原'),
21     'cn;lang-ja'                 => array('小笠原 ロドニー'),
22     'title;lang-ja'              => array('営業部 部長'),
23     'preferredlanguage'          => array('ja'),
24     'givenname'                  => array('ロドニー'),
25     'sn'                         => array('小笠原'),
26     'cn'                         => array('小笠原 ロドニー'),
27     'title'                      => array('営業部 部長'),
28     'givenname;lang-ja;phonetic' => array('ろどにー'),
29     'sn;lang-ja;phonetic'        => array('おがさわら'),
30     'cn;lang-ja;phonetic'        => array('おがさわら ろどにー'),
31     'title;lang-ja;phonetic'     => array('えいぎょうぶ ぶちょう'),
32     'givenname;lang-en'          => array('Rodney'),
33     'sn;lang-en'                 => array('Ogasawara'),
34     'cn;lang-en'                 => array('Rodney Ogasawara'),
35     'title;lang-en'              => array('Sales, Director'),
37 $ldif = Zend_Ldap_Ldif_Encoder::encode($data, array('sort' => false,
38                                                     'version' => null));
40 $ldif contains:
41 dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz
42 objectclass: top
43 objectclass: person
44 objectclass: organizationalPerson
45 objectclass: inetOrgPerson
46 uid: rogasawara
47 mail: rogasawara@airius.co.jp
48 givenname;lang-ja:: 44Ot44OJ44OL44O8
49 sn;lang-ja:: 5bCP56yg5Y6f
50 cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
51 title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==
52 preferredlanguage: ja
53 givenname:: 44Ot44OJ44OL44O8
54 sn:: 5bCP56yg5Y6f
55 cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
56 title:: 5Za25qWt6YOoIOmDqOmVtw==
57 givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8
58 sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ
59 cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==
60 title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==
61 givenname;lang-en: Rodney
62 sn;lang-en: Ogasawara
63 cn;lang-en: Rodney Ogasawara
64 title;lang-en: Sales, Director
66 ]]></programlisting>
67     </sect2>
69     <sect2 id="zend.ldap.ldif.decode">
70         <title>Desérialiser une chaine LDIF dans une entrée LDAP</title>
72         <programlisting language="php"><![CDATA[
73 $ldif = "dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz
74 objectclass: top
75 objectclass: person
76 objectclass: organizationalPerson
77 objectclass: inetOrgPerson
78 uid: rogasawara
79 mail: rogasawara@airius.co.jp
80 givenname;lang-ja:: 44Ot44OJ44OL44O8
81 sn;lang-ja:: 5bCP56yg5Y6f
82 cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
83 title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==
84 preferredlanguage: ja
85 givenname:: 44Ot44OJ44OL44O8
86 sn:: 5bCP56yg5Y6f
87 cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
88 title:: 5Za25qWt6YOoIOmDqOmVtw==
89 givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8
90 sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ
91 cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==
92 title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==
93 givenname;lang-en: Rodney
94 sn;lang-en: Ogasawara
95 cn;lang-en: Rodney Ogasawara
96 title;lang-en: Sales, Director";
97 $data = Zend_Ldap_Ldif_Encoder::decode($ldif);
99 $data = array(
100     'dn'                         => 'uid=rogasawara,ou=営業部,o=Airius',
101     'objectclass'                => array('top',
102                                           'person',
103                                           'organizationalPerson',
104                                           'inetOrgPerson'),
105     'uid'                        => array('rogasawara'),
106     'mail'                       => array('rogasawara@airius.co.jp'),
107     'givenname;lang-ja'          => array('ロドニー'),
108     'sn;lang-ja'                 => array('小笠原'),
109     'cn;lang-ja'                 => array('小笠原 ロドニー'),
110     'title;lang-ja'              => array('営業部 部長'),
111     'preferredlanguage'          => array('ja'),
112     'givenname'                  => array('ロドニー'),
113     'sn'                         => array('小笠原'),
114     'cn'                         => array('小笠原 ロドニー'),
115     'title'                      => array('営業部 部長'),
116     'givenname;lang-ja;phonetic' => array('ろどにー'),
117     'sn;lang-ja;phonetic'        => array('おがさわら'),
118     'cn;lang-ja;phonetic'        => array('おがさわら ろどにー'),
119     'title;lang-ja;phonetic'     => array('えいぎょうぶ ぶちょう'),
120     'givenname;lang-en'          => array('Rodney'),
121     'sn;lang-en'                 => array('Ogasawara'),
122     'cn;lang-en'                 => array('Rodney Ogasawara'),
123     'title;lang-en'              => array('Sales, Director'),
126 ]]></programlisting>
127     </sect2>
128 </sect1>