diff options
Diffstat (limited to 'src/HTML5/Parser')
-rw-r--r-- | src/HTML5/Parser/FileInputStream.php | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/HTML5/Parser/FileInputStream.php b/src/HTML5/Parser/FileInputStream.php new file mode 100644 index 0000000..ae3b4ef --- /dev/null +++ b/src/HTML5/Parser/FileInputStream.php @@ -0,0 +1,26 @@ +<?php +namespace HTML5\Parser; + +/** + * The FileInputStream loads a file to be parsed. + * + * @todo A buffered input stream would be useful. + */ +class FileInputStream extends StringInputStream implements InputStream { + + /** + * Load a file input stream. + * + * @param string $data + * The file or url path to load. + */ + function __construct($data, $encoding = 'UTF-8', $debug = '') { + + // Get the contents of the file. + $content = file_get_contents($data); + + parent::__construct($content, $encoding, $debug); + + } + +}
\ No newline at end of file |