Dotclear 2.25
Loading...
Searching...
No Matches
htmlValidator Class Reference

HTML Validator. More...

Inheritance diagram for htmlValidator:
netHttp netSocket

Public Member Functions

 __construct ()
 
 getDocument (string $fragment)
 
 perform (string $html, string $charset='UTF-8')
 
 getErrors ()
 
- Public Member Functions inherited from netHttp
 __construct ($host, int $port=80, ?int $timeout=null)
 
 get (string $path, $data=false)
 
 post (string $path, $data, ?string $charset=null)
 
 getStatus ()
 
 getContent ()
 
 getHeaders ()
 
 getHeader ($header)
 
 getCookies ()
 
 getRequestURL ()
 
 setHost (string $host, int $port=80)
 
 setProxy ($host, int $port=8080)
 
 setTimeout (int $timeout)
 
 setUserAgent (string $user_agent)
 
 setAuthorization (?string $username, ?string $password)
 
 setMoreHeader (string $header)
 
 voidMoreHeaders ()
 
 setCookies (array $cookies)
 
 useSSL (bool $flag)
 
 useGzip (bool $flag)
 
 setPersistCookies (bool $flag)
 
 setPersistReferers (bool $flag)
 
 setHandleRedirects (bool $flag)
 
 setMaxRedirects (int $num)
 
 setHeadersOnly (bool $flag)
 
 setDebug (bool $flag)
 
 setOutput (?string $out)
 
- Public Member Functions inherited from netSocket
 __construct (string $host, int $port, int $timeout=10)
 
 __destruct ()
 
 host (?string $host=null)
 
 port (?int $port=null)
 
 timeout (?int $timeout=null)
 
 setBlocking (bool $block)
 
 open ()
 
 close ()
 
 write ($data)
 
 flush ()
 
 isOpen ()
 

Static Public Member Functions

static validate (string $fragment, string $charset='UTF-8')
 
- Static Public Member Functions inherited from netHttp
static quickGet (string $url, ?string $output=null)
 
static quickPost (string $url, array $data, ?string $output=null)
 
static initClient (string $url, string &$path)
 
static readURL (string $url, bool &$ssl, string &$host, int &$port, string &$path, string &$user, string &$pass)
 

Protected Attributes

 $host = 'validator.w3.org'
 
 $path = '/nu/'
 
 $use_ssl = true
 
 $user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207'
 
 $timeout = 2
 
 $html_errors = ''
 
- Protected Attributes inherited from netHttp
 $host
 
 $port
 
 $path
 
 $method
 
 $postdata = ''
 
 $post_charset
 
 $cookies = []
 
 $referer
 
 $accept = 'text/xml,application/xml,application/xhtml+xml,text/html,text/plain,image/png,image/jpeg,image/gif,image/webp,*/*'
 
 $accept_encoding = 'gzip'
 
 $accept_language = 'en-us'
 
 $user_agent = 'Clearbricks HTTP Client'
 
 $more_headers = []
 
 $timeout = 10
 
 $use_ssl = false
 
 $use_gzip = false
 
 $persist_cookies = true
 
 $persist_referers = true
 
 $debug = false
 
 $handle_redirects = true
 
 $max_redirects = 5
 
 $headers_only = false
 
 $username
 
 $password
 
 $proxy_host
 
 $proxy_port
 
 $status
 
 $status_string
 
 $headers = []
 
 $content = ''
 
 $redirect_count = 0
 
 $cookie_host = ''
 
 $output = null
 
 $output_h = null
 
- Protected Attributes inherited from netSocket
 $_host
 
 $_port
 
 $_transport = ''
 
 $_timeout
 
 $_handle
 

Additional Inherited Members

- Protected Member Functions inherited from netHttp
 buildQueryString ($data)
 
 doRequest ()
 
 buildRequest ()
 
 outputOpen ()
 
 outputClose ()
 
 outputWrite ($content)
 
 debug (string $msg, $object=false)
 
- Protected Member Functions inherited from netSocket
 iterator ()
 

Detailed Description

HTML Validator.

This class will perform an HTML validation upon WDG validator.

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Constructor, no parameters.

References netSocket\host(), and netSocket\timeout().

Member Function Documentation

◆ getDocument()

getDocument ( string  $fragment)

HTML Document

Returns an HTML document from a $fragment.

Parameters
string$fragmentHTML content
Returns
string

◆ perform()

perform ( string  $html,
string  $charset = 'UTF-8' 
)

HTML validation

Performs HTML validation of $html.

Parameters
string$htmlHTML document
string$charsetDocument charset
Returns
boolean

References netHttp\getContent(), netHttp\getStatus(), netHttp\post(), and netHttp\setMoreHeader().

◆ getErrors()

getErrors ( )

Validation Errors

Returns
string HTML validation errors list

References $html_errors.

◆ validate()

static validate ( string  $fragment,
string  $charset = 'UTF-8' 
)
static

Static HTML validation

Static validation method of an HTML fragment. Returns an array with the following parameters:

  • valid (boolean)
  • errors (string)
Parameters
string$fragmentHTML content
string$charsetDocument charset
Returns
array

Referenced by dcRestMethods\validatePostMarkup().

Field Documentation

◆ $host

$host = 'validator.w3.org'
protected

◆ $path

$path = '/nu/'
protected

◆ $use_ssl

$use_ssl = true
protected

◆ $user_agent

$user_agent = 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207'
protected

◆ $timeout

$timeout = 2
protected

◆ $html_errors

$html_errors = ''
protected

Referenced by getErrors().


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