SandboxCommand
extends GravCommand
in package
Class SandboxCommand
Table of Contents
Properties
- $argv : string
- $destination : string
- $directories : array<string|int, mixed>
- $files : array<string|int, mixed>
- $input : InputInterface
- $local_config : array<string|int, mixed>
- $mappings : array<string|int, mixed>
- $output : SymfonyStyle
- $source : string
- $pages_initialized : bool
- $plugins_initialized : bool
- $themes_initialized : bool
Methods
- addOption() : $this
- Adds an option.
- clearCache() : int
- composerUpdate() : string|false
- getInput() : InputInterface
- getIO() : SymfonyStyle
- invalidateCache() : void
- isGravInstance() : void
- loadLocalConfig() : string|false
- Load the local config file
- setupConsole() : void
- Set colors style definition for the formatter.
- configure() : void
- execute() : int
- initializeGrav() : $this
- Initialize Grav.
- initializePages() : $this
- Properly initialize pages.
- initializePlugins() : $this
- Properly initialize plugins.
- initializeThemes() : $this
- Properly initialize themes.
- serve() : int
- Override with your implementation.
- setLanguage() : $this
- Set language to be used in CLI.
- setupGrav() : void
- check() : bool
- copy() : int
- createDirectories() : int
- initFiles() : int
- pages() : int
- perms() : int
- symlink() : int
Properties
$argv
protected
string
$argv
$destination
protected
string
$destination
$directories
protected
array<string|int, mixed>
$directories
= ['/assets', '/backup', '/cache', '/images', '/logs', '/tmp', '/user/accounts', '/user/config', '/user/data', '/user/pages', '/user/plugins', '/user/themes']
$files
protected
array<string|int, mixed>
$files
= ['/.dependencies', '/.htaccess', '/user/config/site.yaml', '/user/config/system.yaml']
$input
protected
InputInterface
$input
$local_config
protected
array<string|int, mixed>
$local_config
$mappings
protected
array<string|int, mixed>
$mappings
= ['/.gitignore' => '/.gitignore', '/.editorconfig' => '/.editorconfig', '/CHANGELOG.md' => '/CHANGELOG.md', '/LICENSE.txt' => '/LICENSE.txt', '/README.md' => '/README.md', '/CONTRIBUTING.md' => '/CONTRIBUTING.md', '/index.php' => '/index.php', '/composer.json' => '/composer.json', '/bin' => '/bin', '/system' => '/system', '/vendor' => '/vendor', '/webserver-configs' => '/webserver-configs']
$output
protected
SymfonyStyle
$output
$source
protected
string
$source
$pages_initialized
private
bool
$pages_initialized
= false
$plugins_initialized
private
bool
$plugins_initialized
= false
$themes_initialized
private
bool
$themes_initialized
= false
Methods
addOption()
Adds an option.
public
addOption(string $name[, string|array<string|int, mixed>|null $shortcut = null ][, int|null $mode = null ][, string $description = '' ][, string|array<string|int, string>|int|bool|null $default = null ]) : $this
Parameters
- $name : string
-
The option name
- $shortcut : string|array<string|int, mixed>|null = null
-
The shortcuts, can be null, a string of shortcuts delimited by | or an array of shortcuts
- $mode : int|null = null
-
The option mode: One of the InputOption::VALUE_* constants
- $description : string = ''
-
A description text
- $default : string|array<string|int, string>|int|bool|null = null
-
The default value (must be null for InputOption::VALUE_NONE)
Tags
Return values
$thisclearCache()
public
clearCache([array<string|int, mixed> $all = [] ]) : int
Parameters
- $all : array<string|int, mixed> = []
Tags
Return values
intcomposerUpdate()
public
composerUpdate(string $path[, string $action = 'install' ]) : string|false
Parameters
- $path : string
- $action : string = 'install'
Return values
string|falsegetInput()
public
getInput() : InputInterface
Return values
InputInterfacegetIO()
public
getIO() : SymfonyStyle
Return values
SymfonyStyleinvalidateCache()
public
invalidateCache() : void
isGravInstance()
public
isGravInstance(string $path) : void
Parameters
- $path : string
loadLocalConfig()
Load the local config file
public
loadLocalConfig() : string|false
Return values
string|false —The local config file name. false if local config does not exist
setupConsole()
Set colors style definition for the formatter.
public
setupConsole(InputInterface $input, OutputInterface $output) : void
Parameters
- $input : InputInterface
- $output : OutputInterface
configure()
protected
configure() : void
execute()
protected
execute(InputInterface $input, OutputInterface $output) : int
Parameters
- $input : InputInterface
- $output : OutputInterface
Return values
intinitializeGrav()
Initialize Grav.
protected
final initializeGrav() : $this
- Load configuration
- Initialize logger
- Disable debugger
- Set timezone, locale
- Load plugins (call PluginsLoadedEvent)
- Set Pages and Users type to be used in the site
Safe to be called multiple times.
Return values
$thisinitializePages()
Properly initialize pages.
protected
final initializePages() : $this
- call $this->initializeThemes()
- initialize assets (call onAssetsInitialized event)
- initialize twig (calls the twig events)
- initialize pages (calls onPagesInitialized event)
Safe to be called multiple times.
Return values
$thisinitializePlugins()
Properly initialize plugins.
protected
final initializePlugins() : $this
- call $this->initializeGrav()
- call onPluginsInitialized event
Safe to be called multiple times.
Return values
$thisinitializeThemes()
Properly initialize themes.
protected
final initializeThemes() : $this
- call $this->initializePlugins()
- initialize theme (call onThemeInitialized event)
Safe to be called multiple times.
Return values
$thisserve()
Override with your implementation.
protected
serve() : int
Return values
intsetLanguage()
Set language to be used in CLI.
protected
final setLanguage([string|null $code = null ]) : $this
Parameters
- $code : string|null = null
Return values
$thissetupGrav()
protected
final setupGrav() : void
check()
private
check() : bool
Return values
boolcopy()
private
copy() : int
Return values
intcreateDirectories()
private
createDirectories() : int
Return values
intinitFiles()
private
initFiles() : int
Return values
intpages()
private
pages() : int
Return values
intperms()
private
perms() : int
Return values
intsymlink()
private
symlink() : int