Skip to content

Commit

Permalink
Merge pull request rollbar#67 from rollbar/readme-fix
Browse files Browse the repository at this point in the history
Add CodeIgniter instructions
  • Loading branch information
ArturMoczulski authored Jun 16, 2017
2 parents af55434 + bc272db commit a7b2f48
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,33 @@ Rollbar::init($config, $set_exception_handler, $set_error_handler);
?>
```

### For CodeIgniter Users

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

First, add the addon:
Expand Down

0 comments on commit a7b2f48

Please sign in to comment.