本文整理匯總了PHP中PEAR_ChannelFile::getServer方法的典型用法代碼示例。如果您正苦於以下問題:PHP PEAR_ChannelFile::getServer方法的具體用法?PHP PEAR_ChannelFile::getServer怎麽用?PHP PEAR_ChannelFile::getServer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PEAR_ChannelFile
的用法示例。
在下文中一共展示了PEAR_ChannelFile::getServer方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
<?php
require_once "HTTP/Request.php";
require_once "Net/URL2.php";
$url =& new Net_URL2("http://mediawiki.googlecode.com/svn");
echo "url protocol: " . $url->protocol . "\n";
echo "url host: " . $url->host . "\n";
echo "url port: " . $url->port . "\n";
$req =& new HTTP_Request();
$req->setURL($url->protocol . "://" . $url->host . ":" . $url->port . "/channel.xml");
$req->sendRequest();
echo $req->getResponseCode();
require_once 'PEAR/ChannelFile.php';
$chan = new PEAR_ChannelFile();
echo 'XML: ';
if (!$chan->fromXmlString($req->getResponseBody())) {
echo 'channel.xml invalid';
die;
}
echo "OK \n";
echo "CHANNEL SEMANTIC: ";
if (!$chan->validate()) {
echo 'channel.xml invalid';
die;
}
echo "OK \n";
echo "server: " . $chan->getServer();