bool
PEAR_ChannelFile::addFunction
(
string
$type
,
string
$version
,
string
$name = ''
,
string
$mirror = false
)
チャネル定義ファイルに、サポートされる xml-rpc 関数あるいは
SOAP 関数を追加します。型は xmlrpc
あるいは
soap
で、小文字で指定しなければなりません。
追加時に型の検証は行われません。例えば
<?php
require_once 'PEAR/ChannelFile.php';
$chan = new PEAR_ChannelFile;
$chan->setName('foo.example.com');
$chan->setSummary('demonstrate addFunction');
$chan->addFunction('xmlrpc', '1.0', 'people.list');
$chan->addFunction('oops', '1.0', 'bad.type');
?>
oops
プロトコルの作成には成功しますが、
検証時には失敗します。
関数をミラーに追加する際には、ミラーが存在するかどうかがチェックされます。
<?php
require_once 'PEAR/ChannelFile.php';
$chan = new PEAR_ChannelFile;
$chan->setName('foo.example.com');
$chan->setSummary('demonstrate addFunction');
// 失敗します: ミラーが見つかりません
$chan->addFunction('soap', '1.0', 'people.list', 'mirror.example.com');
$chan->addMirror('mirror.example.com');
// 成功します
$chan->addFunction('soap', '1.0', 'people.list', 'mirror.example.com');
?>
$type
プロトコルの型。
$version
プロトコルのバージョン。
$name
存在する場合は、プロトコルの名前。
$mirror
ミラーのプロトコルである場合に、ミラーの名前。
例外はスローされません。
This function can not be called statically.