Mission Impossible: Symfony components in Drupal 7
I am going to share my experience with introducing Symfony components into Drupal 7. Learn how to incorporate components like HttpKernel, DependencyInjection or Configuration to bring modern tools and practices into an outdated project.
private $confirmationSender; public function __construct(OrderConfirmationSender $confirmationSender) { $this->confirmationSender = $confirmationSender; } public function sendConfirmation() { $this->confirmationSender->sendMessage($subject, $body); } }
as locked in composer. lock file (if exists) $ composer update - will attempt to update all dependencies to the latest versions as set in composer.json
= new YamlFileLoader($this->container, new FileLocator('app/config')); $loader->load('parameters.yml'); $loader = new XmlFileLoader($this->container, new FileLocator('app/config')); $loader->load('services.xml'); $this->container->compile(); }
= new YamlFileLoader($this->container, new FileLocator('app/config')); $loader->load('parameters.yml'); $loader = new XmlFileLoader($this->container, new FileLocator('app/config')); $loader->load('services.xml'); $this->container->registerExtension(new ApplicationExtension()); $this->container->compile(); }
- 10k products imported in 4.5h - Scheduling import with Elysia Cron module was very flaky - Scheduled feed importer would add products all over again - resources hungry!