It seems that when using a depdancy injection the objection get's really really really big. This increase memory usage and maybe caching sizes. For now we have something like this:
class Memcache extends CacheBase implements HookContainerInterface {
/**
* @var NuntiusConfig
*/
protected $config;
/**
* @var \Memcached
*/
protected $memcached;
/**
* {@inheritdoc}
*/
static function getContainer(\Symfony\Component\DependencyInjection\ContainerBuilder $container) {
return new static($container->get('config'));
}
/**
* Memcache constructor.
*
* @param NuntiusConfig $config
*/
public function __construct(NuntiusConfig $config) {
$this->config = $config;
$connection = $config->getSetting('memcache');
$this->memcached = new \Memcached();
$this->memcached->addServer($connection['host'], $connection['port']);
}
}
will be
class Memcache extends CacheBase implements HookContainerInterface {
/**
* @var NuntiusConfig
*/
protected $config;
/**
* @var \Memcached
*/
protected $memcached;
/**
* {@inheritdoc}
*/
static function getContainer(\Symfony\Component\DependencyInjection\ContainerBuilder $container) {
return new static($container->get('config'));
}
/**
* Memcache constructor.
*
* @param NuntiusConfig $config
*/
public function __construct(ContainerBuilder $container) {
$this->container = $container;
}
protected function getMemcache() {
return new Memcache();
}
protected function getConfig() {
return $this->container->get('config');
}
It seems that when using a depdancy injection the objection get's really really really big. This increase memory usage and maybe caching sizes. For now we have something like this:
will be