ArchiveRestoreCommands
final class ArchiveRestoreCommands extends DrushCommands implements SiteAliasManagerAwareInterface (View source)
Traits
Constants
REQ |
|
OPT |
|
EXIT_SUCCESS |
|
EXIT_FAILURE |
|
EXIT_FAILURE_WITH_CLARITY |
|
RESTORE |
|
private COMPONENT_CODE |
|
private COMPONENT_FILES |
|
private COMPONENT_DATABASE |
|
private SQL_DUMP_FILE_NAME |
|
private SITE_SUBDIR |
|
private TEMP_DIR_NAME |
|
Properties
protected CommandData|null | $commandData | from DrushCommands |
Methods
Starts a background browser/tab for the current site or a specified URL.
Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.
Sets a logger, if none is available yet.
Persist commandData for use in primary command callback. Used by 'topic' commands.
Print the contents of a file. The path comes from the @topic annotation.
Restore (import) your code, files, and database.
Extracts the archive.
Imports the code to the site.
Imports Drupal files to the site.
Determines the path where files should be extracted.
Returns the absolute path to Drupal root.
Returns the destination path.
Returns SiteAlias object by the site alias name.
Copies files from the source to the destination.
Imports the database dump to the site.
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.
static bool
programExists($program)
No description
static string
getEditor(string|null $editor = null)
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 SymfonyStyle
io()
Override Robo's IO function with our custom style.
void
setLoggerIfEmpty(LoggerInterface $logger)
Sets a logger, if none is available yet.
protected DrushLoggerManager|null
logger()
Returns a logger object.
protected void
printFile(string $file)
Print the contents of a file.
preHook(CommandData $commandData)
Persist commandData for use in primary command callback. Used by 'topic' commands.
protected
printFileTopic(CommandData $commandData)
Print the contents of a file. The path comes from the @topic annotation.
protected HandlerStack
getStack()
Get a Guzzle handler stack that uses the Drush logger.
void
restore(string $path = null, string|null $site = null, array $options = ['destination-path' => null, 'overwrite' => false, 'site-subdir' => self::SITE_SUBDIR, 'setup-database-connection' => true, 'code' => false, 'code-source-path' => null, 'files' => false, 'files-source-path' => null, 'files-destination-relative-path' => null, 'db' => false, 'db-source-path' => null, 'db-driver' => 'mysql', 'db-port' => null, 'db-host' => null, 'db-name' => null, 'db-user' => null, 'db-password' => null, 'db-prefix' => null])
Restore (import) your code, files, and database.
protected string|null
getExtractDir(string|null $path)
Extracts the archive.
protected void
importCode(string $source)
Imports the code to the site.
protected void
importFiles(string $source, array $options)
Imports Drupal files to the site.
protected string
fileImportAbsolutePath(string|null $destinationRelative)
Determines the path where files should be extracted.
protected string|null
getDrupalRootPath()
Returns the absolute path to Drupal root.
protected string
getDestinationPath()
Returns the destination path.
protected SiteAlias
getSiteAlias(string|null $site)
Returns SiteAlias object by the site alias name.
protected void
rsyncFiles(string $source, string $destination)
Copies files from the source to the destination.
protected void
importDatabase(string $databaseDumpPath, array $options)
Imports the database dump to the site.