namespace Drupal\Console\Command\Shared;
-use Drupal\Console\Core\Style\DrupalStyle;
use Drupal\features\FeaturesManagerInterface;
use Drupal\features\ConfigurationItem;
use Drupal\features\Plugin\FeaturesGeneration\FeaturesGenerationWrite;
*/
trait FeatureTrait
{
- public function packageQuestion(DrupalStyle $io)
+ public function packageQuestion($bundle)
{
$packages = $this->getPackagesByBundle($bundle);
);
}
- $package = $io->choiceNoList(
+ $package = $this->getIo()->choiceNoList(
$this->trans('commands.features.import.questions.packages'),
$packages
);
}
- protected function importFeature(DrupalStyle $io, $packages)
+ protected function importFeature($packages)
{
$manager = $this->getFeatureManager();
$package = $manager->loadPackage($module_name, true);
if (empty($package)) {
- $io->warning(
+ $this->getIo()->warning(
sprintf(
$this->trans('commands.features.import.messages.not-available'),
$module_name
}
if ($package->getStatus() != FeaturesManagerInterface::STATUS_INSTALLED) {
- $io->warning(
+ $this->getIo()->warning(
sprintf(
$this->trans('commands.features.import.messages.uninstall'),
$module_name
$components = $overridden;
if (empty($components)) {
- $io->warning(
+ $this->getIo()->warning(
sprintf(
$this->trans('commands.features.import.messages.nothing')
)
return ;
} else {
- $this->import($io, $components);
+ $this->import($this->getIo(), $components);
}
}
- public function import($io, $components)
+ public function import($components)
{
- $manager = $this->getFeatureManager();
+ $manager = $this->getFeatureManager();
/**
* @var \Drupal\config_update\ConfigRevertInterface $config_revert
*/
$item = $manager->getConfigType($feature);
$type = ConfigurationItem::fromConfigStringToConfigType($item['type']);
$config_revert->import($type, $item['name_short']);
- $io->info(
+ $this->getIo()->info(
sprintf(
$this->trans('commands.features.import.messages.importing'),
$feature
$item = $config[$feature];
$type = ConfigurationItem::fromConfigStringToConfigType($item->getType());
$config_revert->revert($type, $item->getShortName());
- $io->info(
+ $this->getIo()->info(
sprintf(
$this->trans('commands.features.import.messages.reverting'),
$feature