kwn/recognizeim-bundle
Composer 安装命令:
composer require kwn/recognizeim-bundle
包简介
Symfony2 bundle that provides Recognize.im PHP client. Allows image recognizing, includes REST and SOAP API.
README 文档
README
This bundle integrates RecognizeIm client with Symfony 2.
Installation
Add KwnRecognizeImBundle to your composer.json:
{ "require": { "kwn/recognizeim-bundle": "dev-master" } }
Run update command:
$ php composer.phar update kwn/recognizeim-bundle
Enable bundle in AppKernel.php:
<?php // app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Kwn\RecognizeImBundle\KwnRecognizeImBundle(), ); }
Configuration
Configure bundle in app/config.yml file with credentials obtained from recognize.im account:
# app/config.yml kwn_recognize_im: client_id: CLIENT_ID api_key: API_KEY clapi_key: CLAPI_KEY
Ready to use
You can use recognizeim service now (or recognizeim.client.soap and recognizeim.client.rest shortcut services):
<?php use RecognizeIm\Model\Image; // ... $image = new Image('/home/kwn/Pictures/test.jpg'); $result = $this->get('recognizeim')->getRestApiClient()->recognize($image, 'multi');
There's a command for building RecognizeIm index as well:
$ php app/console recognizeim:build-index
统计信息
- 总下载量: 18
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-01-09