PHP code example of james.xue / laravel-ali-green
1. Go to this page and download the library: Download james.xue/laravel-ali-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/ */
james.xue / laravel-ali-green example snippets
'cache' => [
'disable' => env('ALI_CACHE_DISABLE', false),
'tag_name' => env('ALI_CACHE_TAG_NAME', 'ali_green'),
'redis' => [
'url' => env('ALI_REDIS_URL', ''),
'host' => env('ALI_REDIS_HOST', '127.0.0.1'),
'password' => env('ALI_REDIS_PASSWORD', null),
'port' => env('ALI_REDIS_PORT', '6379'),
'database' => env('ALI_REDIS_CACHE_DB', 1),
],
]
use James\Laravel\AliGreen\Facades\LaravelAliGreen;
// 文本
LaravelAliGreen::checkText('cnm');
// 图片
LaravelAliGreen::checkImg('http://nos.netease.com/yidun/2-0-0-4f903f968e6849d3930ef0f50af74fc2.jpg');
// 视频(异步)视频同步检测接口只支持通过上传视频截帧图片的方式进行检测,目前本扩展包不支持同步
LaravelAliGreen::checkVideo(['http://vfx.mtime.cn/Video/2019/03/21/mp4/190321153853126488.mp4','http://vfx.mtime.cn/Video/2019/03/19/mp4/190319222227698228.mp4']);
// 查询视频异步检测结果 taskId
LaravelAliGreen::checkResult(['vi4bzThu6JXD347OqceSNiqp-1sjE7S','vi6Apksz3BbCg56RtbnAUpzm-1sjE7S']);
shell
composer vendor:publish --tag=aliyun-green