mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-27 23:29:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@5137 201d5d3c-b55e-5fd7-737f-ddc643e51545
258 lines
No EOL
13 KiB
HTML
258 lines
No EOL
13 KiB
HTML
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<!-- template designed by Marco Von Ballmoos -->
|
|
<title>Docs For Class Services_Yadis_Yadis</title>
|
|
<link rel="stylesheet" href="../media/stylesheet.css" />
|
|
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
|
|
</head>
|
|
<body>
|
|
<div class="page-body">
|
|
|
|
<h2 class="class-name">Class Services_Yadis_Yadis</h2>
|
|
|
|
<a name="sec-description"></a>
|
|
<div class="info-box">
|
|
<div class="info-box-title">Description</div>
|
|
<div class="nav-bar">
|
|
<span class="disabled">Description</span> |
|
|
<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
|
|
|
|
</div>
|
|
<div class="info-box-body">
|
|
<!-- ========== Info from phpDoc block ========= -->
|
|
<p class="short-description">This is the core of the PHP Yadis library. This is the only class a user needs to use to perform Yadis discovery. This class performs the discovery AND stores the result of the discovery.</p>
|
|
<p class="description"><p>First, require this library into your program source:</p><p><pre> require_once "Services/Yadis/Yadis.php";</pre></p><p>To perform Yadis discovery, first call the "discover" method statically with a URI parameter:</p><p><pre> $http_response = array();
|
|
$fetcher = Services_Yadis_Yadis::getHTTPFetcher();
|
|
$yadis_object = Services_Yadis_Yadis::discover($uri,
|
|
$http_response, $fetcher);</pre></p><p>If the discovery succeeds, $yadis_object will be an instance of <a href="../Yadis/Services_Yadis_Yadis.html">Services_Yadis_Yadis</a>. If not, it will be null. The XRDS document found during discovery should have service descriptions, which can be accessed by calling</p><p><pre> $service_list = $yadis_object->services();</pre></p><p>which returns an array of objects which describe each service. These objects are instances of Services_Yadis_Service. Each object describes exactly one whole Service element, complete with all of its Types and URIs (no expansion is performed). The common use case for using the service objects returned by services() is to write one or more filter functions and pass those to services():</p><p><pre> $service_list = $yadis_object->services(
|
|
array("filterByURI",
|
|
"filterByExtension"));</pre></p><p>The filter functions (whose names appear in the array passed to services()) take the following form:</p><p><pre> function myFilter(&$service) {
|
|
// Query $service object here. Return true if the service
|
|
// matches your query; false if not.
|
|
}</pre></p><p>This is an example of a filter which uses a regular expression to match the content of URI tags (note that the Services_Yadis_Service class provides a getURIs() method which you should use instead of this contrived example):</p><p><pre> function URIMatcher(&$service) {
|
|
foreach ($service->getElements('xrd:URI') as $uri) {
|
|
if (preg_match("/some_pattern/",
|
|
$service->parser->content($uri))) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
}</pre></p><p>The filter functions you pass will be called for each service object to determine which ones match the criteria your filters specify. The default behavior is that if a given service object matches ANY of the filters specified in the services() call, it will be returned. You can specify that a given service object will be returned ONLY if it matches ALL specified filters by changing the match mode of services():</p><p><pre> $yadis_object->services(array("filter1", "filter2"),
|
|
SERVICES_YADIS_MATCH_ALL);</pre></p><p>See <a href="../Yadis/_Services---Yadis---XRDS.php.html#defineSERVICES_YADIS_MATCH_ALL">SERVICES_YADIS_MATCH_ALL</a> and <a href="../Yadis/_Services---Yadis---XRDS.php.html#defineSERVICES_YADIS_MATCH_ANY">SERVICES_YADIS_MATCH_ANY</a>.</p><p>Services described in an XRDS should have a library which you'll probably be using. Those libraries are responsible for defining filters that can be used with the "services()" call. If you need to write your own filter, see the documentation for <a href="../Yadis/Services_Yadis_Service.html">Services_Yadis_Service</a>.</p></p>
|
|
<p class="notes">
|
|
Located in <a class="field" href="_Services---Yadis---Yadis.php.html">/Services/Yadis/Yadis.php</a> (line <span class="field">114</span>)
|
|
</p>
|
|
|
|
|
|
<pre></pre>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<a name="sec-method-summary"></a>
|
|
<div class="info-box">
|
|
<div class="info-box-title">Method Summary</span></div>
|
|
<div class="nav-bar">
|
|
<a href="#sec-description">Description</a> |
|
|
<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
|
|
</div>
|
|
<div class="info-box-body">
|
|
<div class="method-summary">
|
|
|
|
<div class="method-definition">
|
|
<span class="method-result">Services_Yadis_Yadis</span>
|
|
<a href="#Services_Yadis_Yadis" title="details" class="method-name">Services_Yadis_Yadis</a>
|
|
()
|
|
</div>
|
|
|
|
<div class="method-definition">
|
|
<span class="method-result">void</span>
|
|
<a href="#curlPresent" title="details" class="method-name">curlPresent</a>
|
|
()
|
|
</div>
|
|
|
|
<div class="method-definition">
|
|
<span class="method-result">mixed</span>
|
|
<a href="#discover" title="details" class="method-name">discover</a>
|
|
(<span class="var-type">string</span> <span class="var-name">$uri</span>, <span class="var-type"></span> <span class="var-name">&$http_response</span>, <span class="var-type"></span> <span class="var-name">&$fetcher</span>, [<span class="var-type">array</span> <span class="var-name">$extra_ns_map</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span> <span class="var-name">$timeout</span> = <span class="var-default">20</span>], <span class="var-type">array</span> <span class="var-name">$http_response</span>, <span class="var-type">Services_Yadis_HTTPFetcher</span> <span class="var-name">$fetcher</span>)
|
|
</div>
|
|
|
|
<div class="method-definition">
|
|
<span class="method-result">void</span>
|
|
<a href="#getHTTPFetcher" title="details" class="method-name">getHTTPFetcher</a>
|
|
([<span class="var-type"></span> <span class="var-name">$timeout</span> = <span class="var-default">20</span>])
|
|
</div>
|
|
|
|
<div class="method-definition">
|
|
<span class="method-result">array</span>
|
|
<a href="#services" title="details" class="method-name">services</a>
|
|
()
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<a name="sec-methods"></a>
|
|
<div class="info-box">
|
|
<div class="info-box-title">Methods</div>
|
|
<div class="nav-bar">
|
|
<a href="#sec-description">Description</a> |
|
|
<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
|
|
|
|
</div>
|
|
<div class="info-box-body">
|
|
<A NAME='method_detail'></A>
|
|
<a name="methodServices_Yadis_Yadis" id="Services_Yadis_Yadis"><!-- --></a>
|
|
<div class="oddrow">
|
|
|
|
<div class="method-header">
|
|
<span class="method-title">Constructor Services_Yadis_Yadis</span> (line <span class="line-number">285</span>)
|
|
</div>
|
|
|
|
<!-- ========== Info from phpDoc block ========= -->
|
|
<p class="short-description">Instantiates an empty Services_Yadis_Yadis object. This constructor should not be used by any user of the library.</p>
|
|
<p class="description"><p>This constructor results in a completely useless object which must be populated with valid discovery information. Instead of using this constructor, call Services_Yadis_Yadis::discover($uri).</p></p>
|
|
|
|
<div class="method-signature">
|
|
<span class="method-result">Services_Yadis_Yadis</span>
|
|
<span class="method-name">
|
|
Services_Yadis_Yadis
|
|
</span>
|
|
()
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<a name="methodcurlPresent" id="curlPresent"><!-- --></a>
|
|
<div class="evenrow">
|
|
|
|
<div class="method-header">
|
|
<span class="method-title">curlPresent</span> (line <span class="line-number">132</span>)
|
|
</div>
|
|
|
|
<!-- ========== Info from phpDoc block ========= -->
|
|
|
|
<div class="method-signature">
|
|
<span class="method-result">void</span>
|
|
<span class="method-name">
|
|
curlPresent
|
|
</span>
|
|
()
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
<a name="methoddiscover" id="discover"><!-- --></a>
|
|
<div class="oddrow">
|
|
|
|
<div class="method-header">
|
|
<span class="method-title">discover</span> (line <span class="line-number">188</span>)
|
|
</div>
|
|
|
|
<!-- ========== Info from phpDoc block ========= -->
|
|
<p class="short-description">This should be called statically and will build a Yadis instance if the discovery process succeeds. This implements Yadis discovery as specified in the Yadis specification.</p>
|
|
<ul class="tags">
|
|
<li><span class="field">return:</span> Either null or an instance of Services_Yadis_Yadis, depending on whether the discovery succeeded.</li>
|
|
</ul>
|
|
|
|
<div class="method-signature">
|
|
<span class="method-result">mixed</span>
|
|
<span class="method-name">
|
|
discover
|
|
</span>
|
|
(<span class="var-type">string</span> <span class="var-name">$uri</span>, <span class="var-type"></span> <span class="var-name">&$http_response</span>, <span class="var-type"></span> <span class="var-name">&$fetcher</span>, [<span class="var-type">array</span> <span class="var-name">$extra_ns_map</span> = <span class="var-default">null</span>], [<span class="var-type">integer</span> <span class="var-name">$timeout</span> = <span class="var-default">20</span>], <span class="var-type">array</span> <span class="var-name">$http_response</span>, <span class="var-type">Services_Yadis_HTTPFetcher</span> <span class="var-name">$fetcher</span>)
|
|
</div>
|
|
|
|
<ul class="parameters">
|
|
<li>
|
|
<span class="var-type">string</span>
|
|
<span class="var-name">$uri</span><span class="var-description">: The URI on which to perform Yadis discovery.</span> </li>
|
|
<li>
|
|
<span class="var-type">array</span>
|
|
<span class="var-name">$http_response</span><span class="var-description">: An array reference where the HTTP response object will be stored (see Services_Yadis_HTTPResponse.</span> </li>
|
|
<li>
|
|
<span class="var-type">Services_Yadis_HTTPFetcher</span>
|
|
<span class="var-name">$fetcher</span><span class="var-description">: An instance of a Services_Yadis_HTTPFetcher subclass.</span> </li>
|
|
<li>
|
|
<span class="var-type">array</span>
|
|
<span class="var-name">$extra_ns_map</span><span class="var-description">: An array which maps namespace names to namespace URIs to be used when parsing the Yadis XRDS document.</span> </li>
|
|
<li>
|
|
<span class="var-type">integer</span>
|
|
<span class="var-name">$timeout</span><span class="var-description">: An optional fetcher timeout, in seconds.</span> </li>
|
|
<li>
|
|
<span class="var-type"></span>
|
|
<span class="var-name">&$http_response</span> </li>
|
|
<li>
|
|
<span class="var-type"></span>
|
|
<span class="var-name">&$fetcher</span> </li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
<a name="methodgetHTTPFetcher" id="getHTTPFetcher"><!-- --></a>
|
|
<div class="evenrow">
|
|
|
|
<div class="method-header">
|
|
<span class="method-title">getHTTPFetcher</span> (line <span class="line-number">122</span>)
|
|
</div>
|
|
|
|
<!-- ========== Info from phpDoc block ========= -->
|
|
<p class="short-description">Returns an HTTP fetcher object. If the CURL extension is present, an instance of Services_Yadis_ParanoidHTTPFetcher is returned. If not, an instance of Services_Yadis_PlainHTTPFetcher is returned.</p>
|
|
|
|
<div class="method-signature">
|
|
<span class="method-result">void</span>
|
|
<span class="method-name">
|
|
getHTTPFetcher
|
|
</span>
|
|
([<span class="var-type"></span> <span class="var-name">$timeout</span> = <span class="var-default">20</span>])
|
|
</div>
|
|
|
|
<ul class="parameters">
|
|
<li>
|
|
<span class="var-type"></span>
|
|
<span class="var-name">$timeout</span> </li>
|
|
</ul>
|
|
|
|
|
|
</div>
|
|
<a name="methodservices" id="services"><!-- --></a>
|
|
<div class="oddrow">
|
|
|
|
<div class="method-header">
|
|
<span class="method-title">services</span> (line <span class="line-number">303</span>)
|
|
</div>
|
|
|
|
<!-- ========== Info from phpDoc block ========= -->
|
|
<p class="short-description">Returns the list of service objects as described by the XRDS document, if this yadis object represents a successful Yadis discovery.</p>
|
|
<ul class="tags">
|
|
<li><span class="field">return:</span> An array of <a href="../Yadis/Services_Yadis_Service.html">Services_Yadis_Service</a> objects</li>
|
|
</ul>
|
|
|
|
<div class="method-signature">
|
|
<span class="method-result">array</span>
|
|
<span class="method-name">
|
|
services
|
|
</span>
|
|
()
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<p class="notes" id="credit">
|
|
Documentation generated on Mon, 10 Sep 2007 13:29:31 -0700 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
|
|
</p>
|
|
</div></body>
|
|
</html>
|