Esempio n. 1
0
 /**
  * Constructs middleware for notifying Honeybadger of uncaught application
  * exceptions and informing users of error identifiers, when a placeholder
  * is embedded in the developer's error response body.
  *
  * Accepts an array of configuration options which are set on [Config]
  * before processing requests. See the [Config] class for
  * available settings.
  *
  * ## Informing Users
  *
  * Users can be shown an error identifier by adding
  * `<!-- HONEYBADGER ERROR -->` to an error view. Whenever an uncaught
  * exception is handled and the placeholder is found,
  * [Slim::call_and_inform_users] will replace it with the
  * configured `user_information`.
  *
  * By default, results in:
  *
  *     Honeybadger Error <error identifier>
  *
  * @param  array  $options  The Honeybadger config options.
  */
 public function __construct(array $options = array())
 {
     // Register Honeybadger as the global error and exception handler.
     Honeybadger::init();
     // Store the supplied options for later.
     $this->options = $options;
 }
Esempio n. 2
0
        return $this->secure($value);
    }
    /**
     * Determines a default port, depending on whether a secure connection is
     * configured.
     *
     * @return  integer  Default port
     */
    private function default_port()
    {
        return $this->is_secure() ? 443 : 80;
    }
    /**
     * Determines the path to the certificate authority bundled with
     * the library.
     *
     * @return  string  Path to certificate authority bundle.
     */
    private function default_certificate_authority()
    {
        return realpath(__DIR__ . '/../../resources/ca-bundle.crt');
    }
    public function offsetUnset($option)
    {
        $this->{$option} = NULL;
    }
}
// End Config
// Additional measure to ensure defaults are initialized.
Honeybadger::init();