[GENERIC] Zend_Translate:
[zend.git] / documentation / manual / ja / module_specs / Zend_Ldap-LDIF.xml
blobcd1e0577b71ee1d4ad698e833bd63a9d0da7aa93
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!-- Reviewed: no -->
3 <!-- EN-Revision: 20792 -->
4 <sect1 id="zend.ldap.ldif">
5     <title>LDIFへ、または、からのLDAPデータシリアライズ</title>
6     <sect2 id="zend.ldap.ldif.encode">
7         <title>LDIFへのLDAP項目シリアライズ</title>
9         <programlisting language="php"><![CDATA[
10 $data = array(
11     'dn'                         => 'uid=rogasawara,ou=営業部,o=Airius',
12     'objectclass'                => array('top',
13                                           'person',
14                                           'organizationalPerson',
15                                           'inetOrgPerson'),
16     'uid'                        => array('rogasawara'),
17     'mail'                       => array('rogasawara@airius.co.jp'),
18     'givenname;lang-ja'          => array('ロドニー'),
19     'sn;lang-ja'                 => array('小笠原'),
20     'cn;lang-ja'                 => array('小笠原 ロドニー'),
21     'title;lang-ja'              => array('営業部 部長'),
22     'preferredlanguage'          => array('ja'),
23     'givenname'                  => array('ロドニー'),
24     'sn'                         => array('小笠原'),
25     'cn'                         => array('小笠原 ロドニー'),
26     'title'                      => array('営業部 部長'),
27     'givenname;lang-ja;phonetic' => array('ろどにー'),
28     'sn;lang-ja;phonetic'        => array('おがさわら'),
29     'cn;lang-ja;phonetic'        => array('おがさわら ろどにー'),
30     'title;lang-ja;phonetic'     => array('えいぎょうぶ ぶちょう'),
31     'givenname;lang-en'          => array('Rodney'),
32     'sn;lang-en'                 => array('Ogasawara'),
33     'cn;lang-en'                 => array('Rodney Ogasawara'),
34     'title;lang-en'              => array('Sales, Director'),
36 $ldif = Zend_Ldap_Ldif_Encoder::encode($data, array('sort' => false,
37                                                     'version' => null));
39 $ldif contains:
40 dn:: dWlkPXJvZ2FzYXdhcmEsb3U95Za25qWt6YOoLG89QWlyaXVz
41 objectclass: top
42 objectclass: person
43 objectclass: organizationalPerson
44 objectclass: inetOrgPerson
45 uid: rogasawara
46 mail: rogasawara@airius.co.jp
47 givenname;lang-ja:: 44Ot44OJ44OL44O8
48 sn;lang-ja:: 5bCP56yg5Y6f
49 cn;lang-ja:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
50 title;lang-ja:: 5Za25qWt6YOoIOmDqOmVtw==
51 preferredlanguage: ja
52 givenname:: 44Ot44OJ44OL44O8
53 sn:: 5bCP56yg5Y6f
54 cn:: 5bCP56yg5Y6fIOODreODieODi+ODvA==
55 title:: 5Za25qWt6YOoIOmDqOmVtw==
56 givenname;lang-ja;phonetic:: 44KN44Gp44Gr44O8
57 sn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJ
58 cn;lang-ja;phonetic:: 44GK44GM44GV44KP44KJIOOCjeOBqeOBq+ODvA==
59 title;lang-ja;phonetic:: 44GI44GE44GO44KH44GG44G2IOOBtuOBoeOCh+OBhg==
60 givenname;lang-en: Rodney
61 sn;lang-en: Ogasawara
62 cn;lang-en: Rodney Ogasawara
63 title;lang-en: Sales, Director
65 ]]></programlisting>
67     </sect2>
69     <sect2 id="zend.ldap.ldif.decode">
70         <title>LDIF文字列を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>
128     </sect2>
129 </sect1>