PHP code example of accessd / yii2-rollbar

1. Go to this page and download the library: Download accessd/yii2-rollbar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

accessd / yii2-rollbar example snippets


'bootstrap' => ['rollbar'],
'components' => [
    'rollbar' => [
        'class' => 'accessd\yii2_rollbar\RollbarComponent',
        'accessToken' => 'POST_SERVER_ITEM_ACCESS_TOKEN',
    ],
],

'components' => [
  'rollbar' => [
      'environment' => 'production', // you environment name
  ],
],

'components' => [
  'errorHandler' => [
      // handling uncaught PHP exceptions, execution and fatal errors
      'class' => 'accessd\yii2_rollbar\WebErrorHandler',
  ],
],

'components' => [
  'errorHandler' => [
      // handling uncaught PHP exceptions, execution and fatal errors
      'class' => 'accessd\yii2_rollbar\ConsoleErrorHandler',
  ],
],
bash
php composer.phar