mawdoo3com / copyleaks-integration

这是Copyleaks集成的非官方SDK包

dev-main 2020-12-26 19:20 UTC

This package is auto-updated.

Last update: 2024-09-27 03:04:37 UTC


README

这是copyleaks.com集成的非官方SDK包。要安装此包

composer require mawdoo3com/copyleaks-integration

使用方法:

<?php

require_once __DIR__ . "/vendor/autoload.php";

use MWCopyleaks\Authentication;
use MWCopyleaks\Scan;

try {
    $auth = new Authentication(ACCOUNT_EMAIL, API_KEY);
    $token = $auth->getAccessToken();
    $scan = new Scan($token);
    $text = 'Your plain text';
    $body_base64 = base64_encode($text);
    $scan_id = uniqid();
    $scan->scanByFile($body_base64, 'filename.txt', 'https://domain.com/webhook/{STATUS}/'.$scan_id, $scan_id, true);
} catch (\Exception $ex) {
    
}