/** * @inheritdoc */ public function init() { parent::init(); if (empty($this->message['to'])) { throw new InvalidConfigException('The "to" option must be set for EmailTarget::message.'); } $this->mailer = Instance::ensure($this->mailer, 'Leaps\\Mail\\MailerInterface'); }
/** * Initializes the DbTarget component. * This method will initialize the [[db]] property to make sure it refers to a valid DB connection. * @throws InvalidConfigException if [[db]] is invalid. */ public function init() { parent::init(); $this->db = Instance::ensure($this->db, Connection::className()); }
/** * Initializes the route. * This method is invoked after the route is created by the route manager. */ public function init() { parent::init(); if ($this->logFile === null) { $this->logFile = Leaps::$app->getRuntimePath() . '/logs/app.log'; } else { $this->logFile = Leaps::getAlias($this->logFile); } $logPath = dirname($this->logFile); if (!is_dir($logPath)) { FileHelper::createDirectory($logPath, $this->dirMode, true); } if ($this->maxLogFiles < 1) { $this->maxLogFiles = 1; } if ($this->maxFileSize < 1) { $this->maxFileSize = 1; } }