class InstallCommand in CKEditor Media Embed Plugin 8
Same name in this branch
- 8 src/Command/InstallCommand.php \Drupal\ckeditor_media_embed\Command\InstallCommand
- 8 src/Command/Drush/InstallCommand.php \Drupal\ckeditor_media_embed\Command\Drush\InstallCommand
Class InstallCommand.
@package Drupal\ckeditor_media_embed
@DrupalCommand ( extension="ckeditor_media_embed", extensionType="module" )
Hierarchy
- class \Drupal\ckeditor_media_embed\Command\InstallCommand extends \Drupal\Console\Core\Command\Command implements CKEditorCliCommandInterface uses \Drupal\Console\Core\Command\Shared\ContainerAwareCommandTrait
Expanded class hierarchy of InstallCommand
1 string reference to 'InstallCommand'
1 service uses InstallCommand
File
- src/
Command/ InstallCommand.php, line 24
Namespace
Drupal\ckeditor_media_embed\CommandView source
class InstallCommand extends Command implements CKEditorCliCommandInterface {
use ContainerAwareCommandTrait;
/**
* The CKEditor Media Embed CLI Commands service.
*
* @var \Drupal\ckeditor_media_embed\CLICommands
*/
protected $cliCommands;
/**
* {@inheritdoc}
*/
public function __construct(CliCommandWrapper $cliCommands) {
parent::__construct();
$this->cliCommands = $cliCommands;
}
/**
* {@inheritdoc}
*/
protected function configure() {
$this
->setName('ckeditor_media_embed:install')
->setDescription($this
->trans('commands.ckeditor_media_embed.install.description'));
}
/**
* {@inheritdoc}
*/
protected function execute(InputInterface $input, OutputInterface $output) {
$this->input = $input;
$this->output = $output;
$this->io = new DrupalStyle($input, $output);
$overwrite = $this->cliCommands
->askToOverwritePluginFiles($this);
if ($overwrite) {
$this->cliCommands
->overwritePluginFiles($this, $overwrite);
}
}
/**
* {@inheritdoc}
*/
public function getInput() {
return $this->input;
}
/**
* {@inheritdoc}
*/
public function getIo() {
return $this->io;
}
/**
* {@inheritdoc}
*/
public function getMessage($message_key) {
return $this
->trans("commands.ckeditor_media_embed.install.messages.{$message_key}");
}
/**
* {@inheritdoc}
*/
public function confirmation($question, $default = FALSE) {
$helper = $this
->getHelper('question');
$confirmation_question = new ConfirmationQuestion($question, $default);
return $helper
->ask($this->input, $this->output, $confirmation_question);
}
/**
* {@inheritdoc}
*/
public function comment($text) {
$this->io
->comment($text);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
InstallCommand:: |
protected | property | The CKEditor Media Embed CLI Commands service. | |
InstallCommand:: |
public | function |
Output message in comment style. Overrides CKEditorCliCommandInterface:: |
|
InstallCommand:: |
protected | function | 1 | |
InstallCommand:: |
public | function |
Present confirmation question to user. Overrides CKEditorCliCommandInterface:: |
|
InstallCommand:: |
protected | function | ||
InstallCommand:: |
public | function |
Retrieve the command input service. Overrides CKEditorCliCommandInterface:: |
|
InstallCommand:: |
public | function |
Retrieve the i/o style. Overrides CKEditorCliCommandInterface:: |
|
InstallCommand:: |
public | function |
Retrieve message text. Overrides CKEditorCliCommandInterface:: |
|
InstallCommand:: |
public | function |