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'));
 }
Example #2
0
<?php

/**
 * This file is part of the Small Neat Box Framework
 * Copyright (c) 2011-2012 Small Neat Box Ltd.
 * This source file is subject to the new BSD license that is bundled
 * with this package in the file LICENSE.txt.
 */
require_once __DIR__ . '/../src/snb/core/AutoLoaderContainer.php';
require_once __DIR__ . '/../src/snb/core/AutoLoaderInterface.php';
require_once __DIR__ . '/../src/snb/core/AutoLoader.php';
use snb\core\AutoLoadContainer;
use snb\core\AutoLoader;
// Create a suitable Auto Loader and register it with PHP
AutoLoadContainer::register(new AutoLoader());
// Add the PSR-0 namespaces to the AutoLoader
AutoLoadContainer::addNamespaces(array('snb' => __DIR__ . '/../src', 'Symfony' => __DIR__ . '/../src', 'example' => __DIR__ . '/../src'));
// Add the PSR-0 Prefix class to the AutoLoader
AutoLoadContainer::addPrefixes(array('Twig_' => __DIR__ . '/../src/Symfony/Component/Twig/lib'));