Minor dependency updates
[yaffs-website] / vendor / masterminds / html5 / src / HTML5 / Parser / FileInputStream.php
1 <?php
2 namespace Masterminds\HTML5\Parser;
3
4 /**
5  * The FileInputStream loads a file to be parsed.
6  *
7  * So right now we read files into strings and then process the
8  * string. We chose to do this largely for the sake of expediency of
9  * development, and also because we could optimize toward processing
10  * arbitrarily large chunks of the input. But in the future, we'd
11  * really like to rewrite this class to efficiently handle lower level
12  * stream reads (and thus efficiently handle large documents).
13  *
14  * @todo A buffered input stream would be useful.
15  */
16 class FileInputStream extends StringInputStream implements InputStream
17 {
18
19     /**
20      * Load a file input stream.
21      *
22      * @param string $data
23      *            The file or url path to load.
24      */
25     public function __construct($data, $encoding = 'UTF-8', $debug = '')
26     {
27         // Get the contents of the file.
28         $content = file_get_contents($data);
29
30         parent::__construct($content, $encoding, $debug);
31     }
32 }