Services_Pingback
[ class tree: Services_Pingback ] [ index: Services_Pingback ] [ all elements ]

Class: Services_Pingback

Source Location: /Services_Pingback-0.2.1/Services/Pingback.php

Class Overview


Pingback user-agent class.


Author(s):

Version:

  • Release: 0.2.1

Copyright:

  • Copyright (c) 2005-2006 Firman Wandayandi <firman@php.net>

Methods


Inherited Variables

Inherited Methods


Class Details

[line 165]
Pingback user-agent class.

This class implemented of Pingback 1.0 specification, visit http://www.hixie.ch/specs/pingback/pingback for more information.

  • Author: Firman Wandayandi <firman@php.net>
  • Version: Release: 0.2.1
  • Copyright: Copyright (c) 2005-2006 Firman Wandayandi <firman@php.net>
  • Todo: Enabled access denied and upstream error response.
  • Todo: Extract more pretty context of source and flexible direction.
  • Todo: Finished PHPUnit test classes.
  • License: BSD License


[ Top ]


Method Detail

Services_Pingback (Constructor)   [line 268]

Services_Pingback Services_Pingback( [array $data = null], [array $options = null])

Constructor.
  • Access: public

Parameters:

array   $data   —  The pingback data, are:
      sourceURI                   The absolute URI of the post on the source page containing the link to the target site.
      targetURI                   The absolute URI of the target of the link, as given on the source page.
      pingbackURI     (optional)  Manually sets a Pingback URI.
array   $options   —  Option for pingback. Valid options are:
      timeout         (optional)  Connection timeout in seconds (float), default 30 seconds.
      allowRedirects  (optional)  Whether follow redirect or not (bool), default TRUE.
      maxRedirects    (optional)  Max Number of redirects (int), default 2.
      fetchsize       (optional)  A size of string to fetch in bytes (int), default 255.
      debug           (optional)  Whether print out debug messages or not (bool), defaul FALSE.

[ Top ]

addRegisteredSource   [line 456]

bool|PEAR_Error addRegisteredSource( mixed $data)

Add registered pingback source(s).

Parameters:

mixed   $data   —  A string URI or An array contains URIs.

[ Top ]

autodiscover   [line 501]

string|PEAR_Error autodiscover( string $uri)

Implemented of Pingback autodiscovery algorithm.

This method send a request to given URI, then see if the header contain Pingback header, if not attempt to find a Pingback link on the body contents. This algorithm is one of requirement of the Pingback clients specification.


Parameters:

string   $uri   —  URI to discover.

[ Top ]

errorMessage   [line 613]

string errorMessage( int $value)

Get error message.
  • Return: Error message.
  • Access: public

Parameters:

int   $value   —  Error code.

[ Top ]

expandEntities   [line 682]

string expandEntities( string $str)

Expand the entities.

There are four allowed entities (&amp; for &, &lt; for <, &gt; for > and &quot; for ").

  • Return: A result.
  • Access: public

Parameters:

string   $str   —  A string to expand, normally is a uri.

[ Top ]

fetchSourceContext   [line 830]

array|PEAR_Error fetchSourceContext( )

Fetch page context for current call.
  • Return: An array of context on success or PEAR_Error on failure.
  • Access: public

[ Top ]

get   [line 381]

mixed get( string $key)

Get a pingback data.
  • Return: Data value or NULL if data not found.
  • Access: public

Parameters:

string   $key   —  Data key name.

[ Top ]

getOptions   [line 343]

array getOptions( )

Get current options.
  • Return: An associative array of options.
  • Access: public

[ Top ]

getRegisteredSources   [line 479]

array getRegisteredSources( )

Get registered pingback source URIs.
  • Return: List of registered source URIs.
  • Access: public

[ Top ]

getSourceContext   [line 916]

string getSourceContext( )

Get fetched source context.
  • Return: Fetched source context.
  • Access: public

[ Top ]

isPingbackRegistered   [line 788]

bool isPingbackRegistered( string $sourceURI)

Find out the whether if pingback from URI has already registered.
  • Return: TRUE if has already registered, otherwise FALSE.
  • Access: public

Parameters:

string   $sourceURI   —  Source URI.

[ Top ]

isSourceLinked   [line 763]

bool isSourceLinked( string $uri, string $linkURI)

Find the a link to URI on the contents body of given URI.

Parameters:

string   $uri   —  URI to scans.
string   $linkURI   —  URI to be found on the link.

[ Top ]

isTargetPingbackEnabled   [line 808]

bool|PEAR_Error isTargetPingbackEnabled( string $uri)

Find the whether a resouce is a pingback-enabled or not.
  • Return: TRUE if it's pingback-enabled, otherwise FALSE or PEAR_Error on failure.
  • Access: public

Parameters:

string   $uri   —  URI to scans.

[ Top ]

isURIExist   [line 728]

bool isURIExist( string $uri)

Find out the whether the URI is exist, done with fopen().
  • Return: TRUE if exist, otherwise FALSE.
  • Author: Pablo Fischer <pfischer@php.net>
  • Access: public

Parameters:

string   $uri   —  URI to verify.

[ Top ]

ping   [line 939]

XML_RPC_Response ping( object $msg)

A callback of Pingback XML-RPC pingback.ping method.

Parameters:

object   $msg   —  An instance of XML_RPC_Message object.

[ Top ]

receive   [line 594]

void receive( )

Receive pingback call.
  • Access: public

[ Top ]

send   [line 534]

void send( [array $data = null])

Send a pingback.

Parameters:

array   $data   —  (optional) An array of pingback data.

[ Top ]

sendHTTPRequest   [line 642]

array|PEAR_Error sendHTTPRequest( string $uri)

Send a HTTP 1/1 request.
  • Return: An associative array of result containing keys 'code', 'header' and 'body' on success or PEAR_Error on failure.
  • Access: public

Parameters:

string   $uri   —  URI.

[ Top ]

sendPingbackHeader   [line 700]

bool|PEAR_Error sendPingbackHeader( [string $pingbackURI = null])

Send a Pingback header to tell this is a pingback-enable resource.
  • Return: TRUE on success or PEAR_Error on failure.
  • Access: public

Parameters:

string   $pingbackURI   —  (optional) Pingback URI, if not given URI is the current URI.

[ Top ]

set   [line 360]

bool|PEAR_Error set( string $key, string $value)

Set a pingback data.
  • Return: TRUE on success or PEAR_Error on failure.
  • Access: public

Parameters:

string   $key   —  Data key name.
string   $value   —  Data value.

[ Top ]

setFromArray   [line 401]

bool|PEAR_Error setFromArray( array $data)

Set the pingback data from an associative array.

Parameters:

array   $data   —  An associative array of data.

[ Top ]

setOptions   [line 290]

void setOptions( array $options)

Set the options of the Services_Pingback object.
  • See: create()
  • Access: public

Parameters:

array   $options   —  An associative array contains options.

[ Top ]

setRegisteredSources   [line 433]

bool|PEAR_Error setRegisteredSources( array $data)

Set registered pingback source URIs.

This method will override current registered sources data. For avoid it use addRegisteredSource().


Parameters:

array   $data   —  An array contains sources.

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:49:13 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.