PHP code example of zafarjonovich / yii-safe-exception

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

    

zafarjonovich / yii-safe-exception example snippets




$config = [
 ...
 'components' => [
 ...
	  'errorHandler' => [
            'class' => 'zafarjonovich\YiiSafeException\application\Web',
            'savers' => [
                [
                    'class' => \zafarjonovich\YiiSafeException\saver\FileSaver::class,
                    'pathGenerator' => function() {
                        return Yii::getAlias('@app/web/exception-'.time().'.txt');
                    }
                ],
                [
                    'class' => \zafarjonovich\YiiSafeException\saver\TelegramBotSaver::class,
                    'token' => 'TELEGRAM_BOT_TOKEN',
                    'chat_ids' => ['telegram_chat_id']
                ]
            ],
            'stringGeneratorClass' => \zafarjonovich\PHPSafeException\converter\TextConverter::class,
            'traceLevel' => 2,
            'prettyException' => true
        ],

];