<commit_before>## Raygun4PHP CodeIgniter installation instructions

### Step 1: Install Raygun4PHP with Composer (see README.md)

### Step 2: Enable hooks

In `/application/config/config.php` set *enable_hooks* to true:

```
$config['enable_hooks'] = TRUE;
```

### Step 3: Create the file: `/application/hooks/RaygunSetup.php` with the following content:

```
namespace
{
    require_once 'vendor/autoload.php';

    class RaygunSetup {
        private $client;

        public function __construct()
        {
            $this->client = new \Raygun4php\RaygunClient("apiKey");
        }

        public function set_exception_handler()
        {
            set_exception_handler( array( $this,'exception_handler' ) );
            set_error_handler( array( $this, "error_handler" ) );
        }

        private function exception_handler($exception) {
            $this->client->SendException($exception);
        }

        private function error_handler( $errno, $errstr, $errfile, $errline) {
            $this->client->SendError($errno, $errstr, $errfile, $errline);
        }

    }
}
```

**Important:** Make sure you change *apiKey* to your Raygun API key.

### Step 4: In `/config/hooks.php`:

```
$hook['pre_controller'][] = array(
    'class'    => 'RaygunSetup',
    'function' => 'set_exception_handler',
    'filename' => 'RaygunSetup.php',
    'filepath' => 'hooks'
);
```<commit_msg>Remove private from exception and error handlers<commit_after>## Raygun4PHP CodeIgniter installation instructions

### Step 1: Install Raygun4PHP with Composer (see README.md)

### Step 2: Enable hooks

In `/application/config/config.php` set *enable_hooks* to true:

```
$config['enable_hooks'] = TRUE;
```

### Step 3: Create the file: `/application/hooks/RaygunSetup.php` with the following content:

```
namespace
{
    require_once 'vendor/autoload.php';

    class RaygunSetup {
        private $client;

        public function __construct()
        {
            $this->client = new \Raygun4php\RaygunClient("apiKey");
        }

        public function set_exception_handler()
        {
            set_exception_handler( array( $this,'exception_handler' ) );
            set_error_handler( array( $this, "error_handler" ) );
        }

        function exception_handler($exception) {
            $this->client->SendException($exception);
        }

        function error_handler( $errno, $errstr, $errfile, $errline) {
            $this->client->SendError($errno, $errstr, $errfile, $errline);
        }

    }
}
```

**Important:** Make sure you change *apiKey* to your Raygun API key.

### Step 4: In `/config/hooks.php`:

```
$hook['pre_controller'][] = array(
    'class'    => 'RaygunSetup',
    'function' => 'set_exception_handler',
    'filename' => 'RaygunSetup.php',
    'filepath' => 'hooks'
);
```
{'fraction_non_alphanumeric': 0.14665249734325186, 'fraction_numerical': 0.00495926319518243, 'mean_word_length': 3.028530670470756, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5078251', 'n_tokens_mistral': 884, 'n_tokens_neox': 858, 'n_words': 200}