⚡ valuein/shop:5.8 → 4 🎉 → 2 🚀 → 6 🔥
- 🎉 Added Salesforce OAuth protocol.
- 🎉 Added Wizards to help do the main setups
- 🎉 Added B2B/B2C
- 🎉 Added selfcare change qty support for Salesforce Subscription Management
- 🚀 Improved configuration management
- 🚀 Improved date calculator to allow project to add new keywords
- 🔥 Changed loading of local bundles configs
- 🔥 Changed path of security_main.yml
- 🔥 Changed loading of Salesforce and Valuein Invoice Engines bundles
- 🔥 Changed Switchable interface
- 🔥 Changed email-contexts config key by email_contexts
- 🔥 Changed matrix-configs config key by matrix_configs
🎉 New features
Added Salesforce OAuth protocol
Allow to access the Salesforce API via OAuth authentication.
The previous auth method via Soap is still available.
Added B2B/B2C
Allow the admin to configure the context of the shop :
- Context B2B/B2C option define if the price are displayed with or without vat
- Address mode list/single define if the user can have multiple address or not
This also add support for person account in Salesforce, when the context is set to B2C.
Due to Salesforce limitation, in B2C mode, only the single address mode is available.
🚀 Improvements
Improved configuration management
This technical improvement simplify the management of the configuration file and provide more flexibility to the project for loading the configuration.
This also improve the performance of the project and provide a better/quicker validation of the config files.
The full detail of the improvement are :
- Merged admins.yml into services.yml
- Moved application routing from sonata_admin.yaml to valuein.yaml
- Removed valuein/invoiceapiclient.yaml, included file is included directly by services.yml
- Removed valuein/zuorarestapi.yaml, included file is included directly by services.yml
- Merged bundles.optional.php and bundles.php
- Removed routing.optional.php : Optional bundles routes are now imported directly from the kernel
- Emails context are now a symfony configuration
- Matrix configs are now a symfony configuration
🔥 Breaking changes
Changed loading of local bundles configs
In the previous version, a mechanism was in place to load automatically the files :
- src/Local/*Bundle/Resources/config/services_main.{yml|php}
- src/Local/*Bundle/Resources/config/parameters_main.{yml|php}
- src/Local/*Bundle/Resources/config/services.{yml|php}
- src/Local/*Bundle/Resources/config/security.{yml|php}
- src/Local/*Bundle/Resources/config/parameters.{yml|php}
- src/Local/*Bundle/Resources/config/email-contexts.yml
- src/Local/*Bundle/Resources/config/matrix-config.yml
This system have been removed and now the loading of these files must be done explicitly by the bundle by creating an extension.
If the bundle only declare services, then the following extension can be used as a template :
php
<?php
namespace Local\TestBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
class TestExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container)
{
// Load the services required by this bundle
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load("services.yml");
}
}If the bundle change the configuration of other bundles (for example change twig default date format) and the priority is important, then the following extension should be used as a template :
php
<?php
namespace Local\TestBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Yaml\Yaml;
class TestExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
{
// No operation
}
public function prepend(ContainerBuilder $container)
{
// NOTE: This version is provided only as an helper to migrate and should not be used on the long term
// Prepend the config of other bundle or set parameters
$content = Yaml::parseFile(__DIR__ . '/../Resources/config/services.yml');
foreach ($content['parameters'] as $key => $value) {
$container->setParameter($key, $value);
}
unset($content['imports'], $content['parameters'], $content['services']);
foreach ($content as $package => $config) {
$container->prependExtensionConfig($package, $config);
}
// Append the config of other bundle or set parameters
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load("services.yml");
}
}If the bundle change the configuration of other bundles (for example register a twig path) and the priority is not important, then the following extension should be used as a template :
php
<?php
namespace Local\TestBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\Yaml\Yaml;
class TestExtension extends Extension implements PrependExtensionInterface
{
public function load(array $configs, ContainerBuilder $container)
{
// No operation
}
public function prepend(ContainerBuilder $container)
{
// NOTE: This version is provided only as an helper to migrate and should not be used on the long term
// Append the config of other bundle or set parameters
$loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config'));
$loader->load("services.yml");
}
}Changed path of security_main.yml
Previously, the project was scanning for the file security.yml at one of these locations :
- src/Local/*Bundle/Resources/config/security_main.{yml|php}
Now, the file is scanned at one of these locations :
- src/Local/*Bundle/Resources/config/security.{yaml|yml|php|xml}
Changed loading of Salesforce and Valuein Invoice Engines bundles
The file bundles.optional.php have been merged inside bundles.php
The bundle.php file now use a syntax similar to the config files by using when@ENVVAR
Changed Switchable interface
The method isEnabled(string $env) have been removed, instead the method getBundles(): array have been added.
Before the bundle was expected to declare if he was enabled or not. Now it must return the list of bundle that it manage, as if it was in the bundles.php file : [ App\App::class => ['all' => true] ]
The method getDependency have also been removed, since it's now part of the getBundles method.
- Projects
- None
- Subscribers
- None