定制 dustindoiron/photodna-client 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

dustindoiron/photodna-client

最新稳定版本:v1.0.0

Composer 安装命令:

composer require dustindoiron/photodna-client

包简介

A MSFT PhotoDNA client, written in PHP

README 文档

README

A basic Match and Report API client for Microsoft's PhotoDNA service. You should have a valid PhotoDNA Moderation account and an NCMEC contact prior to using this client.

Usage: Create a client...

$configuration = new PhotoDNA\Configuration(
    apiKey: 'apiKey',
    endpoint: 'https://api.microsoftmoderator.com/photodna/v1.0/', // default
    ncmecUsername: 'ncmecUsername',
    ncmecPassword: 'ncmecPassword'
);
$client = new PhotoDNA\Client($configuration);

Create a resource...

$imageFile = new PhotoDNA\Resource\ImageFile('/path/to/location');
$imageUrl = new PhotoDNA\Resource\ImageLocation('https://url.com/file.png');

$result = $client->match($imageFile);
// or
$result = $client->match($imageLocation);
// enhanced matching
$result = $client->match($imageFile, true);

Report a resource...

// Fluently set

$violation = new PhotoDNA\Resource\Violation()
    ->set('IncidentTime', '9/10/2014 9:08:14 PM');
    ->set('ViolationContentCollection', [
        'Name' => $imageFile->getFilename(),
        'Value' => $imageFile->getBase64(),
        'UploadIpAddress' => '127.0.0.1',
        // etc
    ]);
$reporter = new PhotoDNA\Resource\Reporter()
    ->set('OrgName', 'ExampleOrgName');
    ->set('ReporterName', 'Example Reporter')
    ->set('ReporterEmail', 'test@example.com');

$reportee = new PhotoDNA\Resource\Reportee()
    ->set('ReporteeName', 'Reportee Name')
    ->set('ReporteeIPAddress', '127.0.0.1');

$response = $client->report($reportee, $reporter, $violation, isTest: true);

统计信息

  • 总下载量: 1.19k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2024-07-23