Moodle  2.2.1
http://www.collinsharper.com
SimplePage Class Reference

Public Member Functions

 SimplePage ($response=false)
 _extractResponse ($response)
 _noResponse ()
 getRequest ()
 getRaw ()
 getText ()
 getHeaders ()
 getMethod ()
 getUrl ()
 getBaseUrl ()
 getRequestData ()
 getTransportError ()
 getMimeType ()
 getResponseCode ()
 getAuthentication ()
 getRealm ()
 getFrameFocus ()
 setFrameFocusByIndex ($choice)
 setFrameFocus ($name)
 clearFrameFocus ()
 acceptTag (&$tag)
 acceptLabelStart (&$tag)
 acceptLabelEnd ()
 _isFormElement ($name)
 acceptFormStart (&$tag)
 acceptFormEnd ()
 acceptFramesetStart (&$tag)
 acceptFramesetEnd ()
 acceptFrame (&$tag)
 _isLoadingFrames ()
 _linkIsAbsolute ($url)
 _addLink ($tag)
 acceptPageEnd ()
 hasFrames ()
 getFrameset ()
 getFrames ()
 getUrls ()
 getUrlsByLabel ($label)
 getUrlById ($id)
 _getUrlFromLink ($link)
 expandUrl ($url)
 _setBase (&$tag)
 _setTitle (&$tag)
 getTitle ()
getFormBySubmit ($selector)
getFormByImage ($selector)
getFormById ($id)
 setField ($selector, $value, $position=false)
 getField ($selector)

Data Fields

 $_links
 $_title
 $_last_widget
 $_label
 $_left_over_labels
 $_open_forms
 $_complete_forms
 $_frameset
 $_frames
 $_frameset_nesting_level
 $_transport_error
 $_raw
 $_text
 $_sent
 $_headers
 $_method
 $_url
 $_base = false
 $_request_data

Detailed Description

Definition at line 334 of file page.php.


Member Function Documentation

_addLink ( tag)

Adds a link to the page.

Parameters:
SimpleAnchorTag$tagLink to accept. protected

Definition at line 723 of file page.php.

Here is the caller graph for this function:

_extractResponse ( response)

Extracts all of the response information.

Parameters:
SimpleHttpResponse$responseResponse being parsed. private

Definition at line 382 of file page.php.

Here is the caller graph for this function:

_getUrlFromLink ( link)

Converts a link tag into a target URL.

Parameters:
SimpleAnchor$linkParsed link.
Returns:
SimpleUrl URL with frame target if any. private

Definition at line 839 of file page.php.

Here is the call graph for this function:

Here is the caller graph for this function:

_isFormElement ( name)

Tests to see if a tag is a possible form element.

Parameters:
string$nameHTML element name.
Returns:
boolean True if form element. private

Definition at line 634 of file page.php.

Here is the caller graph for this function:

Test to see if in the middle of reading a frameset.

Returns:
boolean True if inframeset. private

Definition at line 700 of file page.php.

Here is the caller graph for this function:

_linkIsAbsolute ( url)

Test to see if link is an absolute one.

Parameters:
string$urlUrl to test.
Returns:
boolean True if absolute. protected

Definition at line 713 of file page.php.

Sets up a missing response. private

Definition at line 396 of file page.php.

Here is the caller graph for this function:

_setBase ( &$  tag)

Sets the base url for the page.

Parameters:
SimpleTag$tagBase URL for page. protected

Definition at line 867 of file page.php.

Here is the caller graph for this function:

_setTitle ( &$  tag)

Sets the title tag contents.

Parameters:
SimpleTitleTag$tagTitle of page. protected

Definition at line 877 of file page.php.

Here is the caller graph for this function:

Closes the most recently opened form. public

Definition at line 651 of file page.php.

acceptFormStart ( &$  tag)

Opens a form. New widgets go here.

Parameters:
SimpleFormTag$tagTag to accept. public

Definition at line 643 of file page.php.

acceptFrame ( &$  tag)

Takes a single frame tag and stashes it in the current frame set.

Parameters:
SimpleFrameTag$tagTag to accept. public

Definition at line 686 of file page.php.

Here is the call graph for this function:

Closes the most recently opened frameset. public

Definition at line 674 of file page.php.

Here is the call graph for this function:

acceptFramesetStart ( &$  tag)

Opens a frameset. A frameset may contain nested frameset tags.

Parameters:
SimpleFramesetTag$tagTag to accept. public

Definition at line 663 of file page.php.

Here is the call graph for this function:

Closes the most recently opened label. public

Definition at line 615 of file page.php.

Here is the call graph for this function:

acceptLabelStart ( &$  tag)

Opens a label for a described widget.

Parameters:
SimpleFormTag$tagTag to accept. public

Definition at line 606 of file page.php.

Marker for end of complete page. Any work in progress can now be closed. public

Definition at line 732 of file page.php.

acceptTag ( &$  tag)

Adds a tag to the page.

Parameters:
SimpleTag$tagTag to accept. public

Definition at line 586 of file page.php.

Here is the call graph for this function:

Clears the frame focus. Does nothing for a leaf page. public

Definition at line 578 of file page.php.

expandUrl ( url)

Expands expandomatic URLs into fully qualified URLs.

Parameters:
SimpleUrl$urlRelative URL.
Returns:
SimpleUrl Absolute URL. public

Definition at line 854 of file page.php.

Here is the call graph for this function:

Here is the caller graph for this function:

Accessor for last Authentication type. Only valid straight after a challenge (401).

Returns:
string Description of challenge type. public

Definition at line 524 of file page.php.

Base URL if set via BASE tag page url otherwise

Returns:
SimpleUrl Base url. public

Definition at line 472 of file page.php.

Here is the caller graph for this function:

getField ( selector)

Accessor for a form element value within a page.

Parameters:
SimpleSelector$selectorField finder.
Returns:
string/boolean A string if the field is present, false if unchecked and null if missing. public

Definition at line 973 of file page.php.

& getFormById ( id)

Finds a held form by the form ID. A way of identifying a specific form when we have control of the HTML code.

Parameters:
string$idForm label.
Returns:
SimpleForm Form object containing the matching ID. public

Definition at line 937 of file page.php.

& getFormByImage ( selector)

Finds a held form by image using a selector. Will only search correctly built forms.

Parameters:
SimpleSelector$selectorImage finder.
Returns:
SimpleForm Form object containing the image. public

Definition at line 919 of file page.php.

& getFormBySubmit ( selector)

Finds a held form by button label. Will only search correctly built forms.

Parameters:
SimpleSelector$selectorButton finder.
Returns:
SimpleForm Form object containing the button. public

Definition at line 901 of file page.php.

Accessor for current frame focus. Will be false as no frames.

Returns:
array Always empty. public

Definition at line 550 of file page.php.

getFrames ( )

Fetches a list of loaded frames.

Returns:
array/string Just the URL for a single page. public

Definition at line 781 of file page.php.

Here is the call graph for this function:

Accessor for frame name and source URL for every frame that will need to be loaded. Immediate children only.

Returns:
boolean/array False if no frameset or otherwise a hash of frame URLs. The key is either a numerical base one index or the name attribute. public

Definition at line 763 of file page.php.

Here is the call graph for this function:

Accessor for raw headers of page.

Returns:
string Header block as text. public

Definition at line 442 of file page.php.

getMethod ( )

Original request method.

Returns:
string GET, POST or HEAD. public

Definition at line 454 of file page.php.

Accessor for current MIME type.

Returns:
string MIME type as string; e.g. 'text/html' public

Definition at line 499 of file page.php.

getRaw ( )

Accessor for raw text of page.

Returns:
string Raw unparsed content. public

Definition at line 420 of file page.php.

getRealm ( )

Accessor for last Authentication realm. Only valid straight after a challenge (401).

Returns:
string Name of security realm. public

Definition at line 537 of file page.php.

Original request as bytes sent down the wire.

Returns:
mixed Sent content. public

Definition at line 411 of file page.php.

Original request data.

Returns:
mixed Sent content. public

Definition at line 481 of file page.php.

Accessor for HTTP response code.

Returns:
integer HTTP response code received. public

Definition at line 511 of file page.php.

getText ( )

Accessor for plain text of page as a text browser would see it.

Returns:
string Plain text of page. public

Definition at line 430 of file page.php.

Here is the call graph for this function:

getTitle ( )

Accessor for parsed title.

Returns:
string Title or false if no title is present. public

Definition at line 886 of file page.php.

Accessor for last error.

Returns:
string Error from last response. public

Definition at line 490 of file page.php.

getUrl ( )

Original resource name.

Returns:
SimpleUrl Current url. public

Definition at line 463 of file page.php.

Here is the caller graph for this function:

getUrlById ( id)

Accessor for a URL by the id attribute.

Parameters:
string$idId attribute of link.
Returns:
SimpleUrl URL with that id of false if none. public

Definition at line 824 of file page.php.

Here is the call graph for this function:

getUrls ( )

Accessor for a list of all links.

Returns:
array List of urls with scheme of http or https and hostname. public

Definition at line 792 of file page.php.

Here is the call graph for this function:

getUrlsByLabel ( label)

Accessor for URLs by the link label. Label will match regardess of whitespace issues and case.

Parameters:
string$labelText of link.
Returns:
array List of links with that label. public

Definition at line 808 of file page.php.

Here is the call graph for this function:

hasFrames ( )

Test for the presence of a frameset.

Returns:
boolean True if frameset. public

Definition at line 750 of file page.php.

setField ( selector,
value,
position = false 
)

Sets a field on each form in which the field is available.

Parameters:
SimpleSelector$selectorField finder.
string$valueValue to set field to.
Returns:
boolean True if value is valid. public

Definition at line 955 of file page.php.

setFrameFocus ( name)

Sets the focus by name. Always fails for a leaf page.

Parameters:
string$nameChosen frame.
Returns:
boolean False as no frames. public

Definition at line 570 of file page.php.

setFrameFocusByIndex ( choice)

Sets the focus by index. The integer index starts from 1.

Parameters:
integer$choiceChosen frame.
Returns:
boolean Always false. public

Definition at line 560 of file page.php.

SimplePage ( response = false)

Parses a page ready to access it's contents.

Parameters:
SimpleHttpResponse$responseResult of HTTP fetch. public

Definition at line 360 of file page.php.

Here is the call graph for this function:


Field Documentation

$_base = false

Definition at line 352 of file page.php.

$_complete_forms

Definition at line 341 of file page.php.

$_frames

Definition at line 343 of file page.php.

$_frameset

Definition at line 342 of file page.php.

$_frameset_nesting_level

Definition at line 344 of file page.php.

$_headers

Definition at line 349 of file page.php.

$_label

Definition at line 338 of file page.php.

$_last_widget

Definition at line 337 of file page.php.

$_left_over_labels

Definition at line 339 of file page.php.

$_links

Definition at line 335 of file page.php.

$_method

Definition at line 350 of file page.php.

$_open_forms

Definition at line 340 of file page.php.

$_raw

Definition at line 346 of file page.php.

$_request_data

Definition at line 353 of file page.php.

$_sent

Definition at line 348 of file page.php.

$_text

Definition at line 347 of file page.php.

$_title

Definition at line 336 of file page.php.

$_transport_error

Definition at line 345 of file page.php.

$_url

Definition at line 351 of file page.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations