Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Update sMsmode extension
Browse files Browse the repository at this point in the history
  • Loading branch information
webeweb committed Oct 10, 2019
1 parent fe0da36 commit fc89d09
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CHANGELOG
=========

### [1.4.0](https://github.com/webeweb/smsmode-bundle/tree/v1.4.0) (2019-10-10)

- Update sMsmode extension

### [1.3.0](https://github.com/webeweb/smsmode-bundle/tree/v1.3.0) (2019-08-08)

- Improve logs
Expand Down
21 changes: 9 additions & 12 deletions DependencyInjection/WBWSMSModeExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use WBW\Bundle\CoreBundle\DependencyInjection\ConfigurationHelper;

/**
* sMsmode extension.
Expand Down Expand Up @@ -54,20 +55,16 @@ public function load(array $configs, ContainerBuilder $container) {

$config = $this->processConfiguration($configuration, $configs);

if (true === array_key_exists("authentication", $config)) {
if (true === array_key_exists("access_token", $config["authentication"])) {
$container->setParameter("smsmode.access_token", $config["authentication"]["access_token"]);
}
if (true === array_key_exists("pseudo", $config["authentication"])) {
$container->setParameter("smsmode.pseudo", $config["authentication"]["pseudo"]);
}
if (true === array_key_exists("pass", $config["authentication"])) {
$container->setParameter("smsmode.pass", $config["authentication"]["pass"]);
}
}

if (true === $config["event_listeners"]) {
$serviceLoader->load("event_listeners.yml");
}

if (true === array_key_exists("authentication", $config)) {
ConfigurationHelper::registerContainerParameter($container, $config["authentication"], "smsmode", "access_token");
ConfigurationHelper::registerContainerParameter($container, $config["authentication"], "smsmode", "pseudo");
ConfigurationHelper::registerContainerParameter($container, $config["authentication"], "smsmode", "pass");
}

ConfigurationHelper::registerContainerParameter($container, $config, $this->getAlias(), "event_listeners");
}
}
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"require": {
"php": "^5.6|^7.0",
"ext-json": "*",
"webeweb/core-bundle": "^2.9",
"webeweb/core-bundle": "^2.13",
"webeweb/smsmode-library": "^2.5"
},
"require-dev": {
Expand Down

0 comments on commit fc89d09

Please sign in to comment.