mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-27 17:15:02 +00:00
Remove legacy ShortMessage components and integrate Notifier
Replaced outdated ShortMessage functionalities with Symfony's Notifier component for handling SMS messages. Deprecated legacy `ShortMessage` components and introduced a transition layer for existing OVH configurations. Updated dependencies and environment setup to support the new implementation.
This commit is contained in:
@@ -234,6 +234,8 @@ class ChillMainExtension extends Extension implements
|
||||
|
||||
public function prepend(ContainerBuilder $container)
|
||||
{
|
||||
$this->prependNotifierTexterWithLegacyData($container);
|
||||
|
||||
// add installation_name and date_format to globals
|
||||
$chillMainConfig = $container->getExtensionConfig($this->getAlias());
|
||||
$config = $this->processConfiguration($this
|
||||
@@ -357,6 +359,44 @@ class ChillMainExtension extends Extension implements
|
||||
// Note: the controller are loaded inside compiler pass
|
||||
}
|
||||
|
||||
/**
|
||||
* This method prepend framework configuration with legacy configuration from "ovhCloudTransporter".
|
||||
*
|
||||
* It can be safely removed when the option chill_main.short_message.dsn will be removed.
|
||||
*/
|
||||
private function prependNotifierTexterWithLegacyData(ContainerBuilder $container): void
|
||||
{
|
||||
$configs = $container->getExtensionConfig('chill_main');
|
||||
$notifierSet = false;
|
||||
foreach (array_reverse($configs) as $config) {
|
||||
if (!array_key_exists('short_messages', $config)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (array_key_exists('dsn', $config['short_messages'])) {
|
||||
$container->prependExtensionConfig('framework', [
|
||||
'notifier' => [
|
||||
'texter_transports' => [
|
||||
'ovh_legacy' => $config['short_messages']['dsn'],
|
||||
],
|
||||
],
|
||||
]);
|
||||
$notifierSet = true;
|
||||
}
|
||||
}
|
||||
if (!$notifierSet) {
|
||||
$container->prependExtensionConfig('framework', [
|
||||
'notifier' => [
|
||||
'texter_transports' => [
|
||||
'dummy' => 'null://null',
|
||||
],
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected function prependCruds(ContainerBuilder $container)
|
||||
{
|
||||
$container->prependExtensionConfig('chill_main', [
|
||||
|
Reference in New Issue
Block a user