Download the PHP package ratchetio/ratchetio without Composer
On this page you can find all versions of the php package ratchetio/ratchetio. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ratchetio/ratchetio
More information about ratchetio/ratchetio
Files in ratchetio/ratchetio
Package ratchetio
Short Description Monitors errors and exceptions and reports them to Ratchet.io
License MIT
Homepage http://github.com/ratchetio/ratchetio-php
Informations about the package ratchetio
This library is deprecated, please use rollbar-php
ratchetio-php
PHP notifier for Ratchet.io. Catches and reports exceptions to Ratchet.io for alerts, reporting, and analysis.
Installation and Configuration
-
Download the code and put
ratchetio.php
somewhere you can access it - Add the following code at your application's entry point:
This will install an exception handler (with set_exception_handler
) and an error handler (with set_error_handler
). If you'd rather not do that:
- That's it! If you'd like to report exceptions that you catch yourself:
You can also send ratchet log-like messages:
Configuration reference
All of the following options can be passed as keys in the $config array.
- access_token: your project access token
- base_api_url: the base api url to post to (default 'https://submit.ratchet.io/api/1/')
- batch_size: flush batch early if it reaches this size. default: 50
- batched: true to batch all reports from a single request together. default true.
- branch: name of the current branch (default 'master')
- capture_error_stacktraces: record full stacktraces for PHP errors. default: true.
- environment: environment name, e.g. 'production' or 'development'
- error_sample_rates: associative array mapping error numbers to sample rates. Sample rates are ratio out of 1, e.g. 0 is "never report", 1 is "always report", and 0.1 is "report 10% of the time". Sampling is done on a per-error basis. Default: empty array, meaning all errors are reported.
- host: server hostname. Default: null, which will result in a call to
gethostname()
(orphp_uname('n')
if that function does not exist) - logger: an object that has a log($level, $message) method. If provided, will be used by RatchetioNotifier to log messages.
- max_errno: max PHP error number to report. e.g. 1024 will ignore all errors above E_USER_NOTICE. default: 1024 (ignore E_STRICT and above).
- person: an associative array containing data about the currently-logged in user. Required: 'id', optional: 'username', 'email'. All values are strings.
- person_fn: a function reference (string, etc. - anything that call_user_func() can handle) returning an array like the one for 'person'.
- root: path to your project's root dir
- scrub_fields: array of field names to scrub out of POST. Values will be replaced with astrickses. If overridiing, make sure to list all fields you want to scrub, not just fields you want to add to the default. Param names are converted to lowercase before comparing against the scrub list. default: ('passwd', 'password', 'secret', 'confirm_password', 'password_confirmation').
- shift_function: whether to shift function names in stack traces down one frame, so that the function name correctly reflects the context of each frame. default: true.
- timeout: request timeout for posting to ratchet, in seconds. default 3.
Example use of error_sample_rates:
Example use of person_fn:
Support
If you have any feedback or run into any problems, please contact support at [email protected]
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request