PHP code example of datto / json-rpc-log

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

    

datto / json-rpc-log example snippets




use Datto\JsonRpc\Logged;
use Datto\JsonRpc\Simple;
use Monolog\Handler\SyslogHandler;
use Monolog\Logger;

$server = new Logged\Server(
    new Simple\Evaluator(),
    new Logger('API', array(new SyslogHandler('datto.api')))
);

$server->reply('{"jsonrpc": "2.0", "method": "math/subtract", "params": [6, 2], "id": 1}');