# ⚙️ Configuration

# File-based

Configure XR Debug by creating a file named xr.php in your project root directory with the following options:

Property Type Effect
enable bool Controls sending messages to the server
host string The host where XR Debug server is running
port int The Port to connect to the host
key string Private key

The following example is a xr.php file with default settings.

<?php

return [
    'enable' => true,
    'host' => 'localhost',
    'port' => 27420,
    'key' => '',
];

We recommend adding xr.php to your .gitignore.

# Code-based

If you want to handle XR Debug settings somewhere within your existing application logic and not depend on the xr.php file:

use Chevere\Xr\Xr;
use Chevere\Xr\XrInstance;

$enable = true;
$host = 'localhost';
$port = 27420;
$key = file_get_contents('private.key');
new XrInstance(
    new Xr(
        enable: $enable,
        host: $host,
        port: $port,
        key: $key
    )
);
Last Updated: 11/16/2022, 9:45:14 PM