| [ Index ] |
PHP Cross Reference of Limb3 |
[Source view] [Print] [Project Stats]
Base include file for SimpleTest
| Version: | $Id: page.php 5999 2007-06-18 13:13:08Z pachanga $ |
| File Size: | 975 lines (33 kb) |
| Included or required: | 0 times |
| Referenced: | 0 times |
| Includes or requires: | 0 files |
SimpleTagBuilder:: (4 methods):
createTag()
_createSelectionTag()
_createInputTag()
_keysToLowerCase()
SimplePageBuilder:: (12 methods):
SimplePageBuilder()
free()
parse()
_createPage()
_createParser()
startElement()
endElement()
_hasNamedTagOnOpenTagStack()
addContent()
_addContentToAllOpenTags()
_addContentTagToOpenTags()
_openTag()
SimplePage:: (48 methods):
SimplePage()
_extractResponse()
_noResponse()
getRequest()
getRaw()
getText()
getHeaders()
getMethod()
getUrl()
getRequestData()
getTransportError()
getMimeType()
getResponseCode()
getAuthentication()
getRealm()
getFrameFocus()
setFrameFocusByIndex()
setFrameFocus()
clearFrameFocus()
acceptTag()
acceptLabelStart()
acceptLabelEnd()
_isFormElement()
acceptFormStart()
acceptFormEnd()
acceptFramesetStart()
acceptFramesetEnd()
acceptFrame()
_isLoadingFrames()
_linkIsAbsolute()
_addLink()
acceptPageEnd()
hasFrames()
getFrameset()
getFrames()
getAbsoluteUrls()
getRelativeUrls()
getUrlsByLabel()
getUrlById()
_getUrlFromLink()
_makeAbsolute()
_setTitle()
getTitle()
getFormBySubmit()
getFormByImage()
getFormById()
setField()
getField()
Class: SimpleTagBuilder - X-Ref
Creates tags and widgets given HTML tag| createTag($name, $attributes) X-Ref |
| Factory for the tag objects. Creates the appropriate tag object for the incoming tag name and attributes. param: string $name HTML tag name. param: hash $attributes Element attributes. return: SimpleTag Tag object. |
| _createSelectionTag($attributes) X-Ref |
| Factory for selection fields. param: hash $attributes Element attributes. return: SimpleTag Tag object. |
| _createInputTag($attributes) X-Ref |
| Factory for input tags. param: hash $attributes Element attributes. return: SimpleTag Tag object. |
| _keysToLowerCase($map) X-Ref |
| Make the keys lower case for case insensitive look-ups. param: hash $map Hash to convert. return: hash Unchanged values, but keys lower case. |
Class: SimplePageBuilder - X-Ref
SAX event handler. Maintains a list of| SimplePageBuilder() X-Ref |
| Sets the builder up empty. |
| free() X-Ref |
| Frees up any references so as to allow the PHP garbage collection from unset() to work. |
| parse($response) X-Ref |
| Reads the raw content and send events into the page to be built. param: $response SimpleHttpResponse Fetched response. return: SimplePage Newly parsed page. |
| _createPage($response) X-Ref |
| Creates an empty page. return: SimplePage New unparsed page. |
| _createParser(&$listener) X-Ref |
| Creates the parser used with the builder. param: $listener SimpleSaxListener Target of parser. return: SimpleSaxParser Parser to generate |
| startElement($name, $attributes) X-Ref |
| Start of element event. Opens a new tag. param: string $name Element name. param: hash $attributes Attributes without content return: boolean False on parse error. |
| endElement($name) X-Ref |
| End of element event. param: string $name Element name. return: boolean False on parse error. |
| _hasNamedTagOnOpenTagStack($name) X-Ref |
| Test to see if there are any open tags awaiting closure that match the tag name. param: string $name Element name. return: boolean True if any are still open. |
| addContent($text) X-Ref |
| Unparsed, but relevant data. The data is added to every open tag. param: string $text May include unparsed tags. return: boolean False on parse error. |
| _addContentToAllOpenTags($text) X-Ref |
| Any content fills all currently open tags unless it is part of an option tag. param: string $text May include unparsed tags. |
| _addContentTagToOpenTags(&$tag) X-Ref |
| Parsed data in tag form. The parsed tag is added to every open tag. Used for adding options to select fields only. param: SimpleTag $tag Option tags only. |
| _openTag(&$tag) X-Ref |
| Opens a tag for receiving content. Multiple tags will be receiving input at the same time. param: SimpleTag $tag New content tag. |
Class: SimplePage - X-Ref
A wrapper for a web page.| SimplePage($response = false) X-Ref |
| Parses a page ready to access it's contents. param: SimpleHttpResponse $response Result of HTTP fetch. |
| _extractResponse($response) X-Ref |
| Extracts all of the response information. param: SimpleHttpResponse $response Response being parsed. |
| _noResponse() X-Ref |
| Sets up a missing response. |
| getRequest() X-Ref |
| Original request as bytes sent down the wire. return: mixed Sent content. |
| getRaw() X-Ref |
| Accessor for raw text of page. return: string Raw unparsed content. |
| getText() X-Ref |
| Accessor for plain text of page as a text browser would see it. return: string Plain text of page. |
| getHeaders() X-Ref |
| Accessor for raw headers of page. return: string Header block as text. |
| getMethod() X-Ref |
| Original request method. return: string GET, POST or HEAD. |
| getUrl() X-Ref |
| Original resource name. return: SimpleUrl Current url. |
| getRequestData() X-Ref |
| Original request data. return: mixed Sent content. |
| getTransportError() X-Ref |
| Accessor for last error. return: string Error from last response. |
| getMimeType() X-Ref |
| Accessor for current MIME type. return: string MIME type as string; e.g. 'text/html' |
| getResponseCode() X-Ref |
| Accessor for HTTP response code. return: integer HTTP response code received. |
| getAuthentication() X-Ref |
| Accessor for last Authentication type. Only valid straight after a challenge (401). return: string Description of challenge type. |
| getRealm() X-Ref |
| Accessor for last Authentication realm. Only valid straight after a challenge (401). return: string Name of security realm. |
| getFrameFocus() X-Ref |
| Accessor for current frame focus. Will be false as no frames. return: array Always empty. |
| setFrameFocusByIndex($choice) X-Ref |
| Sets the focus by index. The integer index starts from 1. param: integer $choice Chosen frame. return: boolean Always false. |
| setFrameFocus($name) X-Ref |
| Sets the focus by name. Always fails for a leaf page. param: string $name Chosen frame. return: boolean False as no frames. |
| clearFrameFocus() X-Ref |
| Clears the frame focus. Does nothing for a leaf page. |
| acceptTag(&$tag) X-Ref |
| Adds a tag to the page. param: SimpleTag $tag Tag to accept. |
| acceptLabelStart(&$tag) X-Ref |
| Opens a label for a described widget. param: SimpleFormTag $tag Tag to accept. |
| acceptLabelEnd() X-Ref |
| Closes the most recently opened label. |
| _isFormElement($name) X-Ref |
| Tests to see if a tag is a possible form element. param: string $name HTML element name. return: boolean True if form element. |
| acceptFormStart(&$tag) X-Ref |
| Opens a form. New widgets go here. param: SimpleFormTag $tag Tag to accept. |
| acceptFormEnd() X-Ref |
| Closes the most recently opened form. |
| acceptFramesetStart(&$tag) X-Ref |
| Opens a frameset. A frameset may contain nested frameset tags. param: SimpleFramesetTag $tag Tag to accept. |
| acceptFramesetEnd() X-Ref |
| Closes the most recently opened frameset. |
| acceptFrame(&$tag) X-Ref |
| Takes a single frame tag and stashes it in the current frame set. param: SimpleFrameTag $tag Tag to accept. |
| _isLoadingFrames() X-Ref |
| Test to see if in the middle of reading a frameset. return: boolean True if inframeset. |
| _linkIsAbsolute($url) X-Ref |
| Test to see if link is an absolute one. param: string $url Url to test. return: boolean True if absolute. |
| _addLink($tag) X-Ref |
| Adds a link to the page. param: SimpleAnchorTag $tag Link to accept. |
| acceptPageEnd() X-Ref |
| Marker for end of complete page. Any work in progress can now be closed. |
| hasFrames() X-Ref |
| Test for the presence of a frameset. return: boolean True if frameset. |
| getFrameset() X-Ref |
| Accessor for frame name and source URL for every frame that will need to be loaded. Immediate children only. return: boolean/array False if no frameset or |
| getFrames() X-Ref |
| Fetches a list of loaded frames. return: array/string Just the URL for a single page. |
| getAbsoluteUrls() X-Ref |
| Accessor for a list of all fixed links. return: array List of urls with scheme of |
| getRelativeUrls() X-Ref |
| Accessor for a list of all relative links. return: array List of urls without hostname. |
| getUrlsByLabel($label) X-Ref |
| Accessor for URLs by the link label. Label will match regardess of whitespace issues and case. param: string $label Text of link. return: array List of links with that label. |
| getUrlById($id) X-Ref |
| Accessor for a URL by the id attribute. param: string $id Id attribute of link. return: SimpleUrl URL with that id of false if none. |
| _getUrlFromLink($link) X-Ref |
| Converts a link into a target URL. param: SimpleAnchor $link Parsed link. return: SimpleUrl URL with frame target if any. |
| _makeAbsolute($url) X-Ref |
| Expands expandomatic URLs into fully qualified URLs. param: SimpleUrl $url Relative URL. return: SimpleUrl Absolute URL. |
| _setTitle(&$tag) X-Ref |
| Sets the title tag contents. param: SimpleTitleTag $tag Title of page. |
| getTitle() X-Ref |
| Accessor for parsed title. return: string Title or false if no title is present. |
| getFormBySubmit($selector) X-Ref |
| Finds a held form by button label. Will only search correctly built forms. param: SimpleSelector $selector Button finder. return: SimpleForm Form object containing |
| getFormByImage($selector) X-Ref |
| Finds a held form by image using a selector. Will only search correctly built forms. param: SimpleSelector $selector Image finder. return: SimpleForm Form object containing |
| getFormById($id) X-Ref |
| Finds a held form by the form ID. A way of identifying a specific form when we have control of the HTML code. param: string $id Form label. return: SimpleForm Form object containing the matching ID. |
| setField($selector, $value) X-Ref |
| Sets a field on each form in which the field is available. param: SimpleSelector $selector Field finder. param: string $value Value to set field to. return: boolean True if value is valid. |
| getField($selector) X-Ref |
| Accessor for a form element value within a page. param: SimpleSelector $selector Field finder. return: string/boolean A string if the field is |
| Generated: Mon Sep 8 04:35:41 2008 | Cross-referenced by PHPXref 0.7 |