PHP code example of cleantalk / remote-calls

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

    

cleantalk / remote-calls example snippets




$storage_handler = new \Cleantalk\Custom\StorageHandler\StorageHandler();
$api_key = 'your_api_key';

$remote_calls = new \Cleantalk\Common\RemoteCalls\RemoteCalls($api_key, $storage_handler);

if ( $remote_calls::check() ) {
    try {
        die $remote_calls->process();
    } catch ( \Cleantalk\Common\RemoteCalls\Exceptions\RemoteCallsException $exception ) {
        // Do logging here
        die 'FAIL ' . json_encode(array('error' => $exception->getMessage()))
    }
}