Пример #1
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     if ($this->getLogPath() === null) {
         $this->setLogPath(Yii::getPathOfAlias('webroot') . '/');
     }
 }
Пример #2
0
 /**
  * Initializes the connection.
  */
 public function init()
 {
     parent::init();
     if ($this->_client === null) {
         $this->_client = new Raven_Client($this->dsn, array('logger' => $this->logger));
     }
 }
Пример #3
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     if ($this->getLogPath() === null) {
         $this->setLogPath(Yii::app()->getRuntimePath());
     }
 }
Пример #4
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     if ($this->getLogPath() === null) {
         $this->setLogPath(Yii::app()->getRuntimePath());
     }
     if ($this->getLogFile() === null) {
         $this->setLogFile($_SERVER['argv'][1]);
     }
 }
Пример #5
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     $this->setLogName('webstore_yii_logs');
     if (null === $this->getLogName()) {
         $this->setLogName('YiiApp');
     }
     $this->setLogFacility(Yii::app()->params['logFacility']);
     if (null === $this->getLogFacility()) {
         $this->setLogFacility(LOG_USER);
     }
 }
Пример #6
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     if ($this->autoCreateLogTable) {
         $db = $this->getDbConnection();
         try {
             $db->createCommand()->delete($this->logTableName, '0=1');
         } catch (Exception $e) {
             $this->createLogTable($db, $this->logTableName);
         }
     }
 }
Пример #7
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     if ($this->autoCreateLogTable) {
         $db = $this->getDbConnection();
         $sql = "DELETE FROM {$this->logTableName} WHERE 0=1";
         try {
             $db->createCommand($sql)->execute();
         } catch (Exception $e) {
             $this->createLogTable($db, $this->logTableName);
         }
     }
 }
Пример #8
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 request errors to slack.
     if (Yii::app()->request && preg_match('/^Slackbot-/', Yii::app()->request->userAgent)) {
         $this->enabled = false;
     }
 }
Пример #9
0
 /**
  * Initializes the connection.
  */
 public function init()
 {
     parent::init();
     # Turn off our amazing library autoload
     spl_autoload_unregister(array('YiiBase', 'autoload'));
     # Include request library
     include dirname(__FILE__) . '/lib/Raven/Autoloader.php';
     # Run request autoloader
     Raven_Autoloader::register();
     # Give back the power to Yii
     spl_autoload_register(array('YiiBase', 'autoload'));
     if ($this->_client === null) {
         $this->_client = new Raven_Client($this->dsn);
     }
 }
 public function init()
 {
     Yii::app()->controllerMap = array_merge(array('debug' => array('class' => 'YiiDebugController')), Yii::app()->controllerMap);
     Yii::setPathOfAlias('yii-debug-toolbar', dirname(__FILE__));
     Yii::app()->setImport(array('yii-debug-toolbar.*'));
     $route = Yii::app()->getUrlManager()->parseUrl(Yii::app()->getRequest());
     $this->enabled = strpos(trim($route, '/'), 'debug') !== 0;
     $this->enabled && ($this->enabled = $this->allowIp(Yii::app()->request->userHostAddress) && !Yii::app()->getRequest()->getIsAjaxRequest() && Yii::app() instanceof CWebApplication && $this->checkContentTypeWhitelist());
     if ($this->enabled) {
         Yii::app()->attachEventHandler('onBeginRequest', array($this, 'onBeginRequest'));
         Yii::app()->attachEventHandler('onEndRequest', array($this, 'onEndRequest'));
         $this->categories = '';
         $this->levels = '';
     }
     $this->_startTime = microtime(true);
     parent::init();
 }
Пример #11
0
 public function collectLogs($logger, $processLogs = false)
 {
     parent::collectLogs($logger, $processLogs);
 }
Пример #12
0
 public function init()
 {
     parent::init();
     Yii::getLogger()->autoFlush = 1;
     Yii::getLogger()->autoDump = true;
 }
Пример #13
0
 /**
  * Retrieves filtered log messages from logger for further processing.
  * @param CLogger $logger logger instance
  * @param boolean $processLogs whether to process the logs after they are collected from the logger
  */
 public function collectLogs($logger, $processLogs = false)
 {
     parent::collectLogs($logger, true);
     $this->logs = array();
 }
Пример #14
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     $connection = new Mongo($this->connectionString);
     $dbName = $this->dbName;
     $collectionName = $this->collectionName;
     if ($this->installCappedCollection) {
         $this->collection = $connection->{$dbName}->createCollection($collectionName, true, $this->collectionSize, $this->collectionMax);
     } else {
         $this->collection = $connection->{$dbName}->{$collectionName};
     }
     $this->options = array('fsync' => $this->fsync, 'safe' => $this->safe);
     if (!is_null($this->timeout)) {
         $this->options['timeout'] = $this->timeout;
     }
 }
Пример #15
0
 /**
  * Initializes the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     $this->_collection = $this->getCollection();
 }
Пример #16
0
 public function init()
 {
     parent::init();
     if (!empty($this->_config['dbProfiling']) && $this->_isLoggerAllowed()) {
         Yii::app()->db->enableProfiling = true;
         Yii::app()->db->enableParamLogging = true;
     }
 }
Пример #17
0
 /**
  * Initialize the route.
  * This method is invoked after the route is created by the route manager.
  */
 public function init()
 {
     parent::init();
     $this->setCollection($this->collectionName);
     $this->_options = array('fsync' => $this->fsync, 'safe' => $this->safe);
 }