-
Notifications
You must be signed in to change notification settings - Fork 275
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Data Liberation] Filesystem entity reader
A part of #1894 Adds a new API for loading content from a WP_Filesystem instance: * `WP_Filesystem_To_Post_Tree` for traversing a directory tree and mapping the structure a hierarchical WordPress post/meta entity stream * `WP_Filesystem_Entity_Reader` for converting the raw file content into WordPress blocks To convert a set of zipped files into WordPress entities: ```php // Any Filesystem instance works here. Could be WP_Local_Filesystem, // WP_Git_Filesystem, or anything else. Let's read from a zip file here: $fs = new WP_Zip_Filesystem( WP_File_Reader::create('./docs.zip') ); $reader = new WP_Filesystem_Entity_Reader( $fs ); foreach($reader as $entity) { var_dump($entity); } ``` ## Testing The code isn't used anywhere yet – just rely on the CI checks.
- Loading branch information
Showing
10 changed files
with
633 additions
and
347 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule blueprints-library
updated
14 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
342 changes: 0 additions & 342 deletions
342
packages/playground/data-liberation/src/entity-readers/WP_Directory_Tree_Entity_Reader.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.