Exemple #1
0
 function __construct($options_or_dsn = null, $options = array())
 {
     if (is_null($options_or_dsn) && !empty($_SERVER['SENTRY_DSN'])) {
         // Read from environment
         $options_or_dsn = $_SERVER['SENTRY_DSN'];
     }
     if (!is_array($options_or_dsn)) {
         if (!empty($options_or_dsn)) {
             // Must be a valid DSN
             $options_or_dsn = self::parseDSN($options_or_dsn);
         } else {
             $options_or_dsn = array();
         }
     }
     $options = array_merge($options_or_dsn, $options);
     $this->servers = Raven_Util::get($options, 'servers');
     $this->secret_key = Raven_Util::get($options, 'secret_key');
     $this->public_key = Raven_Util::get($options, 'public_key');
     $this->project = Raven_Util::get($options, 'project', 1);
     $this->auto_log_stacks = (bool) Raven_Util::get($options, 'auto_log_stacks', false);
     $this->name = Raven_Util::get($options, 'name', Raven_Compat::gethostname());
     $this->site = Raven_Util::get($options, 'site', $this->_server_variable('SERVER_NAME'));
     $this->tags = Raven_Util::get($options, 'tags', array());
     $this->trace = (bool) Raven_Util::get($options, 'trace', true);
     // XXX: Signing is disabled by default as it is no longer required by modern versions of Sentrys
     $this->signing = (bool) Raven_Util::get($options, 'signing', false);
     $this->processors = array();
     foreach (Raven_util::get($options, 'processors', $this->getDefaultProcessors()) as $processor) {
         $this->processors[] = new $processor($this);
     }
     $this->_lasterror = null;
 }
 /**
  * LehterClient constructor.
  */
 public function __construct($options_or_dsn = null, $options = array())
 {
     if (is_null($options_or_dsn) && !empty($_SERVER['SENTRY_DSN'])) {
         // Read from environment
         $options_or_dsn = $_SERVER['SENTRY_DSN'];
     }
     if (!is_array($options_or_dsn)) {
         if (!empty($options_or_dsn)) {
             // Must be a valid DSN
             $options_or_dsn = LehterClient::parseDSN($options_or_dsn);
         } else {
             $options_or_dsn = array();
         }
     }
     $options = array_merge($options_or_dsn, $options);
     $this->logger = Raven_Util::get($options, 'logger', 'php');
     $this->server = Raven_Util::get($options, 'server');
     $this->secret_key = Raven_Util::get($options, 'secret_key');
     $this->public_key = Raven_Util::get($options, 'public_key');
     $this->project = Raven_Util::get($options, 'project', 1);
     $this->auto_log_stacks = (bool) Raven_Util::get($options, 'auto_log_stacks', false);
     $this->name = Raven_Util::get($options, 'name', Raven_Compat::gethostname());
     $this->site = Raven_Util::get($options, 'site', $this->_server_variable('SERVER_NAME'));
     $this->tags = Raven_Util::get($options, 'tags', array());
     $this->release = Raven_util::get($options, 'release', null);
     $this->trace = (bool) Raven_Util::get($options, 'trace', true);
     $this->timeout = Raven_Util::get($options, 'timeout', 2);
     $this->message_limit = Raven_Util::get($options, 'message_limit', self::MESSAGE_LIMIT);
     $this->exclude = Raven_Util::get($options, 'exclude', array());
     $this->severity_map = null;
     $this->shift_vars = (bool) Raven_Util::get($options, 'shift_vars', true);
     $this->http_proxy = Raven_Util::get($options, 'http_proxy');
     $this->extra_data = Raven_Util::get($options, 'extra', array());
     $this->send_callback = Raven_Util::get($options, 'send_callback', null);
     $this->curl_method = Raven_Util::get($options, 'curl_method', 'sync');
     $this->curl_path = Raven_Util::get($options, 'curl_path', 'curl');
     $this->curl_ipv4 = Raven_util::get($options, 'curl_ipv4', true);
     $this->ca_cert = Raven_util::get($options, 'ca_cert', $this->get_default_ca_cert());
     $this->verify_ssl = Raven_util::get($options, 'verify_ssl', true);
     $this->curl_ssl_version = Raven_Util::get($options, 'curl_ssl_version');
     $this->processors = $this->setProcessorsFromOptions($options);
     $this->_lasterror = null;
     $this->_user = null;
     $this->context = new Raven_Context();
     if ($this->curl_method == 'async') {
         $this->_curl_handler = new Raven_CurlHandler($this->get_curl_options());
     }
 }
 public function __construct($options_or_dsn = null, $options = array())
 {
     if (is_null($options_or_dsn) && !empty($_SERVER['SENTRY_DSN'])) {
         // Read from environment
         $options_or_dsn = $_SERVER['SENTRY_DSN'];
     }
     if (!is_array($options_or_dsn)) {
         if (!empty($options_or_dsn)) {
             // Must be a valid DSN
             $options_or_dsn = self::parseDSN($options_or_dsn);
         } else {
             $options_or_dsn = array();
         }
     }
     $options = array_merge($options_or_dsn, $options);
     $this->logger = Raven_Util::get($options, 'logger', 'php');
     $this->servers = Raven_Util::get($options, 'servers');
     $this->secret_key = Raven_Util::get($options, 'secret_key');
     $this->public_key = Raven_Util::get($options, 'public_key');
     $this->project = Raven_Util::get($options, 'project', 1);
     $this->auto_log_stacks = (bool) Raven_Util::get($options, 'auto_log_stacks', false);
     $this->name = Raven_Util::get($options, 'name', Raven_Compat::gethostname());
     $this->site = Raven_Util::get($options, 'site', $this->_server_variable('SERVER_NAME'));
     $this->tags = Raven_Util::get($options, 'tags', array());
     $this->trace = (bool) Raven_Util::get($options, 'trace', true);
     $this->timeout = Raven_Util::get($options, 'timeout', 2);
     $this->exclude = Raven_Util::get($options, 'exclude', array());
     $this->severity_map = NULL;
     $this->shift_vars = (bool) Raven_Util::get($options, 'shift_vars', true);
     $this->http_proxy = Raven_Util::get($options, 'http_proxy');
     $this->extra_data = Raven_Util::get($options, 'extra', array());
     $this->send_callback = Raven_Util::get($options, 'send_callback', null);
     $this->curl_method = Raven_Util::get($options, 'curl_method', 'async');
     $this->curl_path = Raven_Util::get($options, 'curl_path', 'curl');
     $this->processors = array();
     foreach (Raven_util::get($options, 'processors', self::getDefaultProcessors()) as $processor) {
         $this->processors[] = new $processor($this);
     }
     $this->_lasterror = null;
     $this->_user = null;
     $this->context = new Raven_Context();
     if ($this->curl_method == 'async') {
         $this->_curl_handler = new Raven_CurlHandler($this->get_curl_options());
     }
 }
Exemple #4
0
 /**
  * Sets the Raven_Processor sub-classes to be used when data is processed before being
  * sent to Sentry.
  *
  * @param $options
  * @return array
  */
 public function setProcessorsFromOptions($options)
 {
     $processors = array();
     foreach (Raven_util::get($options, 'processors', self::getDefaultProcessors()) as $processor) {
         $new_processor = new $processor($this);
         if (isset($options['processorOptions']) && is_array($options['processorOptions'])) {
             if (isset($options['processorOptions'][$processor]) && method_exists($processor, 'setProcessorOptions')) {
                 $new_processor->setProcessorOptions($options['processorOptions'][$processor]);
             }
         }
         $processors[] = $new_processor;
     }
     return $processors;
 }