cleantalk/remote-calls

CleanTalk `RemoteCalls` 家族类的 APBCT

安装: 290

依赖: 1

建议者: 0

安全性: 0

星星: 0

观察者: 3

分支: 0

公开问题: 0

类型:cleantalk-apbct-lib

1.6.0 2024-09-13 11:40 UTC

This package is auto-updated.

Last update: 2024-09-13 11:41:54 UTC


README

安装

composer require cleantalk/remote-calls

使用

<?php

$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()))
    }
}