comparison vendor/masterminds/html5/src/HTML5/Parser/FileInputStream.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
comparison
equal deleted inserted replaced
3:307d7a7fd348 4:a9cd425dd02b
1 <?php 1 <?php
2
2 namespace Masterminds\HTML5\Parser; 3 namespace Masterminds\HTML5\Parser;
3 4
4 /** 5 /**
5 * The FileInputStream loads a file to be parsed. 6 * The FileInputStream loads a file to be parsed.
6 * 7 *
9 * development, and also because we could optimize toward processing 10 * development, and also because we could optimize toward processing
10 * arbitrarily large chunks of the input. But in the future, we'd 11 * 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 * really like to rewrite this class to efficiently handle lower level
12 * stream reads (and thus efficiently handle large documents). 13 * stream reads (and thus efficiently handle large documents).
13 * 14 *
14 * @todo A buffered input stream would be useful. 15 * @deprecated since 2.4, to remove in 3.0. Use a string in the scanner instead.
15 */ 16 */
16 class FileInputStream extends StringInputStream implements InputStream 17 class FileInputStream extends StringInputStream implements InputStream
17 { 18 {
18
19 /** 19 /**
20 * Load a file input stream. 20 * Load a file input stream.
21 * 21 *
22 * @param string $data 22 * @param string $data The file or url path to load.
23 * The file or url path to load. 23 * @param string $encoding The encoding to use for the data.
24 * @param string $debug A fprintf format to use to echo the data on stdout.
24 */ 25 */
25 public function __construct($data, $encoding = 'UTF-8', $debug = '') 26 public function __construct($data, $encoding = 'UTF-8', $debug = '')
26 { 27 {
27 // Get the contents of the file. 28 // Get the contents of the file.
28 $content = file_get_contents($data); 29 $content = file_get_contents($data);