Toolkit

SymlinkProjectCommands extends AbstractCommands
in package

Class AbstractCommands.

Table of Contents

$types  : array<string|int, string>
A mapping of Drupal project type to directory.
getConfigurationFile()  : string
Path to YAML configuration file containing command defaults.
getWorkingDir()  : string
Returns the current working directory.
initializeRuntimeConfiguration()  : mixed
Command initialization.
symlinkProject()  : CollectionBuilder
Symlink project as module, theme or profile in the proper directory.
symlinkProjectValidate()  : void
Validate command drupal:symlink-project.
getBin()  : string
Validate and return the path to given bin.
getBinPath()  : string
Return the path to given bin.
getConfigValue()  : mixed
{@inheritdoc}
getNodeBin()  : string
Validate and return the path to given bin from node packages.
getNodeBinPath()  : string
Return the path to given bin from node packages.
isSimulating()  : bool
Check if current command is being executed with option simulate.
taskExecute()  : mixed
Execute a command.
taskProcess()  : Process|CollectionBuilder
Process the file.
taskReplaceBlock()  : ReplaceBlock|CollectionBuilder
Replace block in a file.
getComposer()  : mixed
scanDir()  : array<string|int, mixed>

Properties

$types

A mapping of Drupal project type to directory.

protected array<string|int, string> $types = ['drupal-module' => 'modules/custom', 'drupal-theme' => 'themes/custom', 'drupal-profile' => 'profiles/custom']

Methods

getConfigurationFile()

Path to YAML configuration file containing command defaults.

public getConfigurationFile() : string
Return values
string

getWorkingDir()

Returns the current working directory.

public getWorkingDir() : string
Return values
string

The current working directory.

initializeRuntimeConfiguration()

Command initialization.

public initializeRuntimeConfiguration() : mixed
Tags
hook

pre-command-event *

Return values
mixed

symlinkProject()

Symlink project as module, theme or profile in the proper directory.

public symlinkProject([array<string|int, mixed> $options = ['root' => InputOption::VALUE_REQUIRED, 'ignore' => InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY] ]) : CollectionBuilder
Parameters
$options : array<string|int, mixed> = ['root' => InputOption::VALUE_REQUIRED, 'ignore' => InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY]

Command options.

Tags
command

drupal:symlink-project

option

root Drupal root.

option

ignore List of files to ignore.

Return values
CollectionBuilder

Collection builder.

symlinkProjectValidate()

Validate command drupal:symlink-project.

public symlinkProjectValidate() : void
Tags
hook

validate drupal:symlink-project

throws
Exception

Thrown when some configuration is missing or is wrong.

Return values
void

getBin()

Validate and return the path to given bin.

protected getBin(string $name) : string
Parameters
$name : string

The bin to look for.

Tags
throws
TaskException
Return values
string

The bin path.

getBinPath()

Return the path to given bin.

protected getBinPath(string $name) : string
Parameters
$name : string
Return values
string

The path to given binary.

getConfigValue()

{@inheritdoc}

protected getConfigValue(mixed $key[, mixed $default = null ]) : mixed
Parameters
$key : mixed
$default : mixed = null
Return values
mixed

getNodeBin()

Validate and return the path to given bin from node packages.

protected getNodeBin(string $name) : string
Parameters
$name : string

The bin to look for.

Tags
throws
TaskException
Return values
string

The bin path.

getNodeBinPath()

Return the path to given bin from node packages.

protected getNodeBinPath(string $name) : string
Parameters
$name : string
Return values
string

The path to given binary.

isSimulating()

Check if current command is being executed with option simulate.

protected isSimulating() : bool
Return values
bool

True if using --simulate, false otherwise.

taskExecute()

Execute a command.

protected taskExecute(array<string|int, mixed> $tasks) : mixed
Parameters
$tasks : array<string|int, mixed>

An array with tasks to execute.

Return values
mixed

taskProcess()

Process the file.

protected taskProcess(string $source[, string $destination = '' ]) : Process|CollectionBuilder
Parameters
$source : string

The source file to process.

$destination : string = ''

The destination file.

Return values
Process|CollectionBuilder

taskReplaceBlock()

Replace block in a file.

protected taskReplaceBlock([string $filename = '' ]) : ReplaceBlock|CollectionBuilder
Parameters
$filename : string = ''

The file to process.

Return values
ReplaceBlock|CollectionBuilder

scanDir()

private scanDir(string $directory[, array<string|int, mixed> $ignore = [] ]) : array<string|int, mixed>
Parameters
$directory : string
$ignore : array<string|int, mixed> = []
Return values
array<string|int, mixed>

Search results