From 6371481fa8bf6075d22eb61a915105f5de5f1019 Mon Sep 17 00:00:00 2001 From: Thomas Konrad Date: Fri, 17 Oct 2014 09:49:27 +0200 Subject: [PATCH 1/3] Add websms provider. --- Resources/config/providers.xml | 8 ++++++++ 1 file changed, 8 insertions(+) mode change 100644 => 100755 Resources/config/providers.xml diff --git a/Resources/config/providers.xml b/Resources/config/providers.xml old mode 100644 new mode 100755 index 0b881dd..60a4f9d --- a/Resources/config/providers.xml +++ b/Resources/config/providers.xml @@ -58,6 +58,14 @@ + + + + + + + + From 2e3367bfb2c20dedcc39dc80740f835e4bc09bd1 Mon Sep 17 00:00:00 2001 From: Thomas Konrad Date: Fri, 17 Oct 2014 09:49:58 +0200 Subject: [PATCH 2/3] Add websms provider factory. --- .../Factory/WebsmsProviderFactory.php | 46 +++++++++++++++++++ Resources/config/provider_factories.xml | 4 ++ 2 files changed, 50 insertions(+) create mode 100755 DependencyInjection/Factory/WebsmsProviderFactory.php mode change 100644 => 100755 Resources/config/provider_factories.xml diff --git a/DependencyInjection/Factory/WebsmsProviderFactory.php b/DependencyInjection/Factory/WebsmsProviderFactory.php new file mode 100755 index 0000000..4b1a0fb --- /dev/null +++ b/DependencyInjection/Factory/WebsmsProviderFactory.php @@ -0,0 +1,46 @@ + + */ +class WebsmsProviderFactory implements ProviderFactoryInterface +{ + /** + * {@inheritDoc} + */ + public function create(ContainerBuilder $container, $id, array $config) + { + $container->getDefinition($id) + ->replaceArgument(1, $config['access_token']) + ->replaceArgument(2, $config['international_prefix']) + ; + } + + /** + * {@inheritDoc} + */ + public function getKey() + { + return 'websms'; + } + + /** + * {@inheritDoc} + */ + public function addConfiguration(NodeDefinition $node) + { + $node + ->children() + ->scalarNode('access_token')->isRequired()->end() + ->scalarNode('international_prefix')->defaultValue('+43')->end() + ->end() + ; + } +} diff --git a/Resources/config/provider_factories.xml b/Resources/config/provider_factories.xml old mode 100644 new mode 100755 index ea8b72a..9e6dac3 --- a/Resources/config/provider_factories.xml +++ b/Resources/config/provider_factories.xml @@ -28,6 +28,10 @@ + + + + From 8ceb353d0a1d3f5ab0c643822a82c12b64085d0b Mon Sep 17 00:00:00 2001 From: Thomas Konrad Date: Fri, 17 Oct 2014 09:50:52 +0200 Subject: [PATCH 3/3] Add websms to the configuration reference. --- Resources/doc/index.md | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 Resources/doc/index.md diff --git a/Resources/doc/index.md b/Resources/doc/index.md old mode 100644 new mode 100755 index 8593706..c673bf3 --- a/Resources/doc/index.md +++ b/Resources/doc/index.md @@ -128,4 +128,8 @@ k_phoen_sms_sender: swisscom: client_id: lala international_prefix: '+41' + + websms: + access_token: lala + international_prefix: '+43' ```