кстати, помните я говорил, что нужно генерировать фейковые классы для автодополнения? Ну собсно говоря Фабьен так и делает, только он
их же и использует, а не __call, как я планировал.
<?php
use Symfony\Components\DependencyInjection\ContainerInterface;
use Symfony\Components\DependencyInjection\Container;
use Symfony\Components\DependencyInjection\Reference;
use Symfony\Components\DependencyInjection\Parameter;
use Symfony\Components\DependencyInjection\ParameterBag\ParameterBag;
/**
* ProjectServiceContainer
*
* This class has been auto-generated
* by the Symfony Dependency Injection Component.
*/
class ProjectServiceContainer extends Container
{
protected $shared = array();
/**
* Constructor.
*/
public function __construct()
{
parent::__construct(new ParameterBag($this->getDefaultParameters()));
}
/**
* Gets the 'mail.transport' service.
*
* @return Zend_Mail_Transport_Smtp A Zend_Mail_Transport_Smtp instance.
*/
protected function getMail_TransportService()
{
$instance = new Zend_Mail_Transport_Smtp('smtp.gmail.com', array('auth' => 'login', 'username' => $this->getParameter('mailer.username'), 'password' => $this->getParameter('mailer.password'), 'ssl' => 'ssl', 'port' => 465));
return $instance;
}
/**
* Gets the 'mailer' service.
*
* This service is shared.
* This method always returns the same instance of the service.
*
* @return Object A %mailer.class% instance.
*/
protected function getMailerService()
{
if (isset($this->shared['mailer'])) return $this->shared['mailer'];
$class = $this->getParameter('mailer.class');
$instance = new $class();
$this->shared['mailer'] = $instance;
$instance->setDefaultTransport($this->getMail_TransportService());
return $instance;
}
/**
* Returns service ids for a given tag.
*
* @param string $name The tag name
*
* @return array An array of tags
*/
public function findTaggedServiceIds($name)
{
static $tags = array (
);
return isset($tags[$name]) ? $tags[$name] : array();
}
/**
* Gets the default parameters.
*
* @return array An array of the default parameters
*/
protected function getDefaultParameters()
{
return array(
'mailer.username' => 'foo',
'mailer.password' => 'bar',
'mailer.class' => 'Zend_Mail',
);
}
}