【发布时间】:2012-10-26 11:11:03
【问题描述】:
我正在使用 Phil Sturgeon 编写的以下代码:https://github.com/philsturgeon/codeigniter-restserver
我无法在他的文档中看到控制器一侧的限制选项是如何设置的。
RESTController 控制器文件有一些参考,例如
显示受保护的功能,另外还有:
// How many times can you get to this method an hour?
$limit = $this->methods[$controller_method]['limit'];
从 rest.php 配置:
/* |------------------------------------------------- ------------------------------------- | REST 启用限制 |------------------------------------------------- ------------------------------------- | |当设置为 true 时 REST_Controller 将计算使用次数 每种方法 |每小时通过一个 API 密钥。这是一般规则,可以 在 | 中被覆盖每个控制器中的 $this->method 数组。 |
谁能帮我解决这个问题?目前正在拔头发:-)
目前我的控制器方法之一:
function listservices_get()
{
$organisation_id = $this->get('id');
$organisations = $this->api_buyus_model->list_services($organisation_id);
if($organisations)
{
$this->response($organisations, 200);
}
else
{
$this->response(array('error' => '1', 'errorDesc' => 'Buy us services list could not be retrieved.'), 400);
}
}
【问题讨论】:
-
有什么问题?你想要没有限制吗?你想为某事设置限制吗?
标签: php api codeigniter