Beispiel #1
0
 /**
  * Class constructor
  * @codeCoverageIgnore This is implicitly tested
  * @param string $indexId
  */
 public function __construct($indexId = self::DefaultIndexId)
 {
     if (empty($indexId)) {
         $indexId = self::DefaultIndexId;
     }
     $this->indexId = $indexId;
     $this->di = new EmbeDi($this->indexId);
     $this->di->configure($this);
     if (empty(self::$mnl[$indexId])) {
         self::$mnl[$indexId] = $this;
     }
 }
Beispiel #2
0
 public function __construct($className = null)
 {
     $this->_className = $className;
     $this->_di = new EmbeDi(self::DefaultInstanceId);
     $this->_di->configure($this);
 }
Beispiel #3
0
 public function __construct($configName = self::ConfigName)
 {
     $this->loggerInstance = new NullLogger();
     /**
      * TODO This should be made as embedi adapter, currently unsupported
      */
     $config = new ConfigReader($configName);
     $this->di = EmbeDi::fly($configName);
     $this->di->configure($this);
     $this->di->apply($config->toArray(), $this);
 }
 public function __construct($instanceId = EmbeDi::DefaultInstanceId)
 {
     $this->_di = new EmbeDi($instanceId);
     $this->_di->configure($this);
 }
Beispiel #5
0
 /**
  *
  * @param string $instanceId
  */
 public function __construct($instanceId = self::DefaultInstanceId)
 {
     $this->instanceId = $instanceId;
     $this->plugins = new AddendumPlugins($this->plugins);
     $this->di = new EmbeDi($instanceId);
     $this->di->configure($this);
 }
 public function __construct($instanceId = EmbeDi::DefaultInstanceId, $presetId = null)
 {
     $this->_di = EmbeDi::fly($instanceId, $presetId);
     $this->_di->configure($this);
 }
Beispiel #7
0
 /**
  * Create new mangan instance.
  *
  * **NOTE: While it's ok to use constructor to create Mangan, it is recommended to use
  * Mangan::fly() to create/get instance, as creating new instance has some overhead.**
  * 
  * @param string $connectionId
  */
 public function __construct($connectionId = self::DefaultConnectionId)
 {
     $this->di = EmbeDi::fly($connectionId);
     // Load built-in config
     $config = ConfigManager::getDefault();
     // Gather additional config options via signals
     (new Signal())->emit(new ConfigInit($config, $connectionId));
     // Apply built-in configuration, as other configurations might not exists
     $this->di->apply($config, $this);
     if (empty($connectionId)) {
         $connectionId = self::DefaultConnectionId;
     }
     $this->connectionId = $connectionId;
     // Apply any configurations loaded
     $this->di->configure($this);
     $this->cs = new ConnectionStorage($this, $connectionId);
     if (empty(self::$mn[$connectionId])) {
         self::$mn[$connectionId] = $this;
     }
 }
Beispiel #8
0
 public function __construct($instanceId = 'cache')
 {
     $this->_di = new EmbeDi($instanceId);
     $this->_di->configure($this);
 }