本文整理匯總了PHP中EasyRdf_Namespace::setDefault方法的典型用法代碼示例。如果您正苦於以下問題:PHP EasyRdf_Namespace::setDefault方法的具體用法?PHP EasyRdf_Namespace::setDefault怎麽用?PHP EasyRdf_Namespace::setDefault使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類EasyRdf_Namespace
的用法示例。
在下文中一共展示了EasyRdf_Namespace::setDefault方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testExpandWithoutDefault
public function testExpandWithoutDefault()
{
EasyRdf_Namespace::setDefault(null);
$this->assertSame('unknown', EasyRdf_Namespace::expand('unknown'));
}
示例2: set_include_path
<?php
/**
* Example of reading Open Graph Protocol properties
*
* @package EasyRdf
* @copyright Copyright (c) 2012-2013 Nicholas J Humfrey
* @license http://unlicense.org/
*/
set_include_path(get_include_path() . PATH_SEPARATOR . '../lib/');
require_once "EasyRdf.php";
EasyRdf_Namespace::setDefault('dc11');
?>
<html>
<head>
<title>Open Graph Protocol example</title>
</head>
<body>
<?php
$doc = EasyRdf_Graph::newAndLoad('http://www.rottentomatoes.com/m/10011268-oceans/');
?>
<p>
Title: <?php
echo $doc->title;
?>
<br />
Creator: <?php
echo $doc->creator;
?>
示例3: testMagicUnset
public function testMagicUnset()
{
$this->setupTestGraph();
EasyRdf_Namespace::setDefault('rdf');
$this->resource->add('rdf:testMagicUnset', 'testMagicUnset');
unset($this->resource->testMagicUnset);
$this->assertStringEquals(null, $this->resource->get('rdf:testMagicUnset'));
}
示例4: testMagicUnset
public function testMagicUnset()
{
EasyRdf_Namespace::setDefault('rdf');
$this->graph->add($this->graph->getUri(), 'rdf:test', 'testMagicUnset');
unset($this->graph->test);
$this->assertStringEquals(null, $this->graph->get($this->graph->getUri(), 'rdf:test'));
}