/**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->dsn === null) {
         throw new InvalidConfigException('The "dsn" property must be set.');
     }
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->stderrIsNotStdout = fstat(\STDERR)['dev'] != fstat(\STDOUT)['dev'];
     $this->stderrSupportsColors = Console::streamSupportsAnsiColors(\STDERR);
     $this->stdoutSupportsColors = Console::streamSupportsAnsiColors(\STDOUT);
 }
Example #3
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if ($this->options === null) {
         $this->options = LOG_ODELAY | LOG_PID;
     }
 }
Example #4
0
 /**
  * @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, 'yii\\mail\\MailerInterface');
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     //assert proper config of formatLineCallback
     if ($this->formatLineCallback !== null && !$this->formatLineCallback instanceof \Closure) {
         $msg = Yii::t('app', 'formatLineCallback needs to be a closure');
         throw new InvalidConfigException($msg);
     }
 }
Example #6
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     // Make sure log token is given
     if (empty($this->logToken)) {
         $className = get_class($this);
         throw new InvalidCallException("{$className} requires \"\$logToken\" attribute to be set.");
     }
 }
 /**
  * Check required properties
  */
 public function init()
 {
     parent::init();
     foreach (['botToken', 'chatId'] as $property) {
         if ($this->{$property} === null) {
             throw new InvalidConfigException(self::className() . "::\${$property} property must be set");
         }
     }
 }
 /**
  * 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();
     if (is_string($this->db)) {
         $this->db = Yii::$app->getComponent($this->db);
     }
     if (!$this->db instanceof Connection) {
         throw new InvalidConfigException("DbTarget::db must be either a DB connection instance or the application component ID of a DB connection.");
     }
 }
Example #9
0
 public function init()
 {
     $this->_stdoutIsTerminal = posix_isatty(\STDOUT);
     if ($this->_stdoutIsTerminal) {
         $this->logVars = [];
     }
     $this->_stdoutSupportsAnsiColors = Console::streamSupportsAnsiColors(\STDOUT);
     $this->_stderrIsTerminal = posix_isatty(\STDERR);
     $this->_stderrSupportsAnsiColors = Console::streamSupportsAnsiColors(\STDERR);
     $this->_levelAnsiColorMap = [Logger::LEVEL_ERROR => $this->errorAnsiColor, Logger::LEVEL_WARNING => $this->warningAnsiColor, Logger::LEVEL_INFO => $this->infoAnsiColor, Logger::LEVEL_TRACE => $this->traceAnsiColor, Logger::LEVEL_PROFILE => $this->profileAnsiColor, Logger::LEVEL_PROFILE_BEGIN => $this->profileBeginAnsiColor, Logger::LEVEL_PROFILE_END => $this->profileEndAnsiColor];
     parent::init();
 }
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     if (empty($this->message['to'])) {
         throw new InvalidConfigException('The "to" option must be set for EmailTarget::message.');
     }
     if (is_string($this->mail)) {
         $this->mail = Yii::$app->getComponent($this->mail);
     }
     if (!$this->mail instanceof MailerInterface) {
         throw new InvalidConfigException("EmailTarget::mailer must be either a mailer object or the application component ID of a mailer object.");
     }
 }
Example #11
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     if (!$this->webhookUrl) {
         $this->enabled = false;
     }
     if (!$this->username) {
         $this->username = Yii::$app->name;
     }
     // Not pushing Slackbot requests to slack.
     if (isset(Yii::$app->request->userAgent) && preg_match('/^Slackbot-/', Yii::$app->request->userAgent)) {
         $this->enabled = false;
     }
 }
 /**
  * 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 = Yii::$app->getRuntimePath() . '/logs/app.log';
     } else {
         $this->logFile = Yii::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;
     }
 }
Example #13
0
 /**
  * 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());
 }
Example #14
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->_logger = FluentLogger::open($this->host, $this->port, $this->options);
 }
Example #15
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     parent::init();
     $this->setLevels(Logger::LEVEL_PROFILE);
     $this->exportInterval = 1;
 }
 /**
  * @inheritDoc
  */
 public function init()
 {
     parent::init();
     $this->httpClient = Instance::ensure($this->httpClient, Client::className());
 }
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     $this->_fp = \FirePHP::getInstance(true);
     parent::init();
 }
Example #18
0
 /**
  * {@inheritdoc}
  */
 public function init()
 {
     parent::init();
     $this->robot = Yii::createObject(['class' => Pubu::class, 'remote' => $this->channel]);
 }
Example #19
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
 }
Example #20
0
 /**
  * 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->client = new \Raven_Client($this->dsn);
 }
Example #21
0
 public function init()
 {
     $this->requestId = uniqid(gethostname(), true);
     parent::init();
 }