-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Data Liberation] Merge both XML processors into a single WP_XML_Processor #1960
Conversation
…essor Description TBD
… more input" state and "parse error" state
…ting out of sync with text_starts_at
@@ -11,6 +11,7 @@ public function __construct( $file_path, $chunk_size = 8096 ) { | |||
$this->file_path = $file_path; | |||
$this->chunk_size = $chunk_size; | |||
parent::__construct(); | |||
$this->append_eof(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand anything about this processor yet and am asking questions.
Why did this need to be added?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The processors have two states:
- Expecting more data. Some syntax errors are then treated as "oh we're actually pausing and waiting for more data".
- No more data is coming. All errors are treated as "the input is invalid".
EOF marks a transition point between the two states.
Still, I'm questioning the need for these stream classes. They add yet another concept to learn.
Merge
WP_XML_Tag_Processor
andWP_XML_Processor
into a singleWP_XML_Processor
class. This reduces abstractions, enables keeping more properties as private, and simplifies the code.Related to #1894 and WordPress/wordpress-develop#6713
Testing instructions
Confirm the CI tests pass.