CLI

Last updatedView as Markdown

Class CLI.


Methods

register_actions

Register Actions and Filters.

public register_actions(): void

cli_register_commands

Registers our command when CLI gets initialized.

public cli_register_commands(): mixed

migrate_to_r2

Migrate files from local storage to Cloudflare R2.

public migrate_to_r2(array $args = [], array $assoc_args = []): mixed

EXAMPLES

wp migrate-to-r2

Parameters:

ParameterTypeDescription
$argsarrayPositional arguments.
$assoc_argsarrayAssociative arguments.

normalize_artifacts

Re-normalise artifacts already stored in the bucket.

public normalize_artifacts(array $args = [], array $assoc_args = []): void

Repairs a release published before R2_Adapter::move() started normalising: strips macOS metadata, opens up owner-only modes, and re-uploads through move() so the sha1 in packages.json is rewritten to match the new bytes. An artifact that is already well formed is left untouched.

OPTIONS

[…] : Artifact keys to repair, e.g. my-plugin/my-plugin-1.2.3.zip.

[–slug=] : Repair every version of this package instead of naming keys.

[–dry-run] : Report what would change without writing anything.

EXAMPLES

wp linchpin normalize-artifacts --slug=woocommerce-product-feeds --dry-run
wp linchpin normalize-artifacts woocommerce-product-feeds/woocommerce-product-feeds-12.0.0.zip

Parameters:

ParameterTypeDescription
$argsarrayPositional arguments.
$assoc_argsarrayAssociative arguments.

normalize_artifact

Repair one artifact.

private normalize_artifact(\Linchpin_SatisPress\Helper\R2_Adapter $adapter, string $key, bool $dry_run): bool

Parameters:

ParameterTypeDescription
$adapter\Linchpin_SatisPress\Helper\R2_AdapterStorage adapter.
$keystringArtifact key.
$dry_runboolWhether to skip the upload.

Return Value:

Whether the artifact needed rewriting.


Inherited methods

assign

Assigns variables for substitution in templates.

public assign(string $variable, mixed $value): void

Parameters:

ParameterTypeDescription
$variablestringThe variable's name.
$valuemixedThe variable's value.

the_view

Echos the view/template

public the_view(string $file, string $view_dir = ''): void

Useful for echoing any content and also look in a local theme directory first to override templates

Parameters:

ParameterTypeDescription
$filestringFile to get HTML string.
$view_dirstringView directory.

get_view

Returns the view.

public get_view(string $file, string $view_dir = ''): string

Useful for shortcodes, or whenever the markup needs to be returned.

Parameters:

ParameterTypeDescription
$filestringFile to get HTML string.
$view_dirstringView directory.

Return Value:

$html HTML output as string.


init_assignments

Reset the variables.

protected init_assignments(): void

__construct

Controller constructor.

public __construct(): mixed

register_actions

Registers the default hooks and filters.

public register_actions(): mixed

Have a question about this page?

Linchpin assistant

Was this helpful?