trait ConfigTrait (View source)

Traits

Properties

protected $uri from  ExecTrait

Methods

bool
startBrowser(string|null $uri = null, int $sleep = 0, int|null $port = null, string|bool $browser = false)

Starts a background browser/tab for the current site or a specified URL.

static bool
programExists($program)

No description

static string
getEditor(string|null $editor = null)

No description

getStorage($directory)

Get storage corresponding to a configuration directory.

static string
getDirectory(mixed $directory = null)

Determine which configuration directory to use and return directory path.

static void
copyConfig(StorageInterface $source, StorageInterface $destination)

Copies configuration objects from source storage to target storage.

static string
getDiff(StorageInterface $destination_storage, StorageInterface $source_storage, OutputInterface $output)

Get diff between two config sets.

static Table
configChangesTable(array $config_changes, OutputInterface $output, $use_color = true)

Build a table of config changes.

Details

bool startBrowser(string|null $uri = null, int $sleep = 0, int|null $port = null, string|bool $browser = false)

Starts a background browser/tab for the current site or a specified URL.

Uses a non-blocking Process call, so Drush execution will continue.

Parameters

string|null $uri

Optional URI or site path to open in browser. If omitted, or if a site path is specified, the current site home page uri will be prepended if the site's hostname resolves.

int $sleep
int|null $port
string|bool $browser

Return Value

bool

TRUE if browser was opened. FALSE if browser was disabled by the user or a default browser could not be found.

static bool programExists($program)

No description

Parameters

$program

Return Value

bool

static string getEditor(string|null $editor = null)

No description

Parameters

string|null $editor

Return Value

string

getStorage($directory)

Get storage corresponding to a configuration directory.

Parameters

$directory

static string getDirectory(mixed $directory = null)

Determine which configuration directory to use and return directory path.

Directory path is determined based on the following precedence:

  1. User-provided $directory.
  2. Default sync directory

Parameters

mixed $directory

Return Value

string

static void copyConfig(StorageInterface $source, StorageInterface $destination)

Copies configuration objects from source storage to target storage.

Parameters

StorageInterface $source

The source config storage service.

StorageInterface $destination

The destination config storage service.

Return Value

void

Exceptions

Exception

static string getDiff(StorageInterface $destination_storage, StorageInterface $source_storage, OutputInterface $output)

Get diff between two config sets.

Parameters

StorageInterface $destination_storage
StorageInterface $source_storage
OutputInterface $output

Return Value

string

static Table configChangesTable(array $config_changes, OutputInterface $output, $use_color = true)

Build a table of config changes.

Parameters

array $config_changes

An array of changes keyed by collection.

OutputInterface $output
$use_color

Return Value

Table