mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-07 23:22:48 +08:00
改进Response类的send方法 改进Input类的自动转换
This commit is contained in:
@@ -465,7 +465,11 @@ class Input
|
|||||||
// 字符串
|
// 字符串
|
||||||
case 's':
|
case 's':
|
||||||
default:
|
default:
|
||||||
|
if (is_scalar($data)) {
|
||||||
$data = (string) $data;
|
$data = (string) $data;
|
||||||
|
} else {
|
||||||
|
throw new Exception('变量类型不允许:' . gettype($data));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,12 @@ class Response
|
|||||||
header($name . ':' . $val);
|
header($name . ':' . $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (is_scalar($data)) {
|
||||||
echo $data;
|
echo $data;
|
||||||
|
} else {
|
||||||
|
throw new Exception('不支持的数据类型输出:' . gettype($data));
|
||||||
|
}
|
||||||
|
|
||||||
if (function_exists('fastcgi_finish_request')) {
|
if (function_exists('fastcgi_finish_request')) {
|
||||||
// 提高页面响应
|
// 提高页面响应
|
||||||
fastcgi_finish_request();
|
fastcgi_finish_request();
|
||||||
|
|||||||
Reference in New Issue
Block a user