本文整理汇总了PHP中EasyRdf_Graph::setHttpClient方法的典型用法代码示例。如果您正苦于以下问题:PHP EasyRdf_Graph::setHttpClient方法的具体用法?PHP EasyRdf_Graph::setHttpClient怎么用?PHP EasyRdf_Graph::setHttpClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EasyRdf_Graph
的用法示例。
在下文中一共展示了EasyRdf_Graph::setHttpClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_include_path
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib/');
require_once "BBC/Programmes.php";
require_once "html_tag_helpers.php";
## Configure the RDF parser to use
require_once "EasyRdf/Parser/Arc.php";
EasyRdf_Graph::setRdfParser(new EasyRdf_Parser_Arc());
# Configure the HTTP client to use
require_once "EasyRdf/Http/Client.php";
EasyRdf_Graph::setHttpClient(new EasyRdf_Http_Client());
?>
<html>
<head><title>Episode Page</title></head>
<body>
<?php
echo form_tag();
echo text_field_tag('pid', 'b00p4h42', array('size' => 12));
echo submit_tag();
echo form_end_tag();
?>
<?php
if (isset($_REQUEST['pid'])) {
$episode = BBC_Programmes_Programme::find($_REQUEST['pid']);
echo content_tag('h1', $episode->getTitle());
if ($episode->get('foaf:depiction')) {
echo image_tag($episode->get('foaf:depiction'));
}
echo content_tag('p', $episode->get('po:long_synopsis'));
示例2: testLoadMockHttpClient
public function testLoadMockHttpClient()
{
EasyRdf_Graph::setHttpClient(new Mock_Http_Client());
$graph = new EasyRdf_Graph('http://www.example.com/');
$this->assertStringEquals('Joe Bloggs', $graph->resource('http://www.example.com/joe#me')->get('foaf:name'));
}