BC Migration Documentation

APIIDA extends CLICommands

APIIDA CLI class.

Table of Contents

Properties

$notices  : array<string|int, array{type: string, message: string}>
WP CLI notices.
$upload_path  : string
Upload path
$upload_url  : string
Upload URL

Methods

add_notice()  : void
Adds a notice to be displayed at the end of the command.
display_notices()  : void
Display the notices. The output is WP_CLI.
get_notices()  : array<string|int, array{type: string, message: string}>
Get all notices.
get_upload_path()  : string
Get the upload path.
get_upload_url()  : string
Get the upload URL.
migrate()  : void
Migrates APIIDA data.
reset_notices()  : void
Reset all notices.
set_upload_path()  : void
Set the upload path.
set_upload_url()  : void
Set the upload URL.
export_csv()  : void
Create and write to a CSV file
migrate_reports()  : void
Migrates APIIDA reports to the database.
remove_directory()  : bool
Removes a directory recursively.
remove_folder()  : void
Removes the APIIDA uploads folder.

Properties

$notices

WP CLI notices.

public array<string|int, array{type: string, message: string}> $notices = array()

Methods

add_notice()

Adds a notice to be displayed at the end of the command.

public add_notice([string $message = '' ][, string $type = 'log' ]) : void
Parameters
$message : string = ''

The message to display.

$type : string = 'log'

The type of notice. One of 'log', 'success', 'warning', 'error'. Default is 'log'.

display_notices()

Display the notices. The output is WP_CLI.

public display_notices() : void

get_notices()

Get all notices.

public get_notices() : array<string|int, array{type: string, message: string}>
Return values
array<string|int, array{type: string, message: string}>

The array of notices.

get_upload_path()

Get the upload path.

public get_upload_path() : string
Return values
string

The full path.

get_upload_url()

Get the upload URL.

public get_upload_url() : string
Return values
string

The full URL.

migrate()

Migrates APIIDA data.

public migrate(array<string|int, string> $args, array<string, mixed> $assoc_args) : void

OPTIONS

: The action to perform. Currently only `reports` and `remove-folder` are supported.

EXAMPLES

# Migrate all APIIDA data.
$ wp boomi migrate apiida all
Success: Migrated 13 reports.
Success: Removed the APIIDA uploads folder.

# Migrate APIIDA reports.
$ wp boomi migrate apiida reports
Success: Migrated 13 reports.

# Remove the APIIDA uploads folder.
$ wp boomi migrate apiida remove-folder
Success: Removed the APIIDA uploads folder.
Parameters
$args : array<string|int, string>

CLI positional arguments.

$assoc_args : array<string, mixed>

CLI associative arguments.

reset_notices()

Reset all notices.

public reset_notices() : void

set_upload_path()

Set the upload path.

public set_upload_path([string $path = '' ]) : void

If the path is a directory, it will create it if it does not exist.

Parameters
$path : string = ''

The complete path to use.

set_upload_url()

Set the upload URL.

public set_upload_url([string $url = '' ]) : void
Parameters
$url : string = ''

The full URL to use.

export_csv()

Create and write to a CSV file

protected export_csv(string $filename, array<int|string, mixed> $rows[, array<int|string, string> $headers = array() ]) : void
Parameters
$filename : string

the full name of the file.

$rows : array<int|string, mixed>

array of data.

$headers : array<int|string, string> = array()

(default: array()).

migrate_reports()

Migrates APIIDA reports to the database.

private migrate_reports() : void

This method will log messages to the user about the migration process and report the number of migrated records.

remove_directory()

Removes a directory recursively.

private remove_directory(string $dir) : bool
Parameters
$dir : string

The path to the directory to be deleted.

Return values
bool

True if the directory was deleted successfully, false otherwise.

remove_folder()

Removes the APIIDA uploads folder.

private remove_folder() : void

This method will log messages to the user about the deletion process.


        
On this page

Search results