odiemiranda / oralogic-api
简单的OrangeLogic搜索API包装器
v1.01
2017-10-12 04:27 UTC
Requires
- php: >=5.3
- ext-curl: *
Requires (Dev)
- phpunit/phpunit: 4.0.*
- vlucas/phpdotenv: ^2.0
This package is not auto-updated.
Last update: 2024-09-29 04:36:50 UTC
README
简单的OrangeLogic搜索API包装器,使用PHP编写。
安装
您可以使用Composer安装orangelogic-api
composer require odiemiranda/orangelogic-api
然后您需要
- 运行
composer install以将这些依赖项添加到您的vendor目录 - 使用此行将自动加载器添加到您的应用程序中:
require("vendor/autoload.php")
或者,您可以直接下载 OrangeLogic.php 文件并手动包含它
include('./OrangeLogic.php');
示例
首先,使用 use-ing 语句引入类,并使用域名、登录名和密码创建一个实例
use \OdieMiranda\OrangeLogic\OrangeLogic; $api = new OrangeLogic('domain.com', 'LoginName', 'password');
然后,搜索媒体库
$api->search('Georgia: DR-TB patients find hope in new treatments'); print_r($api->getItems());
以获取搜索结果的下一页
$api->search('Georgia: DR-TB patients find hope in new treatments', '', '', 2); print_r($api->getItems());
贡献
这是一个相当简单的包装器,但通过贡献可以使其变得更好。如果您想提出改进建议,请在提交pull-request之前先提出一个issue进行讨论。
欢迎提交修复bug的pull-requests - 请在消息中解释您要修复的bug。