ariarijp/redash-api-client
最新稳定版本:0.2.0
Composer 安装命令:
composer require ariarijp/redash-api-client
包简介
re:dash results API client for PHP.
README 文档
README
re:dash results API client for PHP.
Installaton
$ composer require ariarijp/redash-api-client
Usage
<?php require __DIR__.'/vendor/autoload.php'; define('REDASH_URL', 'http://localhost:5000/'); define('REDASH_QUERY_API_KEY', 'YOUR_QUERY_API_KEY'); define('REDASH_USER_API_KEY', 'YOUR_USER_API_KEY'); define('REDASH_QUERY_ID', 1); // Fetch data without refresh option. // You can fetch data without User API Key. $client = new RedashApiClient\Client(REDASH_URL); $client->fetch(REDASH_QUERY_ID, REDASH_QUERY_API_KEY, false, function (array $row, array $columns) { $row = array_map(function ($column) use ($row) { return $row[$column]; }, $columns); echo implode("\t", $row).PHP_EOL; }); // Fetch data with refresh option. // When you want to fetch data with refresh option, You have to use User API Key. $client = new RedashApiClient\Client(REDASH_URL, REDASH_USER_API_KEY); $client->fetch(REDASH_QUERY_ID, null, true, function (array $row, array $columns) { $row = array_map(function ($column) use ($row) { return $row[$column]; }, $columns); echo implode("\t", $row).PHP_EOL; });
License
MIT
Author
统计信息
- 总下载量: 877
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-05-02