constructor PEAR_ChannelFile::
PEAR_ChannelFile
(Previous)
(Next) PEAR_ChannelFile::addMirror

View this page in Last updated: Sun, 31 Aug 2008
English | Dutch | French | German | Hungarian | Japanese | Polish | Plain HTML

PEAR_ChannelFile::addFunction()

PEAR_ChannelFile::addFunction()  -- provides セクションにプロトコルを追加する

説明

チャネル定義ファイルに、サポートされる 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');
?>

パラメータ

string $type

プロトコルの型。

string $version

プロトコルのバージョン。

string $name

存在する場合は、プロトコルの名前。

string $mirror

ミラーのプロトコルである場合に、ミラーの名前。

例外・エラー

例外はスローされません。

注意

この関数は、スタティックにコールする ことはできません。

constructor PEAR_ChannelFile::
PEAR_ChannelFile
(Previous)
(Next) PEAR_ChannelFile::addMirror

Download Documentation Last updated: Sun, 31 Aug 2008
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.