public function init() { parent::init(); $host = '127.0.0.1'; $dbname = 'tmc_test'; $connection = new Connection(['dsn' => 'mysql:host=' . $host . ';dbname=' . $dbname, 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'tablePrefix' => 't_']); $connection->open(); $this->db = $connection; if ($this->cache !== null) { $this->cache = Instance::ensure($this->cache, Cache::className()); } }
/** * @return UniverseComponent */ private function getUniverseComponent() { return Instance::ensure($this->universe, UniverseComponent::className()); }