Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • wcms/uw_cfg_common
1 result
Show changes
Commits on Source (3)
services:
uw_cfg_common.commands:
class: Drupal\uw_cfg_common\Commands\UwDrushCommands
arguments: ['@entity_type.manager', '@uw_cfg_common.missing_blocks', '@config.factory', '@module_handler', '@module_installer', '@uw_multilingual.setup_new_language']
arguments: ['@entity_type.manager', '@uw_cfg_common.missing_blocks', '@config.factory', '@module_handler', '@module_installer']
tags:
- { name: drush.command }
......@@ -9,7 +9,6 @@ use Drupal\Core\ProxyClass\Extension\ModuleInstaller;
use Drupal\uw_cfg_common\Service\UWMissingBlocks;
use Drupal\uw_cfg_common\UwPermissions\UwPermissions;
use Drupal\uw_cfg_common\UwRoles\UwRoles;
use Drupal\uw_multilingual\Service\UwMultiLingualSetupInterface;
use Drush\Commands\DrushCommands;
use Drush\Utils\StringUtils;
......@@ -55,13 +54,6 @@ class UwDrushCommands extends DrushCommands {
*/
protected $moduleInstaller;
/**
* Uw Multi-Lingual service.
*
* @var \Drupal\uw_multilingual\Service\UwMultiLingualSetupInterface
*/
protected $uwMultiLingualService;
/**
* {@inheritDoc}
*/
......@@ -70,15 +62,13 @@ class UwDrushCommands extends DrushCommands {
UWMissingBlocks $missingBlocks,
ConfigFactoryInterface $configFactory,
ModuleHandlerInterface $moduleHandler,
ModuleInstaller $moduleInstaller,
UwMultiLingualSetupInterface $uwMultiLingualService
ModuleInstaller $moduleInstaller
) {
$this->entityTypeManager = $entityTypeManager;
$this->missingBlocks = $missingBlocks;
$this->configFactory = $configFactory;
$this->moduleHandler = $moduleHandler;
$this->moduleInstaller = $moduleInstaller;
$this->uwMultiLingualService = $uwMultiLingualService;
}
/**
......@@ -298,29 +288,4 @@ class UwDrushCommands extends DrushCommands {
}
}
/**
* Call service of multi-lingual module to set up language settings.
*
* @param string $language_code
* The language code to update the entities to.
*
* @command uw:update-language
* @aliases uwul
* @usage uw:update-language fr
* - Create the FR language and configure all settings.
*
* @throws \Exception
*/
public function updateLanguage(string $language_code) {
try {
$this->uwMultiLingualService->setupSiteConfiguration([
'language' => $language_code,
]);
drush_backend_batch_process();
}
catch (\Exception $exception) {
$this->logger()->error($exception->getMessage());
}
}
}
services:
uw_cfg_common.drush_commands:
class: Drupal\uw_cfg_common\Commands\UwDrushCommands
arguments: [ '@entity_type.manager', '@uw_cfg_common.missing_blocks', '@config.factory', '@module_handler', '@module_installer', '@uw_multilingual.setup_new_language' ]
arguments: [ '@entity_type.manager', '@uw_cfg_common.missing_blocks', '@config.factory', '@module_handler', '@module_installer' ]
tags:
- { name: drush.command }
uw_cfg_common.uw_ldap:
......