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

Class: Services_W3C_HTMLValidator

Source Location: /Services_W3C_HTMLValidator-0.2.0/HTMLValidator.php

Class Overview


A simple class for utilizing the W3C HTML Validator service.


Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 31]
A simple class for utilizing the W3C HTML Validator service.


[ Top ]


Class Variables

$charset =

[line 81]

Character encoding

Character encoding override: Specify the character encoding to use when parsing the document. When used with the auxiliary parameter fbc set to 1, the given encoding will only be used as a fallback value, in case the charset is absent or unrecognized. Note that this parameter is ignored if validating a fragment with the direct input interface.

  • Access: public

Type:   string


[ Top ]

$doctype =

[line 102]

Document type

Document Type override: Specify the Document Type (DOCTYPE) to use when parsing the document. When used with the auxiliary parameter fbd set to 1, the given document type will only be used as a fallback value, in case the document's DOCTYPE declaration is missing or unrecognized.

  • Access: public

Type:   string


[ Top ]

$fbc =

[line 91]

Fall Back Character Set

When no character encoding is detected in the document, use the value in $charset as the fallback character set.

  • Access: public

Type:   bool


[ Top ]

$fbd =

[line 112]

Fall back doctype

When set to 1, use the value stored in $doctype when the document type cannot be automatically determined.

  • Access: public

Type:   bool


[ Top ]

$fragment =

[line 60]

HTML fragment to validate.

Full documents only. At the moment, will only work if data is sent with the UTF-8 encoding.

  • Access: public

Type:   string


[ Top ]

$outline =  false

[line 141]

outline

In the web interface, when set to 1, triggers the display of the document outline after the validation results. In SOAP output, does not have any impact.

  • Access: public

Type:   bool


[ Top ]

$output =  'soap12'

[line 69]

Output format

Triggers the various outputs formats of the validator. If unset, the usual Web format will be sent. If set to soap12, the SOAP1.2 interface will be triggered. See below for the SOAP 1.2 response format description.

  • Access: public

Type:   mixed


[ Top ]

$request =

[line 147]

HTTP_Request object.
  • Access: protected

Type:   object


[ Top ]

$ss =  false

[line 131]

Show source

In the web interface, triggers the display of the source after the validation results. In SOAP output, does not have any impact.

  • Access: public

Type:   bool


[ Top ]

$uploaded_file =

[line 51]

Internally used filename of a file to upload to the validator

POSTed as multipart/form-data

  • Access: public

Type:   string


[ Top ]

$uri =

[line 44]

The URL of the document to validate
  • Access: public

Type:   string


[ Top ]

$validator_uri =  'http://validator.w3.org/check'

[line 38]

URI to the w3 validator.
  • Access: public

Type:   string


[ Top ]

$verbose =  false

[line 122]

Verbose output

In the web interface, when set to 1, will make error messages, explanations and other diagnostics more verbose. In SOAP output, does not have any impact.

  • Access: public

Type:   bool


[ Top ]



Method Detail

__construct (Constructor)   [line 152]

Services_W3C_HTMLValidator __construct( [ $options = array()])

Constructor for the class.

Parameters:

   $options   — 

[ Top ]

buildRequest   [line 236]

void buildRequest( [ $type = 'uri'])

Prepares a request object to send to the validator.
  • Access: protected

Parameters:

   $type   — 

[ Top ]

parseSOAP12Response   [line 301]

mixed parseSOAP12Response( string $xml)

Parse an XML response from the validator

This function parses a SOAP 1.2 response xml string from the validator.

  • Return: object Services_W3C_HTMLValidator_Response | bool false

Parameters:

string   $xml   — 

[ Top ]

sendRequest   [line 284]

bool sendRequest( )

Actually sends the request to the HTML Validator service
  • Return: true | false
  • Access: protected

[ Top ]

setOptions   [line 163]

void setOptions( array $options)

Sets options for the class.

Pass an associative array of options for the class.


Parameters:

array   $options   — 

[ Top ]

validate   [line 179]

mixed validate( string $uri)

Validates a given URI

Executes the validator using the current parameters and returns a Response object on success.

  • Return: object Services_W3C_HTMLValidator | bool false

Parameters:

string   $uri   — 

[ Top ]

validateFile   [line 199]

mixed validateFile( string $file)

Validates the local file

Requests validation on the local file, from an instance of the W3C validator. The file is posted to the W3 validator using multipart/form-data.

  • Return: object Services_W3C_HTMLValidator | bool fals

Parameters:

string   $file   —  file to be validated.

[ Top ]

validateFragment   [line 221]

mixed validateFragment( string $html)

Validate an html string
  • Return: object Services_W3C_HTMLValidator | bool fals

Parameters:

string   $html   —  full html document fragment

[ Top ]


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