PHPackages                             wulacms/rest - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. wulacms/rest

ActiveWula-module[API Development](/categories/api)

wulacms/rest
============

RESTFul模块,提供RESTful风格的WEB SERVICE功能。

v2.4.0(3y ago)0137MITPHP

Since Apr 26Pushed 3y ago4 watchersCompare

[ Source](https://github.com/ninggf/wulacms_module_rest)[ Packagist](https://packagist.org/packages/wulacms/rest)[ Docs](https://www.wulacms.com/modules/rest)[ RSS](/packages/wulacms-rest/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)Dependencies (2)Versions (11)Used By (0)

此模块提供RESTFul风格的接口，客户端可以通过HTTP协议进行访问，详见[接口文档](#rest/doc)。

模块提供的触发器
--------

[](#模块提供的触发器)

触发器的处理器匀应快速返回，不适合做耗时处理。

### 1. rest\\startCall\[int $time, string $format\]

[](#1-reststartcallint-time-string-format)

开始请求时触发.

**参数:**

- $time 时间戳
- $format 请求格式

> 如果要终止后续执行，可以在处理器中直接终止。

### 2. rest\\callApi\[string $api, int $time, array $args\]

[](#2-restcallapistring-api-int-time-array-args)

开始调用api时触发.

**参数:**

- $api 要调用的api
- $time 时间戳
- $args 调用api的参数

> 如果要终止后续执行，可以在处理器中抛出`rest\classes\RestException`。

### 3. rest\\endApi\[string $api, int $time, array $args\]

[](#3-restendapistring-api-int-time-array-args)

api调用结束时触发.

**参数:**

- $api 要调用的api
- $time 时间戳
- $args 调用api的参数

### 4. rest\\errApi\[string $api, int $time, array $result\]

[](#4-resterrapistring-api-int-time-array-result)

api调用出错时触发.

**参数:**

- $api 要调用的api
- $time 时间戳
- $result 返回值

### 5. rest\\callError\[int $time, array $result\]

[](#5-restcallerrorint-time-array-result)

调用出错时触发

**参数:**

- $time 时间戳
- $result 返回值

### 6. rest\\endCall\[int $time, array $result\]

[](#6-restendcallint-time-array-result)

调用结束时触发

**参数:**

- $time 时间戳
- $result 返回值

> 以上触发器的处理器匀应快速返回，不适合做耗时处理。

配置
--

[](#配置)

`conf/rest_config.php`是其配置文件:

```
