You are here

protected function CliCommandWrapper::installCKEditorPlugin in CKEditor Media Embed Plugin 8

1 call to CliCommandWrapper::installCKEditorPlugin()
CliCommandWrapper::overwritePluginFiles in src/Command/CliCommandWrapper.php
Overwrite the plugin files.

File

src/Command/CliCommandWrapper.php, line 190

Class

CliCommandWrapper
Class CLICommands.

Namespace

Drupal\ckeditor_media_embed\Command

Code

protected function installCKEditorPlugin(CKEditorCliCommandInterface $command, $package_directory, $plugin_name, $overwrite = FALSE) {
  $libraries_path = AssetManager::getCKEditorLibraryPluginDirectory() . $plugin_name;
  $package_plugin_path = $package_directory . '/plugins/' . $plugin_name;
  try {
    $this->fileSystem
      ->mkdir($libraries_path);
    $this->fileSystem
      ->mirror($package_plugin_path, $libraries_path, NULL, [
      'override' => $overwrite,
    ]);
    $command
      ->getIo()
      ->success(sprintf($command
      ->getMessage('success-installed-plugin'), $plugin_name));
  } catch (IOExceptionInterface $e) {
    $command
      ->getIo()
      ->error($e
      ->getMessage());
  }
  return $this;
}