Mercurial > SimpleWebPresenter
view OnlineBufferValidator.inc @ 93:8aadd7a23b68
Moved some functionality from common-functions into Http class.
Reorganized Validator into a class hierarchy.
Added functionality for validating with a buffer in addition to URLs.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Thu, 18 Oct 2012 16:44:48 +0200 |
| parents | |
| children | 2370f4450983 |
line wrap: on
line source
<?php include_once 'ScriptIncludeCache.inc'; /// @cond $baseDir = dirname(__FILE__); $cache = ScriptIncludeCache::instance(__FILE__); $cache->includeOnce('Http.inc', $baseDir); $cache->includeOnce('OnlineValidator.inc', $baseDir); /// @endcond class OnlineBufferValidator extends OnlineValidator { private $buffer; function __construct($buffer) { $this->buffer = $buffer; } function check() { $params = array( 'fragment' => $this->buffer); $headers = Http::postHeaders($this->validator_url , $params, 2); return $headers['X-W3C-Validator-Status'] === "Valid"; } } ?>
