comparison OnlineBufferValidator.inc.php @ 134:b6b4a58c7625

Using .inc.php rather than just .inc for include files.
author Tom Fredrik Blenning <bfg@bfgconsult.no>
date Sun, 22 Jan 2023 19:22:00 +0100
parents OnlineBufferValidator.inc@2370f4450983
children
comparison
equal deleted inserted replaced
133:00255ca89459 134:b6b4a58c7625
1 <?php
2 include_once 'ScriptIncludeCache.inc.php';
3
4 /// @cond
5 $baseDir = dirname(__FILE__);
6 $cache = ScriptIncludeCache::instance(__FILE__);
7 $cache->includeOnce('Http.inc.php', $baseDir);
8 $cache->includeOnce('OnlineValidator.inc.php', $baseDir);
9 /// @endcond
10
11
12 /**
13 * Defines a validator which uses an online validator and a buffer
14 * with the content
15 */
16 class OnlineBufferValidator extends OnlineValidator
17 {
18
19 private $buffer;
20
21 /**
22 * Constructs an OnlineURIValidator
23 *
24 * @param $buffer The buffer to validate
25 */
26 function __construct($buffer)
27 {
28 $this->buffer = $buffer;
29 }
30
31 function check()
32 {
33 $params = array( 'fragment' => $this->buffer);
34
35 $headers = Http::postHeaders($this->validator_url , $params, 2);
36 return $headers['X-W3C-Validator-Status'] === "Valid";
37 }
38 }
39 ?>