Class WPDA_Data_Export

This class offers support to manage unattended data exports. Data exports can be run once only or scheduled. Every data backup has a unique name to identify it. The data backup name is used in combination with the date and time to create a unique file name.

author Peter Schulz
since 1.0.0
package WPDataAccess\Backup

 Methods

WPDA_Data_Export constructor

__construct() 

Gets and stores the scheduled cron jobs.

Data entry form to add or update a data backup

create_export(string $action) 

Parameters

$action

string

Add for new export; Update to edit existing export

Show available cron jobs

show_wp_cron() 

Shows data backups only be default. Other cron jobs can be displayed as well.

Create a cron job for data export

wpda_add_cron_job() 

Backup ID = $_REQUEST['backupid']

Prepares an unattended data backup (export)

wpda_data_backup(string $backupid) 

Parameters

$backupid

string

Unique ID that identifies a data backup

Exceptions

\GuzzleHttp\Exception\GuzzleException

Remove a data backup from cron

wpda_remove_cron_job() 

Backup ID = $_REQUEST['schedule_args']

Update a data backup

wpda_update_cron_job() 

Backup ID = $_REQUEST['backupid']

Performs an unattended data backup (export)

wpda_data_backup_run(string $backupid, integer $keep, string $device, array $tables) 

Parameters

$backupid

string

Unique ID that identifies a data backup

$keep

integer

Number of backup files to be kept

$device

string

Location where export file is stored

$tables

array

Tables to be exported

Exceptions

\GuzzleHttp\Exception\GuzzleException

 Properties

 

Holds the scheduled cron jobs

$schedules : array

Default

 Constants

 

PREFIX_RUNONCE

PREFIX_RUNONCE = 'wpda-run-once-' 
 

SHOW_JOBS_OPTION_NAME

SHOW_JOBS_OPTION_NAME = 'wpda_data_backup_show_jobs'