class MkCommands extends DrushCommands implements SiteAliasManagerAwareInterface (View source)

Traits

SiteAliasManagerAwareTrait
ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

EXIT_FAILURE_WITH_CLARITY

Properties

protected CommandData $commandData from  DrushCommands

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

HandlerStack
getStack()

Get a Guzzle handler stack that uses the Drush logger.

docs($options = ['destination' => self::REQ])

Build a Markdown document for each Drush command thats available on a site.

static string
appendPostAmble()

No description

static string
appendAliases(AnnotatedCommand $command)

No description

static string
appendTopics(AnnotatedCommand $command, string $dir_commands)

No description

static string
appendOptions(AnnotatedCommand $command)

No description

static string
appendArguments(AnnotatedCommand $command)

No description

static string
appendUsages(AnnotatedCommand $command)

No description

static string
appendPreamble(AnnotatedCommand $command, $root)

No description

void
writeYml(array $nav, string $dest)

No description

void
writeAllMd(array $pages_all, string $dest)

No description

void
prepare($destination)

Empty target directories.

static iterable
argToArray(InputArgument $arg)

Build an array since that's what HelpCLIFormatter expects.

static iterable
optionToArray(InputOption $opt)

Build an array since that's what HelpCLIFormatter expects.

static string
cliTextToMarkdown(string $text)

Convert text like foo to foo.

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct()

protected io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

Parameters

CommandData $commandData

protected printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

Parameters

CommandData $commandData Full path to a file.

protected HandlerStack getStack()

Get a Guzzle handler stack that uses the Drush logger.

docs($options = ['destination' => self::REQ])

Build a Markdown document for each Drush command thats available on a site.

This command is an early step when building the www.drush.org static site. Adapt it to build a similar site listing the commands that are available on your site. Also see Drush's Github Actions workflow.

Parameters

$options

static protected string appendPostAmble()

Return Value

string

static protected string appendAliases(AnnotatedCommand $command)

Parameters

AnnotatedCommand $command

Return Value

string

static protected string appendTopics(AnnotatedCommand $command, string $dir_commands)

Parameters

AnnotatedCommand $command
string $dir_commands

Return Value

string

static protected string appendOptions(AnnotatedCommand $command)

Parameters

AnnotatedCommand $command

Return Value

string

static protected string appendArguments(AnnotatedCommand $command)

Parameters

AnnotatedCommand $command

Return Value

string

static protected string appendUsages(AnnotatedCommand $command)

Parameters

AnnotatedCommand $command

Return Value

string

static protected string appendPreamble(AnnotatedCommand $command, $root)

Parameters

AnnotatedCommand $command
$root

Return Value

string

protected void writeYml(array $nav, string $dest)

Parameters

array $nav
string $dest

Return Value

void

protected void writeAllMd(array $pages_all, string $dest)

Parameters

array $pages_all
string $dest

Return Value

void

protected void prepare($destination)

Empty target directories.

Parameters

$destination

Return Value

void

static iterable argToArray(InputArgument $arg)

Build an array since that's what HelpCLIFormatter expects.

Parameters

InputArgument $arg

Return Value

iterable

static iterable optionToArray(InputOption $opt)

Build an array since that's what HelpCLIFormatter expects.

Parameters

InputOption $opt

Return Value

iterable

static string cliTextToMarkdown(string $text)

Convert text like foo to foo.

Parameters

string $text

Return Value

string