2016-02-24 8 views
0

У меня есть проблема с быстрой почтовой программой и монологом на Symfony 3.0.2:Ошибка Symfony 3 с Monolog и быстрой почтовой программой

FatalThrowableError in appDevDebugProjectContainer.php line 4963: Type error: Argument 1 passed to SymfonyBundleMonologBundleSwiftMailerMessageFactory_0000000079e53f2b00000001716bb61a50d0bc982eb9e83148fbcc469ab36a58::__construct() must be an instance of Swift_Mailer, instance of Closure given, called in /Users/Romain/Sites/var/cache/dev/appDevDebugProjectContainer.php on line 4043

# Swiftmailer Configuration config.yml 
swiftmailer: 
    transport: "%mailer_transport%" 
    host:  "%mailer_host%" 
    username: "%mailer_user%" 
    password: "%mailer_password%" 
    spool:  { type: memory } 

#Monolog config_prod.yml 
monolog: 
    handlers: 
     main: 
      type:   fingers_crossed 
      action_level: critical 
      handler:  grouped 
     grouped: 
      type: group 
      members: [streamed, buffered] 
     streamed: 
      type: stream 
      path: "%kernel.logs_dir%/%kernel.environment%.log" 
      level: debug 
     buffered: 
      type: buffer 
      handler: swift 
     swift: 
      type:  swift_mailer 
      from_email: [email protected] 
      to_email: [email protected] 
      subject: "Subject" 
      level:  debug 

экстракт appDevDebugProjectContainer.php на линии 4963

/** 
    * {@inheritDoc} 
    */ 
    public function __construct(\Swift_Mailer $mailer, $fromEmail, $toEmail, $subject, $contentType = null) 
    { 
     static $reflection; 

     if (! $this->valueHolder56d41e956b1f5441039037) { 
      $reflection = $reflection ?: new \ReflectionClass('Symfony\\Bundle\\MonologBundle\\SwiftMailer\\MessageFactory'); 
      $this->valueHolder56d41e956b1f5441039037 = $reflection->newInstanceWithoutConstructor(); 
     \Closure::bind(function (\Symfony\Bundle\MonologBundle\SwiftMailer\MessageFactory $this) { 
      unset($this->mailer, $this->fromEmail, $this->toEmail, $this->subject, $this->contentType); 
     }, $this, 'Symfony\\Bundle\\MonologBundle\\SwiftMailer\\MessageFactory')->__invoke($this); 

     } 

     $this->valueHolder56d41e956b1f5441039037->__construct($mailer, $fromEmail, $toEmail, $subject, $contentType); 
    } 

Экстракт appDevDebugProjectContainer.php на линии 4043

/** 
    * Gets the 'monolog.handler.swift.mail_message_factory' service. 
    * 
    * This service is shared. 
    * This method always returns the same instance of the service. 
    * 
    * This service is private. 
    * If you want to be able to request this service from the container directly, 
    * make it public, otherwise you might end up with broken code. 
    * 
    * @param bool $lazyLoad whether to try lazy-loading the service with a proxy 
    * 
    * @return \Symfony\Bundle\MonologBundle\SwiftMailer\MessageFactory A Symfony\Bundle\MonologBundle\SwiftMailer\MessageFactory instance. 
    */ 
    public function getMonolog_Handler_Swift_MailMessageFactoryService($lazyLoad = true) 
    { 
     if ($lazyLoad) { 

      return $this->services['monolog.handler.swift.mail_message_factory'] = new SymfonyBundleMonologBundleSwiftMailerMessageFactory_0000000057f95edf000000015dd8d44e50d0bc982eb9e83148fbcc469ab36a58(
       function (&$wrappedInstance, \ProxyManager\Proxy\LazyLoadingInterface $proxy) { 
        $wrappedInstance = $this->getMonolog_Handler_Swift_MailMessageFactoryService(false); 

        $proxy->setProxyInitializer(null); 

        return true; 
       } 
      ); 
     } 

     return new \Symfony\Bundle\MonologBundle\SwiftMailer\MessageFactory($this->get('swiftmailer.mailer.default'), '[email protected]', array(0 => '[email protected]'), 'Une erreur critique est survenue', NULL); 
    } 

Отправляет его по электронной почте только с помощью swiftmailer.

У меня уже есть эта конфигурация с той же средой, кроме symfony 2.7, и это работает.

И эта конфигурация работает на WAMP (php7), но не на моем environement OSX и Linux-сервер ...

Спасибо за вашу помощь

ответ