autoloader 구성.

class 정의
This commit is contained in:
2018-03-24 18:13:03 +09:00
parent 3363b547d5
commit 462bafe806
185 changed files with 570 additions and 225 deletions
+2 -30
View File
@@ -1,7 +1,7 @@
<?php
require(__dir__.'/../vendor/autoload.php');
require(__dir__.'/../d_setting/conf.php');
use utilphp\util as util;
/**
* conf.php 파일 생성용 코드
@@ -9,15 +9,6 @@ use utilphp\util as util;
* 이 파일만 예외적으로 lib.php, func.php를 참조하지 않고 독자적으로 동작함.
*/
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');
}
}
function parseJsonPost(){
// http://thisinterestsme.com/receiving-json-post-data-via-php/
// http://thisinterestsme.com/php-json-error-handling/
@@ -76,27 +67,8 @@ function parseJsonPost(){
return $decoded;
}
function returnJson($value, $noCache = true, $pretty = false, $die = true){
if($noCache){
SetHeaderNoCache();
}
header('Content-Type: application/json');
if($pretty){
$flag = JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT;
}
else{
$flag = JSON_UNESCAPED_UNICODE;
}
echo json_encode($value, $flag);
if($die){
die();
}
}
if(file_exist(__dir__.'/d_setting/conf.php')){
returnJson([
Json::die([
'result'=>false,
'reason'=>'이미 설정 파일이 존재합니다.'
]);