Skip to content
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

Merged
merged 6 commits into from
Oct 31, 2024

Conversation

adamziel
Copy link
Collaborator

@adamziel adamziel commented Oct 29, 2024

Merge WP_XML_Tag_Processor and WP_XML_Processor into a single WP_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.

@adamziel adamziel added the [Type] Enhancement New feature or request label Oct 29, 2024
@adamziel adamziel linked an issue Oct 31, 2024 that may be closed by this pull request
85 tasks
@adamziel adamziel marked this pull request as ready for review October 31, 2024 12:34
@adamziel adamziel merged commit 33e7d55 into trunk Oct 31, 2024
10 checks passed
@adamziel adamziel deleted the merge-xml-processors-into-one branch October 31, 2024 12:34
@@ -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();
Copy link
Member

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?

Copy link
Collaborator Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Tracking Issue: Next-gen PHP Importers for Data Liberation
2 participants