Files
core/twe/j_map.php
T
Hide_D 9ef4e2debb json 반환시 캐싱하지 않도록 설정.
연감용 json 반환에는 캐싱할 수 있도록 설정
2018-02-02 09:36:49 +09:00

44 lines
858 B
PHP

<?php
include 'lib.php';
include 'func.php';
use utilphp\util as util;
//읽기 전용이다. 빠르게 세션 끝내자
session_write_close();
$defaultPost = [
'year' => null,
'month' => null,
'aux' => null,
'neutralView' => false,
'showMe' => true
];
$post = array_merge($defaultPost, parseJsonPost());
if($post['year']){
if($post['month'] < 1 || $post['month'] > 12){
returnJson([
'result'=>false,
'reason'=>'잘못된 개월 값'
]);
}
$post['year'] = intval($post['year']);
$post['month'] = intval($post['month']);
}
else{
$post['year'] = null;
$post['month'] = null;
}
$result = getWorldMap($post);
if($post['year'] && $post['month'] && $result['result']){
//연감 자료는 캐싱 가능
returnJson($result, false);
}
else{
returnJson($result);
}