Auth_OpenID_Parse Class Reference

List of all members.


Detailed Description

This module implements a VERY limited parser that finds <link> tags in the head of HTML or XHTML documents and parses out their attributes according to the OpenID spec. It is a liberal parser, but it requires these things from the data in order to work:

From http://openid.net/specs.bml:

The parser ignores SGML comments and <![CDATA[blocks]]>. Both kinds of quoting are allowed for attributes.

The parser deals with invalid markup in these ways:

PHP versions 4 and 5

LICENSE: See the COPYING file included in this distribution.

private

Author:
JanRain, Inc. <[email protected]> 2005-2008 Janrain, Inc. http://www.apache.org/licenses/LICENSE-2.0 Apache Require Auth_OpenID.arrayGet().

Definition at line 87 of file Parse.php.


Public Member Functions

 Auth_OpenID_Parse ()
 tagMatcher ($tag_name, $close_tags=null)
 openTag ($tag_name)
 closeTag ($tag_name)
 htmlBegin ($s)
 htmlEnd ($s)
 headFind ()
 replaceEntities ($str)
 removeQuotes ($str)
 parseLinkAttrs ($html)
 relMatches ($rel_attr, $target_rel)
 linkHasRel ($link_attrs, $target_rel)
 findLinksRel ($link_attrs_list, $target_rel)
 findFirstHref ($link_attrs_list, $target_rel)

Public Attributes

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

Member Function Documentation

Auth_OpenID_Parse.Auth_OpenID_Parse (  ) 

Definition at line 111 of file Parse.php.

Auth_OpenID_Parse.tagMatcher ( tag_name,
close_tags = null 
)

Returns a regular expression that will match a given tag in an SGML string.

Definition at line 140 of file Parse.php.

Auth_OpenID_Parse.openTag ( tag_name  ) 

Definition at line 155 of file Parse.php.

Auth_OpenID_Parse.closeTag ( tag_name  ) 

Definition at line 161 of file Parse.php.

Auth_OpenID_Parse.htmlBegin ( s  ) 

Definition at line 167 of file Parse.php.

Auth_OpenID_Parse.htmlEnd ( s  ) 

Definition at line 179 of file Parse.php.

Auth_OpenID_Parse.headFind (  ) 

Definition at line 191 of file Parse.php.

Auth_OpenID_Parse.replaceEntities ( str  ) 

Definition at line 196 of file Parse.php.

Auth_OpenID_Parse.removeQuotes ( str  ) 

Definition at line 204 of file Parse.php.

Auth_OpenID_Parse.parseLinkAttrs ( html  ) 

Find all link tags in a string representing a HTML document and return a list of their attributes.

Parameters:
string $html The text to parse
Returns:
array $list An array of arrays of attributes, one for each link tag

Definition at line 227 of file Parse.php.

Auth_OpenID_Parse.relMatches ( rel_attr,
target_rel 
)

Definition at line 279 of file Parse.php.

Auth_OpenID_Parse.linkHasRel ( link_attrs,
target_rel 
)

Definition at line 294 of file Parse.php.

Auth_OpenID_Parse.findLinksRel ( link_attrs_list,
target_rel 
)

Definition at line 303 of file Parse.php.

Auth_OpenID_Parse.findFirstHref ( link_attrs_list,
target_rel 
)

Definition at line 318 of file Parse.php.


Member Data Documentation

Auth_OpenID_Parse.$_re_flags = "si"

Specify some flags for use with regex matching.

Definition at line 92 of file Parse.php.

Auth_OpenID_Parse.$_removed_re

Initial value:

           "<!--.*?-->|<!\[CDATA\[.*?\]\]>|<script\b(?!:)[^>]*>.*?<\/script>"
Stuff to remove before we start looking for tags

Definition at line 97 of file Parse.php.

Auth_OpenID_Parse.$_tag_expr = "<%s\b(?!:)([^>]*?)(?:\/>|>(.*?)(?:<\/?%s\s*>|\Z))"

Starts with the tag name at a word boundary, where the tag name is not a namespace

Definition at line 104 of file Parse.php.

Auth_OpenID_Parse.$_attr_find = '\b(\w+)=("[^"]*"|\'[^\']*\'|[^\'"\s\/<>]+)'

Definition at line 106 of file Parse.php.

Auth_OpenID_Parse.$_open_tag_expr = "<%s\b"

Definition at line 108 of file Parse.php.

Auth_OpenID_Parse.$_close_tag_expr = "<((\/%s\b)|(%s[^>\/]*\/))>"

Definition at line 109 of file Parse.php.


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

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