Conversation
|
Note: This PR current does a simple str_replace() of attachment URLs and definitely breaks GUIDs and maybe other things. 🙀 So ... a next step is to make targeted replacements using proper XML parser and real URL replacement. |
| if ( !$output_stream ) { | ||
| $output_stream = fopen('php://output', 'wb'); | ||
| } | ||
| $zip_writer = new ZipStreamWriter( $output_stream ); |
There was a problem hiding this comment.
Let's try packaging the data using the same WP_Entity objects as the importer. We could then have a single streaming export pipeline that knows how to deal with entities on one end, and uses an arbitrary export drivers on the other end, e.g. WXR, Markdown, HTML, etc.
Even more importantly, we could serialize the exported entities, send them over the wire, and import without using any particular data format. That's important for site sync protocol and for things like the Try WordPress extension. Plus we could extend it to more data types, e.g. SQL dumps, Blueprint steps, etc.
There was a problem hiding this comment.
✅ @adamziel, I don't know exactly what this means yet but will look at the importer work for reference.
There was a problem hiding this comment.
I spoke with Adam, and what we are talking about is basically making a WP_Entity iterator API that can be used to read WP entities from a site. Then the entity iterator API can be used to implement multiple exporters.
There was a problem hiding this comment.
The plan for this PR is to just tweak URL replacement to work properly and then leave open as a draft until it can be replaced with a proper exporter based on the entity iterator.
|
This work is superseded by work in the WordPress/php-toolkit repo. |
Motivation for the change, related issues
This PR explores a basic export that creates a zip containing a full WXR and all uploads.
Related to #2055
cc @adamziel
Implementation details
wp-content/uploadsTesting Instructions (or ideally a Blueprint)
TBD
For manual testing, this PR adds a temporary endpoint for downloading a site's full export zip. GET
/_data_liberation_test_exportto receive an export zip.