← All changes
|
wp-includes/database/mysql/class-wp-mysql-parser.php
+16
-0
2.2.23
→
3.1.0
View file →
| @@ -1,6 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +/** | |
| 4 | + * MySQL parser used by the SQLite driver. | |
| 5 | + * | |
| 6 | + * @access private | |
| 7 | + */ | |
| 3 | 8 | class WP_MySQL_Parser extends WP_Parser { |
| 4 | 9 | /** |
| 5 | 10 | * The current query AST. |
| 6 | 11 | * |
| @@ -6,8 +11,19 @@ | ||
| 6 | 11 | * |
| 7 | 12 | * @var WP_Parser_Node|null |
| 8 | 13 | */ |
| 9 | 14 | private $current_ast; |
| 15 | + | |
| 16 | + /** | |
| 17 | + * Reset this parser with a new token stream. | |
| 18 | + * | |
| 19 | + * @param array<WP_Parser_Token> $tokens The parser tokens. | |
| 20 | + */ | |
| 21 | + public function reset_tokens( array $tokens ): void { | |
| 22 | + $this->tokens = $tokens; | |
| 23 | + $this->position = 0; | |
| 24 | + $this->current_ast = null; | |
| 25 | + } | |
| 10 | 26 | |
| 11 | 27 | /** |
| 12 | 28 | * Parse the next query from the input SQL string. |
| 13 | 29 | * |