Class CLI.
- Full name:
\Linchpin_SatisPress\Controller\CLI - Parent class:
\Linchpin_SatisPress\Controller\Controller
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:
| Parameter | Type | Description |
|---|---|---|
$args | array | Positional arguments. |
$assoc_args | array | Associative 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
[
[–slug=
[–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:
| Parameter | Type | Description |
|---|---|---|
$args | array | Positional arguments. |
$assoc_args | array | Associative arguments. |
normalize_artifact
Repair one artifact.
private normalize_artifact(\Linchpin_SatisPress\Helper\R2_Adapter $adapter, string $key, bool $dry_run): bool
Parameters:
| Parameter | Type | Description |
|---|---|---|
$adapter | \Linchpin_SatisPress\Helper\R2_Adapter | Storage adapter. |
$key | string | Artifact key. |
$dry_run | bool | Whether 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:
| Parameter | Type | Description |
|---|---|---|
$variable | string | The variable's name. |
$value | mixed | The 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:
| Parameter | Type | Description |
|---|---|---|
$file | string | File to get HTML string. |
$view_dir | string | View 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:
| Parameter | Type | Description |
|---|---|---|
$file | string | File to get HTML string. |
$view_dir | string | View 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