gsixme/php-vuforia

PHP版本的Vuforia web services API封装

1.0.1 2020-10-06 13:34 UTC

This package is auto-updated.

Last update: 2024-09-06 22:52:17 UTC


README

注意:此包并非Vuforia的官方包。

了解更多信息,请访问 https://developer.vuforia.com

安装

在composer文件中包含此包

"require": {
    "gsixme/php-vuforia": "^1.0.0"
}

运行 composer update

或者直接运行

composer require gsixme/php-vuforia

使用方法

创建新的VuforiaClient

$vuforiaClient = new Gsix\Vuforia\VuforiaClient([
	'access_key' => YOUR_ACCESS_KEY,
	'secret_key' => YOUR_SECRET_KEY,
]);

创建新的Target

$target = new Gsix\Vuforia\Target([
	'name' => 'Targetname',
	'width' => 320, // must be > 320
	'path' => 'image.jpg', // path to image
	'active' => 1,
	'metadata' => 'other relevant data that you may need later'
]);

可用方法

// list all targets
$vuforiaClient->targets->all();

// get target by id
$vuforiaClient->targets->get($id);

// create target
$vuforiaClient->targets->create($target);

// update target
$vuforiaClient->targets->update($id, $target);

// delete target
$vuforiaClient->targets->delete($id);

// list uplicates for target
$vuforiaClient->duplicates->get($id);

// summary for the whole db
$vuforiaClient->summary->database();

// summary for target
$vuforiaClient->summary->target($id);