ThemeSync

Console command to sync a theme between the DB and Filesystem layers.

 class Cms\Console\ThemeSync
extends Winter\Storm\Console\Command
implements 
    Symfony\Component\Console\Command\SignalableCommandInterface

theme:sync name --paths=file/to/sync.md,other/file/to/sync.md --target=filesystem --force

  • name defaults to the currently active theme
  • --paths defaults to all paths within the theme, otherwise comma-separated list of paths relative to the theme directory
  • --target defaults to "filesystem", the source will whichever of filesystem vs database is not the target
  • --force bypasses the confirmation request

Traits

Trait Description
HandlesCleanup

Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class.

Illuminate\Console\ConfirmableTrait
ProvidesAutocompletion

Console Command Trait that injects cross-platform signal handling to trigger cleanup on exit through the handleCleanup() method on the implementing class.

Properties

protected $datasource : Cms\Classes\AutoDatasource

The theme's AutoDatasource instance

protected $description : string

The console command description.

protected $name : string

The console command name.

protected $source : string

The datasource key that the sync is sourcing from

protected $target : string

The datasource key that the sync is targeting

protected $replaces : array

Inherited from Command

List of commands that this command replaces (aliases)

Methods

public handle () : void

Execute the console command.

Returns
void

protected getArguments () : array

Get the console command arguments.

Returns
array

protected getModelForPath (string $path, $modelClass, Cms\Classes\Theme $theme) : Winter\Storm\Halcyon\Model

Get the correct Halcyon model for the provided path from the source datasource and load the requested path data.

Parameters
Property Description
$path
string
$modelClass
mixed
$theme
Returns

protected getOptions () : array

Get the console command options.

Returns
array

public __construct ()

Inherited from Command

Create a new command instance.

Returns
mixed

public alert (string $string, int | string | null $verbosity = null) : void

Inherited from Command

Write a string in an alert box.

Parameters
Property Description
$string
string
$verbosity
int | string | null
Returns
void

public complete (Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void

Provide autocompletion for this command's input

Parameters
Property Description
$input
Symfony\Component\Console\Completion\CompletionInput
$suggestions
Symfony\Component\Console\Completion\CompletionSuggestions
Returns
void

public error (string $string, int | string | null $verbosity = null) : void

Inherited from Command

Write a string as error output.

Parameters
Property Description
$string
string
$verbosity
int | string | null
Returns
void

public getSubscribedSignals () : array

Inherited from HandlesCleanup

Returns the process signals this command listens to

Returns
array

public handleSignal (integer $signal) : integer | false

Inherited from HandlesCleanup

Handle the provided Unix process signal

Parameters
Property Description
$signal
integer
Returns
integer | false

public handleWindowsSignal (integer $event) : void

Inherited from HandlesCleanup

Handle the provided Windows process singal.

Parameters
Property Description
$event
integer
Returns
void
Copyright © 2024 Winter CMS