mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
fix r8189.
Compatibility with PHP4 1. Use is_a function instead of 'instanceof' operator. 2. Use reference operator &. git-svn-id: http://xe-core.googlecode.com/svn/sandbox@8195 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
029f07428e
commit
e112ad0481
1 changed files with 44 additions and 44 deletions
|
|
@ -205,7 +205,7 @@ class Context {
|
|||
* @return none
|
||||
**/
|
||||
function loadDBInfo() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
if(!$self->isInstalled()) return;
|
||||
|
||||
|
|
@ -224,7 +224,7 @@ class Context {
|
|||
if($db_info->http_port) $self->set('_http_port', $db_info->http_port);
|
||||
if($db_info->https_port) $self->set('_https_port', $db_info->https_port);
|
||||
|
||||
$this->setDBInfo($db_info);
|
||||
$self->setDBInfo($db_info);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -232,7 +232,7 @@ class Context {
|
|||
* @return DB's db_type string
|
||||
**/
|
||||
function getDBType() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->db_info->db_type;
|
||||
}
|
||||
|
||||
|
|
@ -242,7 +242,7 @@ class Context {
|
|||
* @return none
|
||||
**/
|
||||
function setDBInfo($db_info) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->db_info = $db_info;
|
||||
}
|
||||
|
||||
|
|
@ -251,7 +251,7 @@ class Context {
|
|||
* @return DB information object
|
||||
**/
|
||||
function getDBInfo() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->db_info;
|
||||
}
|
||||
|
||||
|
|
@ -372,7 +372,7 @@ class Context {
|
|||
* @return FTP information object
|
||||
**/
|
||||
function getFTPInfo() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
if(!$self->isFTPRegisted()) return null;
|
||||
|
||||
$ftp_config_file = $self->getFTPConfigFile();
|
||||
|
|
@ -388,7 +388,7 @@ class Context {
|
|||
**/
|
||||
function addBrowserTitle($site_title) {
|
||||
if(!$site_title) return;
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
if($self->site_title) $self->site_title .= ' - '.$site_title;
|
||||
else $self->site_title = $site_title;
|
||||
|
|
@ -401,7 +401,7 @@ class Context {
|
|||
**/
|
||||
function setBrowserTitle($site_title) {
|
||||
if(!$site_title) return;
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->site_title = $site_title;
|
||||
}
|
||||
|
||||
|
|
@ -410,7 +410,7 @@ class Context {
|
|||
* @return browser title string (htmlspecialchars applied)
|
||||
**/
|
||||
function getBrowserTitle() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$oModuleController = &getController('module');
|
||||
$oModuleController->replaceDefinedLangCode($self->site_title);
|
||||
|
|
@ -426,7 +426,7 @@ class Context {
|
|||
function loadLang($path) {
|
||||
global $lang;
|
||||
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
if(!is_object($lang)) $lang = new stdClass;
|
||||
if(!$self->lang_type) return;
|
||||
|
||||
|
|
@ -451,7 +451,7 @@ class Context {
|
|||
* @return none
|
||||
**/
|
||||
function setLangType($lang_type = 'ko') {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$self->lang_type = $lang_type;
|
||||
$self->set('lang_type', $lang_type);
|
||||
|
|
@ -464,7 +464,7 @@ class Context {
|
|||
* @return lang_type string
|
||||
**/
|
||||
function getLangType() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->lang_type;
|
||||
}
|
||||
|
||||
|
|
@ -539,7 +539,7 @@ class Context {
|
|||
* @return none
|
||||
**/
|
||||
function setResponseMethod($method = "HTML") {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$methods = array('HTML','XMLRPC','JSON');
|
||||
$self->response_method = in_array($method, $methods)?$method:$methods[0];
|
||||
|
|
@ -550,7 +550,7 @@ class Context {
|
|||
* @return response method string (if it's not set, returns request method)
|
||||
*/
|
||||
function getResponseMethod() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
if($self->response_method) return $self->response_method;
|
||||
|
||||
|
|
@ -566,7 +566,7 @@ class Context {
|
|||
* @return none
|
||||
**/
|
||||
function setRequestMethod($type) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
($type && $self->request_method=$type) or
|
||||
(strpos($_SERVER['CONTENT_TYPE'],'json') && $this->request_method='JSON') or
|
||||
|
|
@ -657,7 +657,7 @@ class Context {
|
|||
* @return true: exists, false: otherwise
|
||||
**/
|
||||
function isUploaded() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->is_uploaded;
|
||||
}
|
||||
|
||||
|
|
@ -683,7 +683,7 @@ class Context {
|
|||
* @return request method type
|
||||
**/
|
||||
function getRequestMethod() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->request_method;
|
||||
}
|
||||
|
||||
|
|
@ -711,7 +711,7 @@ class Context {
|
|||
static $site_module_info = null;
|
||||
static $current_info = null;
|
||||
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
// retrieve virtual site information
|
||||
if(is_null($site_module_info)) $site_module_info = Context::get('site_module_info');
|
||||
|
|
@ -910,7 +910,7 @@ class Context {
|
|||
* @brief key/val로 context vars 세팅
|
||||
**/
|
||||
function set($key, $val, $set_to_get_vars = false) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->context->{$key} = $val;
|
||||
if($set_to_get_vars || $self->get_vars->{$key}) $self->get_vars->{$key} = $val;
|
||||
}
|
||||
|
|
@ -919,7 +919,7 @@ class Context {
|
|||
* @brief key값에 해당하는 값을 return
|
||||
**/
|
||||
function get($key) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->context->{$key};
|
||||
}
|
||||
|
||||
|
|
@ -931,7 +931,7 @@ class Context {
|
|||
function gets() {
|
||||
$num_args = func_num_args();
|
||||
if($num_args<1) return;
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$args_list = func_get_args();
|
||||
foreach($args_list as $v) {
|
||||
|
|
@ -944,7 +944,7 @@ class Context {
|
|||
* @brief 모든 데이터를 return
|
||||
**/
|
||||
function getAll() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->context;
|
||||
}
|
||||
|
||||
|
|
@ -952,7 +952,7 @@ class Context {
|
|||
* @brief GET/POST/XMLRPC에서 넘어온 변수값을 return
|
||||
**/
|
||||
function getRequestVars() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return clone($self->get_vars);
|
||||
}
|
||||
|
||||
|
|
@ -961,18 +961,18 @@ class Context {
|
|||
* common/js/xml_handler.js에서 이 action들에 대해서 https로 전송되도록 함
|
||||
**/
|
||||
function addSSLAction($action) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
if(in_array($action, $self->ssl_actions)) return;
|
||||
$self->ssl_actions[] = $action;
|
||||
}
|
||||
|
||||
function getSSLActions() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->ssl_actions;
|
||||
}
|
||||
|
||||
function isExistsSSLAction($action) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return in_array($action, $self->ssl_actions);
|
||||
}
|
||||
|
||||
|
|
@ -992,7 +992,7 @@ class Context {
|
|||
* @brief js file을 추가
|
||||
**/
|
||||
function addJsFile($file, $optimized = false, $targetie = '',$index=null, $type='head') {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$avail_types = array('head', 'body');
|
||||
if(!in_array($type, $avail_types)) $type = $avail_types[0];
|
||||
|
|
@ -1012,7 +1012,7 @@ class Context {
|
|||
* @brief js file을 제거
|
||||
**/
|
||||
function unloadJsFile($file, $optimized = false, $targetie = '') {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$realfile = realpath($file);
|
||||
|
||||
|
|
@ -1029,7 +1029,7 @@ class Context {
|
|||
* @brief unload all javascript files
|
||||
**/
|
||||
function unloadAllJsFiles() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->js_files = array();
|
||||
$self->js_files_map = array();
|
||||
}
|
||||
|
|
@ -1063,7 +1063,7 @@ class Context {
|
|||
* @brief returns the list of javascripts that matches the given type.
|
||||
**/
|
||||
function getJsFile($type='head') {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
ksort($self->js_files);
|
||||
|
||||
|
|
@ -1079,7 +1079,7 @@ class Context {
|
|||
* @brief CSS file 추가
|
||||
**/
|
||||
function addCSSFile($file, $optimized = false, $media = 'all', $targetie = '',$index = null) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$file = $self->normalizeFilePath($file);
|
||||
|
||||
|
|
@ -1096,7 +1096,7 @@ class Context {
|
|||
* @brief css file을 제거
|
||||
**/
|
||||
function unloadCSSFile($file, $optimized = false, $media = 'all', $targetie = '') {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
|
||||
$realfile = realpath($file);
|
||||
|
||||
|
|
@ -1113,7 +1113,7 @@ class Context {
|
|||
* @brief unload all css files
|
||||
**/
|
||||
function unloadAllCSSFiles() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->css_files = array();
|
||||
$self->css_files_map = array();
|
||||
}
|
||||
|
|
@ -1122,7 +1122,7 @@ class Context {
|
|||
* @brief CSS file 목록 return
|
||||
**/
|
||||
function getCSSFile() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
ksort($self->css_files);
|
||||
return array_values($self->css_files);
|
||||
}
|
||||
|
|
@ -1133,7 +1133,7 @@ class Context {
|
|||
function loadJavascriptPlugin($plugin_name) {
|
||||
static $loaded_plugins = array();
|
||||
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
if($plugin_name == 'ui.datepicker') $plugin_name = 'ui';
|
||||
|
||||
if($loaded_plugins[$plugin_name]) return;
|
||||
|
|
@ -1160,7 +1160,7 @@ class Context {
|
|||
* @brief HtmlHeader 추가
|
||||
**/
|
||||
function addHtmlHeader($header) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->html_header .= "\n".$header;
|
||||
}
|
||||
|
||||
|
|
@ -1168,7 +1168,7 @@ class Context {
|
|||
* @brief HtmlHeader return
|
||||
**/
|
||||
function getHtmlHeader() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->html_header;
|
||||
}
|
||||
|
||||
|
|
@ -1176,7 +1176,7 @@ class Context {
|
|||
* @brief Html Body에 css class 추가
|
||||
**/
|
||||
function addBodyClass($class_name) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->body_class[] = $class_name;
|
||||
}
|
||||
|
||||
|
|
@ -1184,7 +1184,7 @@ class Context {
|
|||
* @brief Html Body에 css class return
|
||||
**/
|
||||
function getBodyClass() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->body_class = array_unique($self->body_class);
|
||||
|
||||
return count($self->body_class)?sprintf(' class="%s"', implode(' ',$self->body_class)):'';
|
||||
|
|
@ -1194,7 +1194,7 @@ class Context {
|
|||
* @brief BodyHeader 추가
|
||||
**/
|
||||
function addBodyHeader($header) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->body_header .= "\n".$header;
|
||||
}
|
||||
|
||||
|
|
@ -1202,7 +1202,7 @@ class Context {
|
|||
* @brief BodyHeader return
|
||||
**/
|
||||
function getBodyHeader() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->body_header;
|
||||
}
|
||||
|
||||
|
|
@ -1210,7 +1210,7 @@ class Context {
|
|||
* @brief HtmlFooter 추가
|
||||
**/
|
||||
function addHtmlFooter($footer) {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
$self->html_footer .= ($self->Htmlfooter?"\n":'').$footer;
|
||||
}
|
||||
|
||||
|
|
@ -1218,7 +1218,7 @@ class Context {
|
|||
* @brief HtmlFooter return
|
||||
**/
|
||||
function getHtmlFooter() {
|
||||
$self = ($this instanceof Context)?$this:Context::getInstance();
|
||||
is_a($this,'Context')?$self=&$this:$self=&Context::getInstance();
|
||||
return $self->html_footer;
|
||||
}
|
||||
|
||||
|
|
@ -1295,4 +1295,4 @@ class Context {
|
|||
return $path;
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue