public function ConfigSplitCliService::ioActivate in Configuration Split 2.0.x
Handle the activation interaction.
Parameters
string $split: The split name to activate.
\Symfony\Component\Console\Style\StyleInterface|object $io: The $io interface of the cli tool calling.
callable $t: The translation function akin to t().
bool $confirmed: Whether the import is already confirmed by the console input.
File
- src/
ConfigSplitCliService.php, line 163
Class
- ConfigSplitCliService
- The CLI service class for interoperability.
Namespace
Drupal\config_splitCode
public function ioActivate(string $split, $io, callable $t, $confirmed = FALSE) : bool {
$config = $this
->getSplitFromArgument($split, $io, $t);
if ($config === NULL) {
return FALSE;
}
$message = $t('Activate the split config configuration?');
$storage = $this->manager
->singleActivate($config, TRUE);
if ($confirmed || $io
->confirm($message)) {
return $this
->tryImport($storage, $io, $t);
}
return TRUE;
}