class SqlSyncCommands 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

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

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

static 
programExists($program)

No description

static 
getEditor()

No description

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.

sqlsync($source, $target, $options = ['no-dump' => false, 'no-sync' => false, 'runner' => self::REQ, 'create-db' => false, 'db-su' => self::REQ, 'db-su-pw' => self::REQ, 'target-dump' => self::REQ, 'source-dump' => self::OPT, 'extra-dump' => self::REQ])

Copy DB data from a source site to a target site. Transfers data via rsync.

validate(CommandData $commandData)

No description

databaseName(SiteAlias $record)

No description

string
dump($options, $global_options, $sourceRecord)

Perform sql-dump on source unless told otherwise.

string
rsync(array $options, SiteAlias $sourceRecord, SiteAlias $targetRecord, $source_dump_path)

No description

import($global_options, $target_dump_path, $targetRecord)

Import file into target.

Details

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

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

$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
bool $port
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 programExists($program)

No description

Parameters

$program

static getEditor()

No description

DrushConfig getConfig()

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

__construct()

No description

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.

sqlsync($source, $target, $options = ['no-dump' => false, 'no-sync' => false, 'runner' => self::REQ, 'create-db' => false, 'db-su' => self::REQ, 'db-su-pw' => self::REQ, 'target-dump' => self::REQ, 'source-dump' => self::OPT, 'extra-dump' => self::REQ])

Copy DB data from a source site to a target site. Transfers data via rsync.

Parameters

$source

A site-alias or the name of a subdirectory within /sites whose database you want to copy from.

$target

A site-alias or the name of a subdirectory within /sites whose database you want to replace.

$options

Exceptions

Exception

validate(CommandData $commandData)

No description

Parameters

CommandData $commandData

Exceptions

Exception

databaseName(SiteAlias $record)

No description

Parameters

SiteAlias $record

string dump($options, $global_options, $sourceRecord)

Perform sql-dump on source unless told otherwise.

Parameters

$options
$global_options
$sourceRecord

Return Value

string

Path to the source dump file.

Exceptions

Exception

string rsync(array $options, SiteAlias $sourceRecord, SiteAlias $targetRecord, $source_dump_path)

No description

Parameters

array $options
SiteAlias $sourceRecord
SiteAlias $targetRecord
$source_dump_path

Return Value

string

Path to the target file.

Exceptions

Exception

import($global_options, $target_dump_path, $targetRecord)

Import file into target.

Parameters

$global_options
$target_dump_path
$targetRecord