public function boot(KernelInterface $kernel)
 {
     // PHP Mailer expects it files to just be included, and has not
     // been designed around PSR-0 Autoloaders. We can arrange for it
     // to be loaded by adding a direct mapping though.
     AutoLoadContainer::addMappings(array('PHPMailer' => __DIR__ . '/PHPMailer/class.phpmailer.php'));
     // Make the 2 email classes we provide available as general services
     // If you want to use them though, you should really just set the
     // 'email' service to the one that you would prefer to use for everything
     // First the normal email service using PHPMailer
     $kernel->addService('email.phpmailer', '\\phpmailer\\email\\PHPMailerEmail')->setMultiInstance();
     // and then a special Debug emailer that lets you override to and from
     // using the config settings
     $kernel->addService('email.devmailer', '\\phpmailer\\email\\DevEmail')->setMultiInstance()->setArguments(array('::service::config'));
 }
Beispiel #2
0
 /**
  * Called during startup to allow this package to register its components
  * @param \snb\core\KernelInterface $kernel
  */
 public function boot(KernelInterface $kernel)
 {
     // Should be in Buzz, but its simpler to leave that package completely unmodified...
     $kernel->addService('twig.extension.asset', '\\asset\\extensions\\twig\\AssetExtension')->setArguments(array('::service::config', '::service::kernel', '::service::cache'));
 }