PluginProbe ʕ •ᴥ•ʔ
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets / 4.1.1
WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets v4.1.1
4.1.1 3.9.5 3.9.6 4.0.0 4.0.1 4.1.0 trunk 2.12 2.13 2.14 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.2.8 3.2.9 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 3.4.0 3.4.1 3.4.2 3.4.3 3.4.4 3.4.5 3.4.6 3.4.7 3.4.8 3.4.9 3.5.0 3.5.1 3.5.2 3.5.3 3.5.4 3.5.5 3.5.6 3.5.7 3.5.8 3.5.9 3.6.0 3.6.1 3.6.2 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9 3.7.0 3.7.1 3.7.2 3.7.3 3.7.3-beta-1.0 3.7.4 3.7.4-beta-1.0 3.7.5 3.7.6 3.7.7 3.7.8 3.7.9 3.8.0 3.9.0 3.9.1 3.9.2 3.9.3 3.9.4
wp-all-import / libraries / XmlImportStringReader.php
wp-all-import / libraries Last commit date
ast 1 month ago XmlImportConfig.php 1 month ago XmlImportCsvParse.php 1 month ago XmlImportException.php 1 month ago XmlImportParser.php 1 month ago XmlImportReaderInterface.php 1 month ago XmlImportSQLParse.php 1 month ago XmlImportStringReader.php 1 month ago XmlImportTemplate.php 1 month ago XmlImportTemplateCodeGenerator.php 1 month ago XmlImportTemplateParser.php 1 month ago XmlImportTemplateScanner.php 3 days ago XmlImportToken.php 1 month ago XmlImportXLSParse.php 1 month ago wpaipclzip.lib.php 1 month ago
XmlImportStringReader.php
68 lines
1 <?php
2 // phpcs:disable WordPress.NamingConventions.PrefixAllGlobals
3 /**
4 * @author Olexandr Zanichkovsky <olexandr.zanichkovsky@zophiatech.com>
5 * @package General
6 */
7
8 require_once dirname(__FILE__) . '/XmlImportReaderInterface.php';
9
10 /**
11 * Allows to either peek or read a character from a string buffer
12 */
13 class XmlImportStringReader implements XmlImportReaderInterface
14 {
15 /**
16 * String buffer
17 *
18 * @var string
19 */
20 private $buffer;
21
22 /**
23 * Current index
24 *
25 * @var int
26 */
27 private $index = -1;
28
29 /**
30 * Creates new instance
31 *
32 * @param string $input
33 */
34 public function __construct($input)
35 {
36 if (is_string($input))
37 $this->buffer = $input;
38 else
39 throw new InvalidArgumentException(esc_html("String expected as argument."));
40 }
41
42 /**
43 * Returns the next symbol from the buffer without changes to current index
44 * or false if buffer ends
45 *
46 * @return string
47 */
48 public function peek()
49 {
50 if ($this->index + 1 >= strlen($this->buffer))
51 return false;
52 else
53 return $this->buffer[$this->index + 1];
54 }
55
56 /**
57 * Returns the next symbol from the buffer or false if buffer is ended
58 *
59 * @return string
60 */
61 public function read()
62 {
63 $result = $this->peek();
64 if ($this->index < strlen($this->buffer))
65 $this->index++;
66 return $result;
67 }
68 }