PHP code example of rmrevin / yii2-rollbar

1. Go to this page and download the library: Download rmrevin/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/ */

    

rmrevin / yii2-rollbar example snippets




return [
    // ...
    'bootstrap' => [
        // ...
        'rollbar',
    ],
    'components' => [
        // ...
        'rollbar' => [
            'class' => 'rmrevin\yii\rollbar\Component',
            'accessToken' => 'YOU ACCESS TOKEN',
            'environment' => 'production',
            // ... more options see in code
        ],
    ],
    // ...
];


return [
    // ...
    'components' => [
        // ...
        'errorHandler' => [
            'class' => 'rmrevin\yii\rollbar\web\ErrorHandler',
        ],
    ],
    // ...
];


return [
    // ...
    'components' => [
        // ...
        'errorHandler' => [
            'class' => 'rmrevin\yii\rollbar\console\ErrorHandler',
        ],
    ],
    // ...
];