if ($target === 'live') {
if (preg_match("/{$name}=([^;]*)/", Yii::$app->getDb()->dsn, $match)) {
return $match[1];
}
} else {
if (preg_match("/{$name}=([^;]*)/", Yii::$app->db_backup->dsn, $match)) {
return $match[1];
}
}
throw new Exception("Unable to extract the db Name");
if ($target === 'live') {
$dsn = Yii::$app->getDb()->dsn;
} else {
$dsn = Yii::$app->db_backup->dsn;
}
if (preg_match("/{$name}=([^;]*)/", $dsn, $match)) {
return $match[1];
}
throw new Exception("Unable to extract the db Name");
$dsn = $target === 'live' ? Yii::$app->getDb()->dsn : Yii::$app->db_backup->dsn;