PHP code example of zhusaidong / ysk-plus-sdk

1. Go to this page and download the library: Download zhusaidong/ysk-plus-sdk 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/ */

    

zhusaidong / ysk-plus-sdk example snippets


return [
	'appKey'    => 'appKey',
	'secretKey' => 'secretKey',
	'device_sn' => 'device_sn',
];

$ysk->faceLib;	//face lib
$ysk->face;	//face
$ysk->device;	//device
$ysk->access;	//device access



use Zhusaidong\YskPlus\YskPlus;

$ysk = new YskPlus('appKey', 'secretKey');
$apiRes = $ysk->faceLib->create('customer_code', 'my lib');
if($apiRes->getError() === FALSE)
{
	var_dump('ok', $apiRes->get());
}
else
{
	var_dump('error', $apiRes->getErrorMessage());
}

$ysk = setLog($logPath);

$device_ext_info = new DeviceExtInfo();
$ysk->device->create('device_sn', 'device_name', $device_ext_info);

//the face image can be file path or file url
$face_images = [$face_image1, $face_image2];

$ysk->face->create('person_code', 'face_lib_code', 'person_name', [], $face_images);