InstallCommand
extends GpmCommand
in package
Class InstallCommand
Table of Contents
Properties
- $all_yes : string
- $argv : string
- $data : array<string|int, mixed>
- $demo_processing : array<string|int, mixed>
- $destination : string
- $file : string
- $gpm : GPM
- $input : InputInterface
- $local_config : array<string|int, mixed>
- $output : SymfonyStyle
- $tmp : string
- $use_symlinks : bool
- $pages_initialized : bool
- $plugins_initialized : bool
- $themes_initialized : bool
Methods
- addOption() : $this
- Adds an option.
- askConfirmationIfMajorVersionUpdated() : void
- If the package is updated from an older major release, show warning and ask confirmation
- clearCache() : int
- composerUpdate() : string|false
- getInput() : InputInterface
- getIO() : SymfonyStyle
- installDependencies() : void
- Given a $dependencies list, filters their type according to $type and shows $message prior to listing them to the user. Then asks the user a confirmation prior to installing them.
- invalidateCache() : void
- isGravInstance() : void
- loadLocalConfig() : string|false
- Load the local config file
- progress() : void
- setGpm() : void
- Allows to set the GPM object, used for testing the class
- setupConsole() : void
- Set colors style definition for the formatter.
- configure() : void
- displayGPMRelease() : 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
- checkDestination() : bool
- downloadPackage() : string|null
- getGitRegexMatches() : array<string|int, mixed>|false
- getSymlinkSource() : string|false
- installDemoContent() : void
- Prompt to install the demo content of a package
- installPackage() : bool
- Install a package
- processDemo() : void
- Add package to the queue to process the demo content, if demo content exists
- processGpm() : bool
- processPackage() : void
- processSymlink() : void
Properties
$all_yes
protected
string
$all_yes
$argv
protected
string
$argv
$data
protected
array<string|int, mixed>
$data
$demo_processing
protected
array<string|int, mixed>
$demo_processing
= []
$destination
protected
string
$destination
$file
protected
string
$file
$gpm
protected
GPM
$gpm
$input
protected
InputInterface
$input
$local_config
protected
array<string|int, mixed>
$local_config
$output
protected
SymfonyStyle
$output
$tmp
protected
string
$tmp
$use_symlinks
protected
bool
$use_symlinks
$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
$thisaskConfirmationIfMajorVersionUpdated()
If the package is updated from an older major release, show warning and ask confirmation
public
askConfirmationIfMajorVersionUpdated(Package $package) : void
Parameters
- $package : Package
clearCache()
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
SymfonyStyleinstallDependencies()
Given a $dependencies list, filters their type according to $type and shows $message prior to listing them to the user. Then asks the user a confirmation prior to installing them.
public
installDependencies(array<string|int, mixed> $dependencies, string $type, string $message[, bool $required = true ]) : void
Parameters
- $dependencies : array<string|int, mixed>
-
The dependencies array
- $type : string
-
The type of dependency to show: install, update, ignore
- $message : string
-
A message to be shown prior to listing the dependencies
- $required : bool = true
-
A flag that determines if the installation is required or optional
Tags
invalidateCache()
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
progress()
public
progress(array<string|int, mixed> $progress) : void
Parameters
- $progress : array<string|int, mixed>
setGpm()
Allows to set the GPM object, used for testing the class
public
setGpm(GPM $gpm) : void
Parameters
- $gpm : GPM
setupConsole()
Set colors style definition for the formatter.
public
setupConsole(InputInterface $input, OutputInterface $output) : void
Parameters
- $input : InputInterface
- $output : OutputInterface
configure()
protected
configure() : void
displayGPMRelease()
protected
displayGPMRelease() : 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
checkDestination()
private
checkDestination(Package $package) : bool
Parameters
- $package : Package
Return values
booldownloadPackage()
private
downloadPackage(Package $package[, string|null $license = null ]) : string|null
Parameters
- $package : Package
- $license : string|null = null
Return values
string|nullgetGitRegexMatches()
private
getGitRegexMatches(Package $package) : array<string|int, mixed>|false
Parameters
- $package : Package
Return values
array<string|int, mixed>|falsegetSymlinkSource()
private
getSymlinkSource(Package $package) : string|false
Parameters
- $package : Package
Return values
string|falseinstallDemoContent()
Prompt to install the demo content of a package
private
installDemoContent(Package $package) : void
Parameters
- $package : Package
installPackage()
Install a package
private
installPackage(Package $package[, bool $is_update = false ]) : bool
Parameters
- $package : Package
- $is_update : bool = false
-
True if it's an update. False if it's an install
Return values
boolprocessDemo()
Add package to the queue to process the demo content, if demo content exists
private
processDemo(Package $package) : void
Parameters
- $package : Package
processGpm()
private
processGpm(Package $package[, bool $is_update = false ]) : bool
Parameters
- $package : Package
- $is_update : bool = false
Return values
boolprocessPackage()
private
processPackage(Package|null $package[, bool $is_update = false ]) : void
Parameters
- $package : Package|null
- $is_update : bool = false
-
True if the package is an update
processSymlink()
private
processSymlink(Package $package) : void
Parameters
- $package : Package