Skip to content

Commit

Permalink
Fix clone database workflow creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
kporras07 committed Sep 12, 2023
1 parent 25778ed commit ef2b691
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/Models/Environment.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,15 @@ public function cloneDatabase(Environment $from_env, array $options = [])
if (isset($options['updatedb'])) {
$options['updatedb'] = (int)$options['updatedb'];
}
$params = array_merge(
['from_environment' => $from_env->getName(),],
$options
);
$params = [
'from_environment' => $from_env->getName(),
'updatedb' => $options['updatedb'] ?? 0,
'clear_cache' => $options['clear_cache'] ?? false,
];
if (!empty($options['from_url']) && !empty($options['to_url'])) {
$params['wp_replace_siteurl']['from_url'] = $options['from_url'];
$params['wp_replace_siteurl']['to_url'] = $options['to_url'];
}
return $this->getWorkflows()->create(
'clone_database',
compact('params')
Expand Down

0 comments on commit ef2b691

Please sign in to comment.