PHP code example of tjournal / reviewer

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

    

tjournal / reviewer example snippets




try {
    $storage = new Predis\Client();

    $reviewer = new TJ\Reviewer({APPID});
    $reviewer->setStorage($storage);
    $reviewer->setSlackSettings(['endpoint' => 'https://hooks.slack.com/services/ABCDE/QWERTY', 'channel' => '#reviews']);
    $reviewer->start();
} catch (Exception $e) {
    // handle errors
}

use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$monolog = new Logger('Reviewer');
$monolog->pushHandler(new StreamHandler('/tmp/reviewer.log', Logger::DEBUG));

$reviewer->setLogger($monolog);

try {
    $reviewer = new TJ\Reviewer({APPID});
    ...
    $reviewer->countries = ['ru' => 'Russia', 'us' => 'US', 'fi' => 'Finland', 'fr' => 'France'];

    $reviewer->start();
} catch (Exception $e) {
    // handle errors
}
bash
sudo crontab -e
*/15 * * * *  php crontab.php