많은 유틸리티 함수를 Util, FileUtil, WebUtil로 이동
This commit is contained in:
+1
-10
@@ -2,15 +2,6 @@
|
||||
namespace sammo;
|
||||
|
||||
class Json{
|
||||
private static function setHeaderNoCache(){
|
||||
if(!headers_sent()) {
|
||||
header('Expires: Wed, 01 Jan 2014 00:00:00 GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', FALSE);
|
||||
header('Pragma: no-cache');
|
||||
}
|
||||
}
|
||||
|
||||
public static function encode($value, $pretty = false){
|
||||
if($pretty){
|
||||
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
|
||||
@@ -27,7 +18,7 @@ class Json{
|
||||
|
||||
public static function die($value, $noCache = true, $pretty = false, $die = true){
|
||||
if($noCache){
|
||||
self::setHeaderNoCache();
|
||||
WebUtil::setHeaderNoCache();
|
||||
}
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
Reference in New Issue
Block a user