Skip to content

Commit 0847eb8

Browse files
committed
README UPDATE
1 parent f60918c commit 0847eb8

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
These superglobal variables managed by SG are: $_SERVER, $_GET, $_POST, $_FILES, $_COOKIE, $_SESSION, $_REQUEST, $_ENV.
3838

39+
The version v3.0.1 support read raw data from the request body. In the case of POST requests.
40+
3941
Very important point: it is very simple.
4042

4143
### Features
@@ -46,6 +48,7 @@ Very important point: it is very simple.
4648
- Use static function method, Replace the PHP array dimension with a decimal point
4749
- Use global statement, Replace the PHP array dimension with a underline
4850
- Support for global $variable the option configuration, Default level one lookup
51+
- Support for read raw data from the POST requests
4952

5053
## Install
5154
### Supported Version
@@ -91,6 +94,8 @@ mixed sg::get(string $key [, mixed $default_value = null])
9194
bool sg::set(string $key, mixed $value)
9295
bool sg::has(string $key)
9396
bool sg::del(string $key [, mixed $... ])
97+
mixed sg::getRaw([mixed $default_value = null [, int $maxlen]])
98+
mixed sg::getCache(string $key [, mixed $default_value = null])
9499
```
95100

96101
### Inis(php.ini)

README_ZH.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636

3737
这些超全局变量有:$_SERVER,$_GET,$_POST,$_FILES,$_COOKIE,$_SESSION,$_REQUEST,$_ENV。
3838

39+
SG v3.0.1 支持POST请求,原始数据流的快速读取。请参考 [php://input](https://www.php.net/manual/zh/wrappers.php.php#wrappers.php.input)
40+
3941
当然了,也可以应用到自定义变量场景。
4042

4143
非常重要的一点:它很简单!
@@ -48,6 +50,7 @@
4850
- 采用函数调用方式时,以小数点代替PHP数组维度
4951
- 采用global声明方式时,以下划线代替PHP数组维度
5052
- 支持可配置的global $variable查找深度,默认一级查找
53+
- 支持POST请求,原始数据流的快速读取
5154

5255
## 安装
5356
### 支持PHP版本
@@ -102,6 +105,13 @@ bool sg::has(string $key)
102105
// 删除全局作用域中变量$key; 返回值: TRUE 成功,FALSE 失败
103106
// 注意: 批量删除时,有且只有一个成功结果
104107
bool sg::del(string $key [, mixed $... ])
108+
109+
// 读取POST请求情况下,原始数据
110+
// 读取速度快于 file_get_contents('php://input');
111+
mixed sg::getRaw([mixed $default_value = null [, int $maxlen]])
112+
113+
// 读取全局作用域变量, 存储到Cache,请求结束时自动释放Cache
114+
mixed sg::getCache(string $key [, mixed $default_value = null])
105115
```
106116

107117
### 配置项(php.ini)

0 commit comments

Comments
 (0)