Skip to content

Commit

Permalink
instructions for CodeIgniter
Browse files Browse the repository at this point in the history
  • Loading branch information
ArturMoczulski authored Jun 16, 2017
1 parent a8deabe commit bc272db
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,30 @@ Rollbar::init($config, $set_exception_handler, $set_error_handler);

### For CodeIgniter Users

If you are using CodeIgniter and wish to report on E_NOTICE level errors you'll have to be sure to run `Rollbar::init` from inside the Controller constructor.
If you are using CodeIgniter you can place `Rollbar::init` in either of the two places:
* inside the Controller's constructor
```php
public function __construct()
{
Rollbar::init(array(
'access_token' => config_item('rollbar_access_token'),
'environment' => ENVIRONMENT
));
parent::__construct();
}
```
* `pre_system` hook
```php
$hook['pre_system'] = function () {
Rollbar::init([
'access_token' => config_item('rollbar_access_token'),
'environment' => ENVIRONMENT,
'root' => APPPATH . '../'
]);
};
```

**Note: If you wish to log `E_NOTICE` errors make sure to pass `'included_errno' => E_ALL` to `Rollbar::init`.**

### For Heroku Users

Expand Down

0 comments on commit bc272db

Please sign in to comment.