Auth_Yadis_ParseHTML Class Reference

List of all members.


Detailed Description

This is the HTML pseudo-parser for the Yadis library.

PHP versions 4 and 5

LICENSE: See the COPYING file included in this distribution.

Author:
JanRain, Inc. <[email protected]> 2005-2008 Janrain, Inc. http://www.apache.org/licenses/LICENSE-2.0 Apache This class is responsible for scanning an HTML string to find META tags and their attributes. This is used by the Yadis discovery process. This class must be instantiated to be used.

Definition at line 23 of file ParseHTML.php.


Public Member Functions

 Auth_Yadis_ParseHTML ()
 replaceEntities ($str)
 removeQuotes ($str)
 tagPattern ($tag_names, $close, $self_close)
 getMetaTags ($html_string)
 getHTTPEquiv ($html_string)

Public Attributes

 $_re_flags = "si"
 $_removed_re
 $_tag_expr = "<%s%s(?:\s.*?)?%s>"
 $_attr_find = '\b([-\w]+)=(".*?"|\'.*?\'|.+?)[\/\s>]'

Member Function Documentation

Auth_Yadis_ParseHTML.Auth_Yadis_ParseHTML (  ) 

Definition at line 46 of file ParseHTML.php.

Auth_Yadis_ParseHTML.replaceEntities ( str  ) 

Replace HTML entities (amp, lt, gt, and quot) as well as numeric entities (e.g. x9f;) with their actual values and return the new string.

private

Parameters:
string $str The string in which to look for entities
Returns:
string $new_str The new string entities decoded

Definition at line 77 of file ParseHTML.php.

Auth_Yadis_ParseHTML.removeQuotes ( str  ) 

Strip single and double quotes off of a string, if they are present.

private

Parameters:
string $str The original string
Returns:
string $new_str The new string with leading and trailing quotes removed

Definition at line 100 of file ParseHTML.php.

Auth_Yadis_ParseHTML.tagPattern ( tag_names,
close,
self_close 
)

Create a regular expression that will match an opening or closing tag from a set of names.

private

Parameters:
mixed $tag_names Tag names to match
mixed $close false/0 = no, true/1 = yes, other = maybe
mixed $self_close false/0 = no, true/1 = yes, other = maybe
Returns:
string $regex A regular expression string to be used in, say, preg_match.

Definition at line 126 of file ParseHTML.php.

Auth_Yadis_ParseHTML.getMetaTags ( html_string  ) 

Given an HTML document string, this finds all the META tags in the document, provided they are found in the <HTML><HEAD>...</HEAD> section of the document. The <HTML> tag may be missing.

private

Parameters:
string $html_string An HTMl document string
Returns:
array $tag_list Array of tags; each tag is an array of attribute -> value.

Definition at line 157 of file ParseHTML.php.

Auth_Yadis_ParseHTML.getHTTPEquiv ( html_string  ) 

Looks for a META tag with an "http-equiv" attribute whose value is one of ("x-xrds-location", "x-yadis-location"), ignoring case. If such a META tag is found, its "content" attribute value is returned.

Parameters:
string $html_string An HTML document in string format
Returns:
mixed $content The "content" attribute value of the META tag, if found, or null if no such tag was found.

Definition at line 240 of file ParseHTML.php.


Member Data Documentation

Auth_Yadis_ParseHTML.$_re_flags = "si"

private

Definition at line 28 of file ParseHTML.php.

Auth_Yadis_ParseHTML.$_removed_re

Initial value:

           "<!--.*?-->|<!\[CDATA\[.*?\]\]>|<script\b(?!:)[^>]*>.*?<\/script>"
private

Definition at line 33 of file ParseHTML.php.

Auth_Yadis_ParseHTML.$_tag_expr = "<%s%s(?:\s.*?)?%s>"

private

Definition at line 39 of file ParseHTML.php.

Auth_Yadis_ParseHTML.$_attr_find = '\b([-\w]+)=(".*?"|\'.*?\'|.+?)[\/\s>]'

private

Definition at line 44 of file ParseHTML.php.


The documentation for this class was generated from the following file:

Generated on Thu Feb 19 15:03:41 2009 for OXID eShop CE by  doxygen 1.5.5