PHP 8.0.30
Preview: interface-entity-reader.php Size: 1.25 KB
/proc/self/cwd/wp/wp-content/plugins/wordpress-importer/php-toolkit/DataLiberation/EntityReader/interface-entity-reader.php

<?php

namespace WordPress\DataLiberation\EntityReader;

/**
 * The Entity Reader ingests content from a source and breaks it down into
 * individual "entities" that WordPress understands - posts, comments, metadata, etc.
 */
interface EntityReader {

	/**
	 * Gets the current entity being processed.
	 *
	 * @return ImportedEntity|false The current entity, or false if none available
	 */
	public function get_entity();

	/**
	 * Advances to the next entity in the source content.
	 *
	 * This is where each data source implements its own logic for parsing the bytes
	 * and extracting the next meaningful piece of content.
	 *
	 * @return bool Whether we successfully moved to the next entity
	 */
	public function next_entity();

	/**
	 * Checks if we've processed everything from the source.
	 *
	 * @return bool Whether we've processed everything from the source
	 */
	public function is_finished(): bool;

	/**
	 * Returns a cursor position that can be used to resume processing later.
	 *
	 * This allows for processing large imports in chunks without losing your place.
	 * Not all readers support this yet.
	 *
	 * @TODO: Define a general interface for entity readers.
	 * @return string Position marker for resuming later
	 */
	public function get_reentrancy_cursor();
}

Directory Contents

Dirs: 0 × Files: 3

Name Size Perms Modified Actions
30.19 KB lrw-r--r-- 2026-04-02 06:14:57
Edit Download
1.25 KB lrw-r--r-- 2026-04-02 06:14:57
Edit Download
1.25 KB lrw-r--r-- 2026-04-02 06:14:57
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).