内核更新

This commit is contained in:
2016-07-29 13:48:52 +08:00
parent 75125bb298
commit 9da53fc969
27 changed files with 770 additions and 530 deletions

View File

@@ -327,7 +327,7 @@ if (!function_exists('cookie')) {
Cookie::clear($value);
} elseif ('' === $value) {
// 获取
return Cookie::get($name);
return 0 === strpos($name, '?') ? Cookie::has(substr($name, 1), $option) : Cookie::get($name);
} elseif (is_null($value)) {
// 删除
return Cookie::delete($name);
@@ -497,12 +497,16 @@ if (!function_exists('redirect')) {
if (!function_exists('abort')) {
/**
* 抛出HTTP异常
* @param integer $code 状态码
* @param string $message 错误信息
* @param array $header 参数
* @param integer|Response $code 状态码 或者 Response对象实例
* @param string $message 错误信息
* @param array $header 参数
*/
function abort($code, $message = null, $header = [])
{
throw new \think\exception\HttpException($code, $message, null, $header);
if ($code instanceof Response) {
throw new \think\exception\HttpResponseException($code);
} else {
throw new \think\exception\HttpException($code, $message, null, $header);
}
}
}