public function __construct(KernelInterface $kernel)
 {
     $this->settings = array();
     $this->path = $kernel->getPackagePath('app');
     $this->source = '';
     $this->setEnvironment('dev');
 }
 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'));
 }
Exemple #3
0
 /**
  * @param $fileList
  * @param $target
  * @param $filters
  * @return string
  */
 protected function handleGeneralAssets($fileList, $target, $filters)
 {
     // Build a list of assets that we depend on
     $assets = array();
     foreach ($fileList as $resource) {
         $path = $this->kernel->findResource($resource, 'assets');
         $assets[] = new FileAsset($path);
     }
     // Prepare the assets in the asset manager
     $m = new AssetManager(new AssetCollection($assets, $filters));
     $m->setWriteTo($this->writeTo);
     $m->setBaseUrl($this->baseUrl);
     // build the assets if needed and return the name to use
     $m->setOutputName($target);
     return $m->refresh();
 }
Exemple #4
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'));
 }