ThemeSync
Console command to sync a theme between the DB and Filesystem layers.
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
Extends
Class | Description |
---|---|
Command
|
Command base class Contains utilities to make developing CLI commands nicer |
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
= "Sync an existing theme between the DB and Filesystem layers"
The console command description.
protected
$name
:
string
= "theme:sync"
The console command name.
protected
$signature
:
string
= "theme:sync\n {name? : The name of the theme (directory name). Defaults to currently active theme.}\n {--paths= : Comma-separated specific paths (relative to provided theme directory) to specificaly sync. Default is all paths. You may use regular expressions.}\n {--target= : The target of the sync, the other will be used as the source. Defaults to \"filesystem\", can be \"database\"}\n {--f|force : Force the operation to run.}\n "
The name and signature of this command.
protected $source : string
The datasource key that the sync is sourcing from
protected $target : string
The datasource key that the sync is targeting
inherited protected $laravel : Winter\Storm\Foundation\Application
inherited
protected
$replaces
:
array
= []
List of commands that this command replaces (aliases)
Methods
public handle () : void
Execute the console command.
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.
Property | Type | Description |
---|---|---|
$path | string |
string
|
$modelClass | mixed |
mixed
|
$theme | Cms\Classes\Theme |
inherited public __construct ()
Create a new command instance.
inherited
public
alert (string $string, int | string | null $verbosity = null
)
: void
Write a string in an alert box.
Property | Type | Description |
---|---|---|
$string | string |
string
|
$verbosity | int | string | null |
int | string | null
|
inherited public complete (Symfony\Component\Console\Completion\CompletionInput $input, Symfony\Component\Console\Completion\CompletionSuggestions $suggestions) : void
Provide autocompletion for this command's input
Property | Type | Description |
---|---|---|
$input | Symfony\Component\Console\Completion\CompletionInput |
Symfony\Component\Console\Completion\CompletionInput
|
$suggestions | Symfony\Component\Console\Completion\CompletionSuggestions |
Symfony\Component\Console\Completion\CompletionSuggestions
|
inherited
public
error (string $string, int | string | null $verbosity = null
)
: void
Write a string as error output.
Property | Type | Description |
---|---|---|
$string | string |
string
|
$verbosity | int | string | null |
int | string | null
|
inherited public getSubscribedSignals () : array
Returns the process signals this command listens to
inherited public handleSignal (integer $signal) : void
Handle the provided Unix process signal
Property | Type | Description |
---|---|---|
$signal | integer |
integer
|
inherited public handleWindowsSignal (integer $event) : void
Handle the provided Windows process singal.
Property | Type | Description |
---|---|---|
$event | integer |
integer
|