first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
/**
* Interface for Batch Exporter
*
* @package PUM
* @copyright Copyright (c) 2023, Code Atlantic LLC
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Promise for structuring exporters.
*
* @since 1.7.0
*/
interface PUM_Interface_Batch_Exporter {
/**
* Determines whether the current user can perform an export.
*
* @return bool Whether the current user can perform an export.
*/
public function can_export();
/**
* Handles sending appropriate headers depending on the type of export.
*
* @return void
*/
public function headers();
/**
* Retrieves the data for export.
*
* @return array[] Multi-dimensional array of data for export.
*/
public function get_data();
/**
* Performs the export process.
*
* @return void
*/
public function export();
}

View File

@@ -0,0 +1,41 @@
<?php
/**
* Interface for Batch Importer
*
* @package PUM
* @copyright Copyright (c) 2023, Code Atlantic LLC
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Promise for structuring importers.
*
* @since 1.7.0
*/
interface PUM_Interface_Batch_Importer {
/**
* Determines whether the current user can perform an import.
*
* @return bool Whether the current user can perform an import.
*/
public function can_import();
/**
* Prepares the data for import.
*
* @return array[] Multi-dimensional array of data for import.
*/
public function get_data();
/**
* Performs the import process.
*
* @return void
*/
public function import();
}

View File

@@ -0,0 +1,37 @@
<?php
/**
* Interface for Batch PrefetchProcess
*
* @package PUM
* @copyright Copyright (c) 2023, Code Atlantic LLC
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Second-level interface for registering a batch process that leverages
* pre-fetch and data storage.
*
* @since 1.7.0
*/
interface PUM_Interface_Batch_PrefetchProcess extends PUM_Interface_Batch_Process {
/**
* Initializes the batch process.
*
* This is the point where any relevant data should be initialized for use by the processor methods.
*
* @param null|mixed $data
*
* @return void
*/
public function init( $data = null );
/**
* Pre-fetches data to speed up processing.
*/
public function pre_fetch();
}

View File

@@ -0,0 +1,55 @@
<?php
/**
* Interface for Batch Process
*
* @package PUM
* @copyright Copyright (c) 2023, Code Atlantic LLC
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Base interface for registering a batch process.
*
* @since 1.7.0
*/
interface PUM_Interface_Batch_Process {
/**
* Determines if the current user can perform the current batch process.
*
* @return bool True if the current user has the needed capability, otherwise false.
*/
public function can_process();
/**
* Processes a single step (batch).
*
* @return int|string|WP_Error Next step number, 'done', or a WP_Error object.
*/
public function process_step();
/**
* Retrieves the calculated completion percentage.
*
* @return int Percentage completed.
*/
public function get_percentage_complete();
/**
* Retrieves a message based on the given message code.
*
* @param string $code Message code.
*
* @return string Message.
*/
public function get_message( $code );
/**
* Defines logic to execute once batch processing is complete.
*/
public function finish();
}