quzhe
0962b21232
让Request支持json方式的POST
...
目前RESTful API用json方式提交的很多
目前PUT/PATCH/DELETE方法均可以支持json,但POST方法不能,这不对等
其实更好的方法是判断header里content-type是否为application/json,但因为目前header属性采用的是懒加载,所以暂时沿用目前的字符串判断
2016-11-29 11:40:02 +08:00
thinkphp
a10cc77e40
数组语法调整
2016-11-21 15:33:55 +08:00
thinkphp
7eaf95de9b
请求缓存的有效期如果传入false表示不缓存 路由规则的cache参数传入false也同样表示不缓存 即使开启了全局请求缓存
2016-11-09 13:53:36 +08:00
thinkphp
53329b79b6
Requesst类的Input方法和input助手函数的filter参数支持传入null 表示当前不过滤
2016-11-09 12:17:42 +08:00
thinkphp
57f206b757
增强请求缓存功能 支持全局配置 增加request_cache配置参数 增加特殊缓存规则定义 如果同一次请求存在多次请求缓存调用 则第一次有效
2016-11-01 17:51:38 +08:00
thinkphp
594d263ea2
注释调整
2016-10-31 18:07:06 +08:00
thinkphp
eb103a63a5
改进Request类ip方法
2016-10-22 13:21:49 +08:00
HyperQing
c64a335884
为Request类的几个方法完善注释
...
在phpstorm2016.2.1中,使用下列语句会提示警告:
>Method __toString is not implemented for '\think\Request' less... (Ctrl+F1)
This inspection detects attempts to convert objects without __toString() method implementation to string, since PHP 5.2.0, it would cause E_RECOVERABLE_ERROR. "Check __toString exists for each expression type": if the option is on, the inspection will check all possible types of the expression and report if at least one ot them doesn't contain __toString() method implementation.
```
$request = Request::instance();
echo "当前模块名称是" . $request->module();// 这句会被IDE提示警告
echo "当前控制器名称是" . $request->controller();// 这句会被IDE提示警告
echo "当前操作名称是" . $request->action();// 这句就不会
```
后来发现是注释引起的问题,注释中有@return string|$this。而action()方法却写成@return string。个人认为应该统一写成@return string|Request 比较合适。学识短浅,仅供参考
```
/**
* 设置或者获取当前的模块名
* @access public
* @param string $module 模块名
* @return string|$this
*/
public function module($module = null)
```
2016-10-21 11:36:55 +08:00
thinkphp
4554f99451
改进
2016-10-15 11:09:34 +08:00
thinkphp
2ef3ad748b
改进
2016-10-15 11:03:56 +08:00
thinkphp
ba555eba00
Request类的架构方法改为protected
2016-10-14 16:28:26 +08:00
thinkphp
aa0028cef6
Request类的header方法增加自定义header支持
2016-10-12 18:06:49 +08:00
thinkphp
2bd63fec40
改进请求缓存支持
2016-09-28 20:57:02 +08:00
thinkphp
e2335946cc
支持设置某个url后缀的访问进行请求缓存
2016-09-27 21:05:22 +08:00
thinkphp
6278cf13e9
改进Request类cache方法
2016-09-27 18:33:29 +08:00
thinkphp
4bd9c4c915
请求缓存标识支持传入__URL__ 表示当前url地址作为缓存标识进行请求缓存
2016-09-27 18:25:09 +08:00
thinkphp
9b16b0c24b
请求缓存发送304
2016-09-26 09:27:13 +08:00
thinkphp
f5f9fcfb92
支持表单模拟ajax和pjax请求 增加var_ajax var_pjax 配置参数
2016-09-25 19:31:06 +08:00
thinkphp
10db21a084
修正cache方法的变量规则检查位置
2016-09-24 22:17:46 +08:00
thinkphp
ba85658c58
request类请求缓存cache方法标识支持变量规则
2016-09-24 22:08:55 +08:00
thinkphp
450d7ab313
增加请求缓存功能 路由支持设置请求缓存
2016-09-24 18:14:59 +08:00
thinkphp
093d356c31
改进操作方法的对象自动注入 Requesst类增加getInput方法 用于获取 php://input值
2016-09-22 13:45:02 +08:00
thinkphp
3a983aa3e1
Request类增加bind方法用于动态绑定属性 Route类的模型绑定直接绑定到Request实例对象的属性 便于获取
2016-09-12 15:47:52 +08:00
过客
b7de2f0db4
解决 php7 数组指针问题
...
数组存在key()方法无法正确获得预定值
2016-09-09 18:54:00 +08:00
thinkphp
3e062ed3a7
Request类create方法改进,增加单元测试
2016-09-05 15:40:46 +08:00
thinkphp
4bde059d08
改进Request类的type方法判断
2016-09-02 12:24:40 +08:00
thinkphp
23e827c770
改进Request类的request方法
2016-08-23 10:46:58 +08:00
thinkphp
107f77474e
改进Request类param方法的优先获取顺序 路由变量优先 路由规则中的额外参数纳入 路由变量
2016-08-22 18:11:51 +08:00
thinkphp
40582d4012
改进Request类 避免数据批量赋值的时候 影响原始数据获取
2016-08-17 14:27:30 +08:00
thinkphp
90d9aaa65e
修正request类
2016-08-17 13:39:30 +08:00
thinkphp
e2e77b911d
改进Request类 filter属性的初始化
2016-08-17 12:06:04 +08:00
thinkphp
f865efec65
改进Request类的isAjax和isPjax方法
2016-08-17 11:55:32 +08:00
thinkphp
fd99c07e10
增加token助手函数 用于在页面快速显示令牌
2016-08-15 12:37:10 +08:00
thinkphp
1440277478
改进Validate类的is方法,添加data参数的默认值
2016-08-15 11:37:42 +08:00
thinkphp
03ec96c7f9
改进request类的token方法
2016-08-15 11:31:54 +08:00
thinkphp
9dd5a508d0
添加表单令牌支持
2016-08-14 21:52:48 +08:00
thinkphp
699f268232
改进Request类 在赋值 get post put route方法的时候 清空param变量,并且取消 param方法的赋值功能
2016-08-12 17:36:55 +08:00
zzpuser
b48d81c164
修正“isMobile”方法,防止在特殊情况下崩溃
...
若HTTP请求中HTTP_ACCEPT参数缺失会导致页面错误,因此首先需要判断一下该参数是否存在
2016-08-07 17:24:46 +08:00
thinkphp
4cf9d17aec
改进Request类的create方法
2016-07-29 15:07:00 +08:00
thinkphp
8a5f4ff402
改进Request类支持PATCH请求变量获取 改进请求类型伪造后的数据获取
2016-07-20 14:31:58 +08:00
thinkphp
a4600c8032
删除Request类paramWithFile方法 改为 param(true) 获取带文件的数据
2016-07-18 14:47:26 +08:00
thinkphp
215225bc5f
Request类增加paramWithFile方法 包含上传文件信息
...
Validate类增加image验证规则 并改进max min length支持多种数据类型
2016-07-18 14:35:24 +08:00
thinkphp
4c8e7e4f21
改进Request类的input方法
2016-07-12 16:31:46 +08:00
thinkphp
b697c7f565
改进Request类的file方法的多文件上传获取支持
2016-07-12 11:30:30 +08:00
thinkphp
7718730600
改进Request类的put方法 支持使用json格式解析变量
2016-07-11 21:44:00 +08:00
thinkphp
6c6ac73ee0
优化Request类的param方法 param get post put request delete server cookie env方法的第一个参数传入false 则表示获取原始数据 不进行过滤
2016-07-06 18:45:08 +08:00
thinkphp
72c56548e8
改进闭包路由的参数或者 改进路由参数的获取 支持单独获取路由
2016-07-06 18:17:11 +08:00
lilwil
441b482594
Request注入方法返回值 ( #180 )
2016-06-29 21:08:28 -05:00
thinkphp
7f13d70d0b
改进App类和Request类
2016-06-24 23:41:02 +08:00
thinkphp
c4ef774882
修正
2016-06-24 17:45:27 +08:00