PHP code example of hedeqiang / green

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

    

hedeqiang / green example snippets




use Hedeqiang\Green\Green;

$config = [
    'accessKeyId' => '',
    'accessKeySecret' => '',
    //'regionId' => '',
    //timeout => 6
    //'connectTimeout' => 6,
    //debug' => false,
];

$green = new Green($config);

$green->textScan(['文本1','文本2']); # 支持数组、字符串

$green->textFeedback($taskId); # 支持数组、字符串

$green->imageSyncScan($url, $scenes = ['porn', 'terrorism','ad']); # url 支持数组、字符串

$green->imageAsyncScan($url, $scenes = ['porn', 'terrorism','ad']); # url 支持数组、字符串

$green->imageAsyncScanResults($taskIds);

$green->imageScanFeedback($taskId);

php artisan vendor:publish --tag=green

public function index(Green $green)
{
    $response = $green->textScan(['文本1','文本2']); # 支持数组、字符串
}

public function index()
{
    $response = app('green')->textScan(['文本1','文本2']); # 支持数组、字符串
}

use Hedeqiang\Green\Facades\Green;
$response = Green::green()->textScan(['文本1','文本2']);