mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-21 04:09:55 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@261 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
c1622a7c2f
commit
31bfa47594
14 changed files with 232 additions and 52 deletions
|
|
@ -13,6 +13,7 @@
|
|||
class Context {
|
||||
|
||||
var $request_method = 'GET'; ///< @brief GET/POST/XMLRPC 중 어떤 방식으로 요청이 왔는지에 대한 값이 세팅. GET/POST/XML 3가지가 있음
|
||||
var $response_method = ''; ///< @brief HTML/XMLRPC 중 어떤 방식으로 결과를 출력할지 결정. (강제 지정전까지는 request_method를 따름)
|
||||
|
||||
var $context = NULL; ///< @brief request parameter 및 각종 환경 변수등을 정리하여 담을 변수
|
||||
|
||||
|
|
@ -287,6 +288,38 @@
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief response method를 강제로 지정 (기본으로는 request method를 이용함)
|
||||
*
|
||||
* method의 종류에는 HTML/ TEXT/ XMLRPC가 있음
|
||||
**/
|
||||
function setResponseMethod($method = "HTML") {
|
||||
$oContext = &Context::getInstance();
|
||||
return $oContext->_setResponseMethod($method);
|
||||
}
|
||||
|
||||
function _setResponseMethod($method = "HTML") {
|
||||
$this->response_method = $method;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief response method 값을 return
|
||||
*
|
||||
* method의 종류에는 HTML/ TEXT/ XMLRPC가 있음
|
||||
* 별도로 response method를 지정하지 않았다면 request method로 판단하여 결과 return
|
||||
**/
|
||||
function getResponseMethod() {
|
||||
$oContext = &Context::getInstance();
|
||||
return $oContext->_getResponseMethod();
|
||||
}
|
||||
|
||||
function _getResponseMethod() {
|
||||
if($this->response_method) return $this->response_method;
|
||||
|
||||
if($this->_getRequestMethod()=="XMLRPC") return "XMLRPC";
|
||||
return "HTML";
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief request method가 어떤것인지 판단하여 저장 (GET/POST/XMLRPC)
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
$content = $this->getContent($oModule);
|
||||
|
||||
// 요청방식에 따라 출력을 별도로
|
||||
if(Context::getRequestMethod()!="XMLRPC") {
|
||||
if(Context::getResponseMethod()!="XMLRPC") {
|
||||
Context::set('content', $content);
|
||||
|
||||
// content 래핑 (common/tpl/default.html)
|
||||
|
|
@ -119,6 +119,7 @@
|
|||
$buff .= "\n- Request/ Response info\n";
|
||||
$buff .= sprintf("\tRequest URI \t\t\t: %s:%s%s%s%s\n", $_SERVER['SERVER_NAME'], $_SERVER['SERVER_PORT'], $_SERVER['PHP_SELF'], $_SERVER['QUERY_STRING']?'?':'', $_SERVER['QUERY_STRING']);
|
||||
$buff .= sprintf("\tRequest method \t\t\t: %s\n", $_SERVER['REQUEST_METHOD']);
|
||||
$buff .= sprintf("\tResponse method \t\t: %s\n", Context::getResponseMethod());
|
||||
$buff .= sprintf("\tResponse contents size\t\t: %d byte\n", $this->getContentSize());
|
||||
if($GLOBALS['__db_queries__']) {
|
||||
$buff .= "\n- DB Queries\n";
|
||||
|
|
@ -140,7 +141,7 @@
|
|||
* @brief RequestMethod에 맞춰 헤더 출력
|
||||
***/
|
||||
function _printHeader() {
|
||||
if(Context::getRequestMethod() == 'XMLRPC') return $this->_printXMLHeader();
|
||||
if(Context::getResponseMethod() == 'XMLRPC') return $this->_printXMLHeader();
|
||||
else return $this->_printHTMLHeader();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue