diff options
| author | fukachan <fukachan> | 2001-09-30 23:08:23 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2001-09-30 23:08:23 +0000 |
| commit | 12a55c15a6234f6bf2c46833a0d527034aa165b2 (patch) | |
| tree | 58362c6441af07bd169434a4079f155eb472efd1 /fml/doc/ja/tutorial/module | |
| parent | 8b0fdad2c52396ab3d3aa21910302ad9994a76d7 (diff) | |
| download | fml8-12a55c15a6234f6bf2c46833a0d527034aa165b2.tar.gz fml8-12a55c15a6234f6bf2c46833a0d527034aa165b2.tar.bz2 fml8-12a55c15a6234f6bf2c46833a0d527034aa165b2.zip | |
add IO::Adapter
Diffstat (limited to 'fml/doc/ja/tutorial/module')
| -rw-r--r-- | fml/doc/ja/tutorial/module/IO::Adapter.sgml | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/fml/doc/ja/tutorial/module/IO::Adapter.sgml b/fml/doc/ja/tutorial/module/IO::Adapter.sgml new file mode 100644 index 00000000..afa03c9d --- /dev/null +++ b/fml/doc/ja/tutorial/module/IO::Adapter.sgml @@ -0,0 +1,77 @@ +<!-- + $FML: ioadapter.sgml,v 1.1 2001/09/17 13:04:25 fukachan Exp $ +--> + +<chapter id="io.adapter"> + <title> + IO::Adapter + </title> + +<sect1> + <title> + IO へのアダプター層 (IO::Adapter) + </title> + +<para> +fml 5.0 でのメンバーリストの読み書きは +IO::Adapter という抽象クラスを通じて、 +アドレスの登録/削除を行なうようになっています。 +</para> + +<para> +例えば次のように使っています。 +<screen> +use IO::Adapter; +$obj = new IO::Adapter ($map, $map_params); +$obj->open || croak("cannot open $map"); +while ($x = $obj->getline) { ... } +$obj->close; +</screen> +ここで $map は次のようなものが使えます。 +<screen> +file:/var/spool/ml/elena/actives +unix.group:root +nis.group:root +mysql:id +postgresql:id (未実装) +ldap:id (未実装) +</screen> +</para> + +<para> +file: は通常のファイルです。 +unix.group:root は /etc/group の root のエントリにあるユーザのリストを、 +nis.group:root は NIS の root のエントリにあるユーザのリストです。 +</para> + +<para> +mysql:id は MySQL へのアクセスです。 +mysql:id で指定されたパラメータを用います。 +このパラメータは new() を実行する際に別途与える必要があります。 +<screen> +my $map = 'mysql:toymodel'; +my $map_params = { + $map => { + sql_server => 'localhost', + user => 'fukachan', + user_password => 'uja', + database => 'fml', + table => 'ml', + params => { + ml_name => 'elena', + file => 'members', + }, + }, +}; + +my $obj = new IO::Adapter ($map, $map_params); +$obj->open(); +$obj->add( 'rudo@nuinui.net' ); +$obj->close(); +</screen> +</para> + +</sect1> + + +</chapter> |
