AnnotatedCommands are created automatically by the AnnotatedCommandFactory. Each command method in a command file will produce one AnnotatedCommand. These are then added to your Symfony Console Application object; nothing else is needed.

The AnnotatedCommandFactory creates commands for your application.

Misc deprecated

Make a generic cache object conform to our expected interface.

An empty cache that never stores or fetches any objects.

Documentation interface.

Command cration listeners can be added to the annotation command factory. These will be notified whenever a new commandfile is provided to the factory. This is useful for initializing new commandfile objects.

Command cration listeners can be added to the annotation command factory. These will be notified whenever a new commandfile is provided to the factory. This is useful for initializing new commandfile objects.

Return a CommandError as the result of a command to pass a status code and error message to be displayed.

Do discovery presuming that the namespace of the command will contain the last component of the path. This is the convention that should be used when searching for command files that are bundled with the modules of a framework. The convention used is that the namespace for a module in a framework should start with the framework name followed by the module name.

Process a command, including hooks and other callbacks.

Return a CommandResult as the result of a command to pass both an exit code and result data from a command.

If an annotated command method encounters an error, then it should either throw an exception, or return a result object that implements ExitCodeInterface.

Alter the result of a command after it has been processed.

Call hooks

Extract Output hooks are used to select the particular data elements of the result that should be printed as the command output -- perhaps after being formatted.

Manage named callback hooks

Non-interactively (e.g. via configuration files) apply configuration values to the Input object.

Interactively supply values for missing required arguments for the current command. Note that this hook is not called if the --no-interaction flag is set.

Add options to a command.

A result processor takes a result object, processes it, and returns another result object. For example, if a result object represents a 'task', then a task-runner hook could run the task and return the result from that execution.

Validate the arguments for the current command.

StdinAwareInterface should be implemented by classes that read from standard input. This class contains facilities to redirect stdin to instead read from a file, e.g. in response to an option or argument value.

StdinAwareTrait provides the implementation for StdinAwareInterface.

StdinHandler is a thin wrapper around php://stdin. It provides methods for redirecting input from a file, possibly conditionally under the control of an Input object.

AlterOptionsCommandEvent is a subscriber to the Command Event that looks up any additional options (e.g. from an OPTION_HOOK) that should be added to the command. Options need to be added in two circumstances:

Option providers can add options to commands based on the annotations present in a command. For example, a command that specifies @fields will automatically be given --format and --fields options.

If an annotated command method returns an object that implements OutputDataInterface, then the getOutputData() method is used to fetch the output to print from the result object.

Prepare parameter list for execurion. Handle injection of any special values (e.g. $input and $output) into the parameter list.

Provide an object for the specified interface or class name.

Given a class and method name, parse the annotations in the DocBlock comment, and provide accessor methods for all of the elements that are needed to create a Symfony Console Command.

Deserialize a CommandInfo object

Serialize a CommandInfo object

An associative array that maps from key to default value; each entry can also have a description and suggested values.

Given a class and method name, let each attribute handle its own properties, populating the CommandInfo object.

Given a class and method name, parse the annotations in the DocBlock comment, and provide accessor methods for all of the elements that are needed to create an annotated Command.

Create an appropriate CommandDocBlockParser.

Methods to convert to / from a csv string.

Hold a default value.

Simple utility methods when working with docblock comments.

Hold the tag definition for one tag in a DocBlock.

Hold some state. Collect tags.

Write the results of a command. Inject your ResultWriter into the CommandProcessor.

Contains some helper functions used by exceptions in this project.

Represents an incompatibility between the output data and selected formatter.

Represents an incompatibility between the output data and selected formatter.

Indicates that the requested format does not exist.

Indicates that the requested format does not exist.

Manage a collection of formatters; return one on request.

Comma-separated value formatters

Marker interface that indicates that a cell data renderer (Consolidation\OutputFormatters\SturcturedData\RenderCellInterface) may test for to determine whether it is allowable to add human-readable formatting into the cell data (Consolidation\OutputFormatters\SturcturedData\NumericCallRenderer).

Json formatter

Display the data in a simple list.

No output formatter

Print_r formatter

Display sections of data.

Serialize formatter

String formatter

Display a table of data with the Symfony Table class.

Tab-separated value formatters

Var_dump formatter

Var_export formatter

Display a table of data with the Symfony Table class.

Yaml formatter

FormatterOptions holds information that affects the way a formatter renders its output.

Base class for all list data types.

Holds an array where each element of the array is one row, and each row contains an associative array where the keys are the field names, and the values are the field data.

AssociativeList deprecated

Old name for PropertyList class.

FieldProcessor will do various alterations on field sets.

ListDataFromKeys deprecated

A structured data object may contains some elements that are actually metadata. Metadata is not included in the output of tabular data formatters (e.g. table, csv), although some of these (e.g. table) may render the metadata alongside the data. Raw data formatters (e.g. yaml, json) will render both the data and the metadata.

Create a formatter to add commas to numeric data.

Holds an array where each element of the array is one key : value pair. The keys must be unique, as is typically the case for associative arrays.

Holds an array where each element of the array is one row, and each row contains an associative array where the keys are the field names, and the values are the field data.

A RowsOfFields data structure that also contains metadata.

Represents aribtrary unstructured array data where the data to display in --list format comes from the array keys.

UnstructuredInterface is a marker interface that indicates that the data type is unstructured, and has no default conversion to a string.

Represents aribtrary unstructured array data where the data to display in --list format comes from the array keys.

When using arrays, we could represent XML data in a number of different ways.

Simplify a DOMDocument to an array.

Transform a string of properties into a PHP associative array.

Reorder the field labels based on the user-selected fields to display.

Calculate column widths for table cells.

Calculate the width of data in table cells in preparation for word wrapping.

Formatters may implement ValidDataTypesInterface in order to indicate exactly which formats they support. The validDataTypes method can be called to retrieve a list of data types useful in providing hints in exception messages about which data types can be used with the formatter.

Provides a default implementation of isValidDataType.

Formatters may implement ValidationInterface in order to indicate whether a particular data structure is supported. Any formatter that does not implement ValidationInterface is assumed to only operate on arrays, or data types that implement SimplifyToArrayInterface.

A host path is a path on some machine. The machine may be specified by a label, and the label may be an @alias or a site specification.

An alias record is a configuration record containing well-known items.

Discover alias files named:

Discover alias files:

An alias record is a configuration record containing well-known items.

Site Alias manager

Inflection interface for the site alias manager.

Inflection trait for the site alias manager.

Site Alias manager methods used to set up the object.

Site Alias manager

Parse a string that contains a site alias name, and provide convenience methods to access the parts.

Common implementation of some SiteAlias methods.

SiteAliasWithConfig delegates to a site alias, and also combines it with two config stores:

Parse a string that contains a site specification.

Our application object

This Attribute is designed to be used with Console style commands, not Annotated Commands.

Mark commands as obsolete. These commands are omitted from help list and when user tries to run one, the command's description is shown. Example usage at https://github.com/drush-ops/drush/blob/14.x/src/Commands/LegacyCommands.php

Defines the interface for a Boot classes. Any CMS that wishes to work with Drush should extend BaseBoot. If the CMS has a Drupal-Compatibility layer, then it should extend DrupalBoot.

The BootstrapHook is installed as an init hook that runs before all commands. If there is a @bootstrap annotation/attribute, then we will bootstrap Drupal to the requested phase.

A value class with bootstrap levels.

This is a do-nothing 'Boot' class that is used when there is no site at Drupal root, or when no root is specified.

Defines the available kernels that can be bootstrapped.

A value object for Symfony Console hyperlinks.

Create a placeholder proxy command to represent an unknown command.

Keep a list of all of the service commands that we can find when the Drupal Kernel is booted.

A copy of \Drupal\Core\DependencyInjection\AutowireTrait with first params' type hint changed.

Stores input, output and IO objects for easy access in commands.

Topic commands.

Drush commands revealing Drupal dependencies.

Create a new field.

Delete a field

Format an array into CLI help string.

Implement this interface when building a Drush sql-sanitize plugin.

Locate Drush configuration files and load them into the configuration instance.

Accessors for common Drush config keys.

Store information about the environment

Load configuration files, and fill in any property values that need to be expanded.

A replacement for DrupalFinder. We may go back to that once it uses InstalledVersions from Composer.

Overridden version of DrupalKernel adapted to the needs of Drush.

Overridden version of InstallerKernel adapted to the needs of Drush.

Defines the row preparation event for the migration system.

Filters the ID map by a source and/or a destination ID list.

Print message in drush from migrate message.

Missing source rows event.

Wraps a prepare-row event for event listeners.

Registers a new migrate_prepare_row hook implementation.

Utility methods.

Overridden version of UpdateKernel adapted to the needs of Drush.

Static Service Container wrapper.

Throw an exception indicating that the command was unable to continue.

Throw an exception indicating that the user cancelled the operation.

Our own output formatter

Simplify a EntityInterface to an array.

Replaces MessengerCommands for non-Annotated commands. Our terminate event fires for those too,

Sanitize emails and passwords. This also an example of how to write a database sanitizer.

Sanitize emails and passwords. This also an example of how to write a database sanitizer.

Sanitize user fields. This also an example of how to write a database sanitizer.

Sanitize emails and passwords. This also an example of how to write a database sanitizer.

Redirects Drupal logging messages to Drush log.

Contains \Drush\Log\Logger.

Preprocess commandline arguments.

Map commandline arguments from one value to another during preflight.

Prepare to bootstrap Drupal

The Drush preflight determines what needs to be done for this request.

Storage for arguments preprocessed during preflight.

Storage for arguments preprocessed during preflight.

Helper methods to verify preflight state.

Caster class for VarDumper casters for the shell.

DrushCommand is a PsySH proxy command which accepts a Drush command config array and tries to build an appropriate PsySH command for it.

Help command.

Laravel configures prompts in a trait, so we do too to keep code aligned.

Prepare our Dependency Injection Container

Log PHP errors to the Drush log. This is in effect until Drupal's error handler takes over.

HandlerInterface represents a PHP system handler (e.g. the error reporting handler, the shutdown handler) that may be globally installed.

Find drush.services.yml files.

Use the Symfony Dependency Injection Container to instantiate services.

The RedispatchHook is installed as an init hook that runs before all commands. If the commandline contains an alias or a site specification that points at a remote machine, then we will stop execution of the current command and instead run the command remotely.

Discovers classes in a relative namespace using the Composer ClassLoader.

Control the Drush runtime environment

Manage Drush services.

Drush's shutdown handler

The TildeExpansionHook is installed as a preValidate hook that runs before all commands. Argument or option values containing a leading tilde will be expanded to an absolute path.

A host path is a path on some machine. The machine may be specified by a label, and the label may be an @alias or a site specification.

The Drush ProcessManager adds a few Drush-specific service methods.

Discover alias files:

Inflection interface for the site alias manager.

Parse a string that contains a site alias name, and provide convenience methods to access the parts.

Parse a string that contains a site specification.

The base implementation for Drush database connections.

Note: when using this trait, also implement ConfigAwareInterface/ConfigAwareTrait.

CliTestTrait provides an execute() method that is useful for launching executable programs in functional tests.

DrushTestTrait provides a drush() method that may be used to write functional tests for Drush extensions.

OutputUtilsTrait provides some useful utility methods for test classes that define getOutputRaw() and getErrorOutputRaw() methods.