Adds a supported xml-rpc or SOAP function to a channel definition file. The type should be xmlrpc or soap in lower-cased letters. No validation is performed on insert. For example:
<?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'); ?> |
The oops protocol will be successfully created, but will fail upon validation.
Adding a function to a mirror simply validated to ensure that the mirror already exists.
<?php require_once 'PEAR/ChannelFile.php'; $chan = new PEAR_ChannelFile; $chan->setName('foo.example.com'); $chan->setSummary('demonstrate addFunction'); // fails: mirror not found $chan->addFunction('soap', '1.0', 'people.list', 'mirror.example.com'); $chan->addMirror('mirror.example.com'); // succeeds $chan->addFunction('soap', '1.0', 'people.list', 'mirror.example.com'); ?> |