From e30506b9350c349d4965a2b3242b4128c674d113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=83=9C=EC=83=81?= Date: Wed, 11 Feb 2015 17:31:25 +0900 Subject: [PATCH 1/3] =?UTF-8?q?Context::=ED=95=A8=EC=88=98=EB=AA=85=20?= =?UTF-8?q?=EC=B2=98=EB=9F=BC=20=EC=93=B0=EC=9D=BC=20=EC=88=98=20=EC=9E=88?= =?UTF-8?q?=EB=8A=94=20=ED=95=A8=EC=88=98=EB=93=A4=EC=97=90=20static=20?= =?UTF-8?q?=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Context클래스의 함수 내부에서 $this 변수가 사용되지 않거나, is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); 를 통해 $self 변수를 이용하는 경우 static 변수를 붙임. --- classes/context/Context.class.php | 154 +++++++++++++++--------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index d47f34e77..135510faa 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -159,7 +159,7 @@ class Context * * @return object Instance */ - function &getInstance() + static function &getInstance() { static $theInstance = null; if(!$theInstance) @@ -410,7 +410,7 @@ class Context * * @return void */ - function loadDBInfo() + static function loadDBInfo() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -496,7 +496,7 @@ class Context * * @return string DB's db_type */ - function getDBType() + static function getDBType() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->db_info->master_db["db_type"]; @@ -508,7 +508,7 @@ class Context * @param object $db_info DB information * @return void */ - function setDBInfo($db_info) + static function setDBInfo($db_info) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->db_info = $db_info; @@ -519,7 +519,7 @@ class Context * * @return object DB information */ - function getDBInfo() + static function getDBInfo() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->db_info; @@ -530,7 +530,7 @@ class Context * * @return object SSL status (Optional - none|always|optional) */ - function getSslStatus() + static function getSslStatus() { $dbInfo = self::getDBInfo(); return $dbInfo->use_ssl; @@ -541,7 +541,7 @@ class Context * * @return string Default URL */ - function getDefaultUrl() + static function getDefaultUrl() { $db_info = self::getDBInfo(); return $db_info->default_url; @@ -552,7 +552,7 @@ class Context * * @return array Supported languages */ - function loadLangSupported() + static function loadLangSupported() { static $lang_supported = null; if(!$lang_supported) @@ -573,7 +573,7 @@ class Context * * @return array Selected languages */ - function loadLangSelected() + static function loadLangSelected() { static $lang_selected = null; if(!$lang_selected) @@ -679,7 +679,7 @@ class Context * * @return bool True: FTP information is registered, False: otherwise */ - function isFTPRegisted() + static function isFTPRegisted() { return file_exists(self::getFTPConfigFile()); } @@ -689,7 +689,7 @@ class Context * * @return object FTP information */ - function getFTPInfo() + static function getFTPInfo() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -709,7 +709,7 @@ class Context * @param string $site_title Browser title to be added * @return void */ - function addBrowserTitle($site_title) + static function addBrowserTitle($site_title) { if(!$site_title) { @@ -733,7 +733,7 @@ class Context * @param string $site_title Browser title to be set * @return void */ - function setBrowserTitle($site_title) + static function setBrowserTitle($site_title) { if(!$site_title) { @@ -748,7 +748,7 @@ class Context * * @return string Browser title(htmlspecialchars applied) */ - function getBrowserTitle() + static function getBrowserTitle() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -762,7 +762,7 @@ class Context * Return layout's title * @return string layout's title */ - public function getSiteTitle() + static public function getSiteTitle() { $oModuleModel = getModel('module'); $moduleConfig = $oModuleModel->getModuleConfig('module'); @@ -789,7 +789,7 @@ class Context * @param string $path Path of the language file * @return void */ - function loadLang($path) + static function loadLang($path) { global $lang; @@ -912,7 +912,7 @@ class Context * @param string $lang_type Language type. * @return void */ - function setLangType($lang_type = 'ko') + static function setLangType($lang_type = 'ko') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -927,7 +927,7 @@ class Context * * @return string Language type */ - function getLangType() + static function getLangType() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->lang_type; @@ -939,7 +939,7 @@ class Context * @param string $code Language variable name * @return string If string for the code exists returns it, otherwise returns original code */ - function getLang($code) + static function getLang($code) { if(!$code) { @@ -959,7 +959,7 @@ class Context * @param string $val `$code`s value * @return void */ - function setLang($code, $val) + static function setLang($code, $val) { if(!isset($GLOBALS['lang'])) { @@ -974,7 +974,7 @@ class Context * @param object $source_obj Conatins strings to convert * @return object converted object */ - function convertEncoding($source_obj) + static function convertEncoding($source_obj) { $charset_list = array( 'UTF-8', 'EUC-KR', 'CP949', 'ISO8859-1', 'EUC-JP', 'SHIFT_JIS', 'CP932', @@ -1015,7 +1015,7 @@ class Context * @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5 * @return void */ - function checkConvertFlag(&$val, $key = null, $charset = null) + static function checkConvertFlag(&$val, $key = null, $charset = null) { static $flag = TRUE; if($charset) @@ -1042,7 +1042,7 @@ class Context * @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5 * @return object converted object */ - function doConvertEncoding(&$val, $key = null, $charset) + static function doConvertEncoding(&$val, $key = null, $charset) { if (is_array($val)) { @@ -1057,7 +1057,7 @@ class Context * @param string $str String to convert * @return string converted string */ - function convertEncodingStr($str) + static function convertEncodingStr($str) { $obj = new stdClass(); $obj->str = $str; @@ -1071,7 +1071,7 @@ class Context * @param string $method Response method. [HTML|XMLRPC|JSON] * @return void */ - function setResponseMethod($method = 'HTML') + static function setResponseMethod($method = 'HTML') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1084,7 +1084,7 @@ class Context * * @return string Response method. If it's not set, returns request method. */ - function getResponseMethod() + static function getResponseMethod() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1105,7 +1105,7 @@ class Context * @param string $type Request method. (Optional - GET|POST|XMLRPC|JSON) * @return void */ - function setRequestMethod($type = '') + static function setRequestMethod($type = '') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1295,7 +1295,7 @@ class Context * * @return bool True: exists, False: otherwise */ - function isUploaded() + static function isUploaded() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->is_uploaded; @@ -1349,7 +1349,7 @@ class Context * Return request method * @return string Request method type. (Optional - GET|POST|XMLRPC|JSON) */ - function getRequestMethod() + static function getRequestMethod() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->request_method; @@ -1359,7 +1359,7 @@ class Context * Return request URL * @return string request URL */ - function getRequestUrl() + static function getRequestUrl() { static $url = null; if(is_null($url)) @@ -1381,7 +1381,7 @@ class Context * Return js callback func. * @return string callback func. */ - function getJSCallbackFunc() + static function getJSCallbackFunc() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->js_callback_func; @@ -1397,7 +1397,7 @@ class Context * @param bool $autoEncode If TRUE, url encode automatically, detailed. Use this option, $encode value should be TRUE * @return string URL */ - function getUrl($num_args = 0, $args_list = array(), $domain = null, $encode = TRUE, $autoEncode = FALSE) + static function getUrl($num_args = 0, $args_list = array(), $domain = null, $encode = TRUE, $autoEncode = FALSE) { static $site_module_info = null; static $current_info = null; @@ -1638,7 +1638,7 @@ class Context * @param string $domain Domain * @retrun string converted URL */ - function getRequestUri($ssl_mode = FOLLOW_REQUEST_SSL, $domain = null) + static function getRequestUri($ssl_mode = FOLLOW_REQUEST_SSL, $domain = null) { static $url = array(); @@ -1737,7 +1737,7 @@ class Context * @param mixed $set_to_get_vars If not FALSE, Set to get vars. * @return void */ - function set($key, $val, $set_to_get_vars = 0) + static function set($key, $val, $set_to_get_vars = 0) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->context->{$key} = $val; @@ -1762,7 +1762,7 @@ class Context * @param string $key Key * @return string Key */ - function get($key) + static function get($key) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1778,7 +1778,7 @@ class Context * * @return object */ - function gets() + static function gets() { $num_args = func_num_args(); if($num_args < 1) @@ -1801,7 +1801,7 @@ class Context * * @return object All data */ - function getAll() + static function getAll() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->context; @@ -1812,7 +1812,7 @@ class Context * * @return Object Request variables. */ - function getRequestVars() + static function getRequestVars() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); if($self->get_vars) @@ -1828,7 +1828,7 @@ class Context * @param string $action act name * @return void */ - function addSSLAction($action) + static function addSSLAction($action) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1852,7 +1852,7 @@ class Context * @param string $action act name * @return void */ - function addSSLActions($action_array) + static function addSSLActions($action_array) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1880,7 +1880,7 @@ class Context * @param string $action act name * @return void */ - function subtractSSLAction($action) + static function subtractSSLAction($action) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1898,7 +1898,7 @@ class Context * * @return string acts in array */ - function getSSLActions() + static function getSSLActions() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); if($self->getSslStatus() == 'optional') @@ -1913,7 +1913,7 @@ class Context * @param string $action act name * @return bool If SSL exists, return TRUE. */ - function isExistsSSLAction($action) + static function isExistsSSLAction($action) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return isset($self->ssl_actions[$action]); @@ -1926,7 +1926,7 @@ class Context * @param string $file file path * @return string normalized file path */ - function normalizeFilePath($file) + static function normalizeFilePath($file) { if($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE) { @@ -1948,7 +1948,7 @@ class Context * @param string $file file path * @return string Converted file path */ - function getAbsFileUrl($file) + static function getAbsFileUrl($file) { $file = self::normalizeFilePath($file); if(strpos($file, './') === 0) @@ -1979,7 +1979,7 @@ class Context * $args[3]: index * */ - function loadFile($args) + static function loadFile($args) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1994,7 +1994,7 @@ class Context * @param string $media Media query * @return void */ - function unloadFile($file, $targetIe = '', $media = 'all') + static function unloadFile($file, $targetIe = '', $media = 'all') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadFile($file, $targetIe, $media); @@ -2006,7 +2006,7 @@ class Context * @param string $type Unload target (optional - all|css|js) * @return void */ - function unloadAllFiles($type = 'all') + static function unloadAllFiles($type = 'all') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadAllFiles($type); @@ -2025,7 +2025,7 @@ class Context * @param string $autoPath If path not readed, set the path automatically. * @return void */ - function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null) + static function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null) { if($isRuleset) { @@ -2055,7 +2055,7 @@ class Context * @param string $targetie target IE * @return void */ - function unloadJsFile($file, $optimized = FALSE, $targetie = '') + static function unloadJsFile($file, $optimized = FALSE, $targetie = '') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadFile($file, $targetie); @@ -2066,7 +2066,7 @@ class Context * * @return void */ - function unloadAllJsFiles() + static function unloadAllJsFiles() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadAllFiles('js'); @@ -2079,7 +2079,7 @@ class Context * @param string $filename File name * @return void */ - function addJsFilter($path, $filename) + static function addJsFilter($path, $filename) { $oXmlFilter = new XmlJSFilter($path, $filename); $oXmlFilter->compile(); @@ -2092,7 +2092,7 @@ class Context * @param array $files File list * @return array File list */ - function _getUniqueFileList($files) + static function _getUniqueFileList($files) { ksort($files); $files = array_values($files); @@ -2115,7 +2115,7 @@ class Context * @param string $type Added position. (head:.., body:..) * @return array Returns javascript file list. Array contains file, targetie. */ - function getJsFile($type = 'head') + static function getJsFile($type = 'head') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->oFrontEndFileHandler->getJsFileList($type); @@ -2133,7 +2133,7 @@ class Context * @return void * */ - function addCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '', $index = 0) + static function addCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '', $index = 0) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->loadFile(array($file, $media, $targetie, $index)); @@ -2149,7 +2149,7 @@ class Context * @param string $targetie target IE * @return void */ - function unloadCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '') + static function unloadCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadFile($file, $targetie, $media); @@ -2160,7 +2160,7 @@ class Context * * @return void */ - function unloadAllCSSFiles() + static function unloadAllCSSFiles() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadAllFiles('css'); @@ -2171,7 +2171,7 @@ class Context * * @return array Returns css file list. Array contains file, media, targetie. */ - function getCSSFile() + static function getCSSFile() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->oFrontEndFileHandler->getCssFileList(); @@ -2182,7 +2182,7 @@ class Context * @param string $pluginName * @return stdClass */ - function getJavascriptPluginInfo($pluginName) + static function getJavascriptPluginInfo($pluginName) { if($plugin_name == 'ui.datepicker') { @@ -2237,7 +2237,7 @@ class Context * @param string $plugin_name plugin name * @return void */ - function loadJavascriptPlugin($plugin_name) + static function loadJavascriptPlugin($plugin_name) { static $loaded_plugins = array(); @@ -2295,13 +2295,13 @@ class Context * @param string $header add html code before . * @return void */ - function addHtmlHeader($header) + static function addHtmlHeader($header) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->html_header .= "\n" . $header; } - function clearHtmlHeader() + static function clearHtmlHeader() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->html_header = ''; @@ -2312,7 +2312,7 @@ class Context * * @return string Added html code before */ - function getHtmlHeader() + static function getHtmlHeader() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->html_header; @@ -2323,7 +2323,7 @@ class Context * * @param string $class_name class name */ - function addBodyClass($class_name) + static function addBodyClass($class_name) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->body_class[] = $class_name; @@ -2334,7 +2334,7 @@ class Context * * @return string Return class to html body */ - function getBodyClass() + static function getBodyClass() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->body_class = array_unique($self->body_class); @@ -2347,7 +2347,7 @@ class Context * * @param string $header Add html code after */ - function addBodyHeader($header) + static function addBodyHeader($header) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->body_header .= "\n" . $header; @@ -2358,7 +2358,7 @@ class Context * * @return string Added html code after */ - function getBodyHeader() + static function getBodyHeader() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->body_header; @@ -2369,7 +2369,7 @@ class Context * * @param string $footer Add html code before */ - function addHtmlFooter($footer) + static function addHtmlFooter($footer) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->html_footer .= ($self->Htmlfooter ? "\n" : '') . $footer; @@ -2380,7 +2380,7 @@ class Context * * @return string Added html code before */ - function getHtmlFooter() + static function getHtmlFooter() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->html_footer; @@ -2391,7 +2391,7 @@ class Context * * @retrun string The path of the config file that contains database settings */ - function getConfigFile() + static function getConfigFile() { return _XE_PATH_ . 'files/config/db.config.php'; } @@ -2401,7 +2401,7 @@ class Context * * @return string The path of the config file that contains FTP settings */ - function getFTPConfigFile() + static function getFTPConfigFile() { return _XE_PATH_ . 'files/config/ftp.config.php'; } @@ -2411,7 +2411,7 @@ class Context * * @return bool True if the config file exists, otherwise FALSE. */ - function isInstalled() + static function isInstalled() { return FileHandler::hasContent(self::getConfigFile()); } @@ -2422,7 +2422,7 @@ class Context * @param string Transforms codes * @return string Transforms codes */ - function transContent($content) + static function transContent($content) { return $content; } @@ -2432,7 +2432,7 @@ class Context * * @return bool True if it is allowed to use rewrite mod, otherwise FALSE */ - function isAllowRewrite() + static function isAllowRewrite() { $oContext = self::getInstance(); return $oContext->allow_rewrite; @@ -2444,7 +2444,7 @@ class Context * @param string $path URL path * @return string Converted path */ - function pathToUrl($path) + static function pathToUrl($path) { $xe = _XE_PATH_; $path = strtr($path, "\\", "/"); @@ -2499,7 +2499,7 @@ class Context * Get meta tag * @return array The list of meta tags */ - function getMetaTag() + static function getMetaTag() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -2526,7 +2526,7 @@ class Context * @param mixed $is_http_equiv value of http_equiv * @return void */ - function addMetaTag($name, $content, $is_http_equiv = FALSE) + static function addMetaTag($name, $content, $is_http_equiv = FALSE) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content; From 07188e29376812b9caef4b6f95c1788354e8182d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=83=9C=EC=83=81?= Date: Wed, 11 Feb 2015 17:32:35 +0900 Subject: [PATCH 2/3] =?UTF-8?q?$this=20=EB=B3=80=EC=88=98=EB=A5=BC=20$self?= =?UTF-8?q?=EB=A1=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit is_a($this, 'Context') ? $self = $this : $self = self::getInstance();을 통해 $self 변수를 생성하엿으나, $self를 사용하지 않고 $this가 사용됨. => 이 함수를 Context::함수명 처럼 사용시 오류의 소지가 있음 --- classes/context/Context.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index 135510faa..b9ff01463 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -473,7 +473,7 @@ class Context $db_info->use_db_session = 'N'; if(!$db_info->use_ssl) $db_info->use_ssl = 'none'; - $this->set('_use_ssl', $db_info->use_ssl); + $self->set('_use_ssl', $db_info->use_ssl); if($db_info->http_port) $self->set('_http_port', $db_info->http_port); From 85dac07fa466f8eac4fa3664812d8c0c098921fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A1=B0=ED=83=9C=EC=83=81?= Date: Mon, 16 Feb 2015 12:26:00 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=95=9E=EC=97=90=20p?= =?UTF-8?q?ublic=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 함수 앞에 public을 추가 및 static public으로 되어 있던 부분을 public static으로 변경. 그리고, close 함수도 static으로 변경 --- classes/context/Context.class.php | 184 +++++++++++++++--------------- 1 file changed, 92 insertions(+), 92 deletions(-) diff --git a/classes/context/Context.class.php b/classes/context/Context.class.php index b9ff01463..f18adc9f3 100644 --- a/classes/context/Context.class.php +++ b/classes/context/Context.class.php @@ -159,7 +159,7 @@ class Context * * @return object Instance */ - static function &getInstance() + public static function &getInstance() { static $theInstance = null; if(!$theInstance) @@ -175,7 +175,7 @@ class Context * * @return void */ - function Context() + public function Context() { $this->oFrontEndFileHandler = new FrontEndFileHandler(); $this->get_vars = new stdClass(); @@ -198,7 +198,7 @@ class Context * @see This function should be called only once * @return void */ - function init() + public function init() { // set context variables in $GLOBALS (to use in display handler) $this->context = &$GLOBALS['__Context__']; @@ -400,7 +400,7 @@ class Context * * @return void */ - function close() + public static function close() { session_write_close(); } @@ -410,7 +410,7 @@ class Context * * @return void */ - static function loadDBInfo() + public static function loadDBInfo() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -496,7 +496,7 @@ class Context * * @return string DB's db_type */ - static function getDBType() + public static function getDBType() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->db_info->master_db["db_type"]; @@ -508,7 +508,7 @@ class Context * @param object $db_info DB information * @return void */ - static function setDBInfo($db_info) + public static function setDBInfo($db_info) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->db_info = $db_info; @@ -519,7 +519,7 @@ class Context * * @return object DB information */ - static function getDBInfo() + public static function getDBInfo() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->db_info; @@ -530,7 +530,7 @@ class Context * * @return object SSL status (Optional - none|always|optional) */ - static function getSslStatus() + public static function getSslStatus() { $dbInfo = self::getDBInfo(); return $dbInfo->use_ssl; @@ -541,7 +541,7 @@ class Context * * @return string Default URL */ - static function getDefaultUrl() + public static function getDefaultUrl() { $db_info = self::getDBInfo(); return $db_info->default_url; @@ -552,7 +552,7 @@ class Context * * @return array Supported languages */ - static function loadLangSupported() + public static function loadLangSupported() { static $lang_supported = null; if(!$lang_supported) @@ -573,7 +573,7 @@ class Context * * @return array Selected languages */ - static function loadLangSelected() + public static function loadLangSelected() { static $lang_selected = null; if(!$lang_selected) @@ -611,7 +611,7 @@ class Context * * @return bool True : Module handling is necessary in the control path of current request , False : Otherwise */ - function checkSSO() + public function checkSSO() { // pass if it's not GET request or XE is not yet installed if($this->db_info->use_sso != 'Y' || isCrawler()) @@ -679,7 +679,7 @@ class Context * * @return bool True: FTP information is registered, False: otherwise */ - static function isFTPRegisted() + public static function isFTPRegisted() { return file_exists(self::getFTPConfigFile()); } @@ -689,7 +689,7 @@ class Context * * @return object FTP information */ - static function getFTPInfo() + public static function getFTPInfo() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -709,7 +709,7 @@ class Context * @param string $site_title Browser title to be added * @return void */ - static function addBrowserTitle($site_title) + public static function addBrowserTitle($site_title) { if(!$site_title) { @@ -733,7 +733,7 @@ class Context * @param string $site_title Browser title to be set * @return void */ - static function setBrowserTitle($site_title) + public static function setBrowserTitle($site_title) { if(!$site_title) { @@ -748,7 +748,7 @@ class Context * * @return string Browser title(htmlspecialchars applied) */ - static function getBrowserTitle() + public static function getBrowserTitle() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -762,7 +762,7 @@ class Context * Return layout's title * @return string layout's title */ - static public function getSiteTitle() + public static function getSiteTitle() { $oModuleModel = getModel('module'); $moduleConfig = $oModuleModel->getModuleConfig('module'); @@ -778,7 +778,7 @@ class Context * Get browser title * @deprecated */ - function _getBrowserTitle() + public function _getBrowserTitle() { return $this->getBrowserTitle(); } @@ -789,7 +789,7 @@ class Context * @param string $path Path of the language file * @return void */ - static function loadLang($path) + public static function loadLang($path) { global $lang; @@ -834,7 +834,7 @@ class Context * @param string Path of the language file * @return void */ - function _evalxmlLang($path) + public function _evalxmlLang($path) { global $lang; @@ -868,7 +868,7 @@ class Context * @param string $path Path of the language file * @return string file name */ - function _loadXmlLang($path) + public function _loadXmlLang($path) { if(!$path) return; @@ -882,7 +882,7 @@ class Context * @param string $path Path of the language file * @return string file name */ - function _loadPhpLang($path) + public function _loadPhpLang($path) { if(!$path) return; @@ -912,7 +912,7 @@ class Context * @param string $lang_type Language type. * @return void */ - static function setLangType($lang_type = 'ko') + public static function setLangType($lang_type = 'ko') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -927,7 +927,7 @@ class Context * * @return string Language type */ - static function getLangType() + public static function getLangType() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->lang_type; @@ -939,7 +939,7 @@ class Context * @param string $code Language variable name * @return string If string for the code exists returns it, otherwise returns original code */ - static function getLang($code) + public static function getLang($code) { if(!$code) { @@ -959,7 +959,7 @@ class Context * @param string $val `$code`s value * @return void */ - static function setLang($code, $val) + public static function setLang($code, $val) { if(!isset($GLOBALS['lang'])) { @@ -974,7 +974,7 @@ class Context * @param object $source_obj Conatins strings to convert * @return object converted object */ - static function convertEncoding($source_obj) + public static function convertEncoding($source_obj) { $charset_list = array( 'UTF-8', 'EUC-KR', 'CP949', 'ISO8859-1', 'EUC-JP', 'SHIFT_JIS', 'CP932', @@ -1015,7 +1015,7 @@ class Context * @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5 * @return void */ - static function checkConvertFlag(&$val, $key = null, $charset = null) + public static function checkConvertFlag(&$val, $key = null, $charset = null) { static $flag = TRUE; if($charset) @@ -1042,7 +1042,7 @@ class Context * @see arrayConvWalkCallback will replaced array_walk_recursive in >=PHP5 * @return object converted object */ - static function doConvertEncoding(&$val, $key = null, $charset) + public static function doConvertEncoding(&$val, $key = null, $charset) { if (is_array($val)) { @@ -1057,7 +1057,7 @@ class Context * @param string $str String to convert * @return string converted string */ - static function convertEncodingStr($str) + public static function convertEncodingStr($str) { $obj = new stdClass(); $obj->str = $str; @@ -1071,7 +1071,7 @@ class Context * @param string $method Response method. [HTML|XMLRPC|JSON] * @return void */ - static function setResponseMethod($method = 'HTML') + public static function setResponseMethod($method = 'HTML') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1084,7 +1084,7 @@ class Context * * @return string Response method. If it's not set, returns request method. */ - static function getResponseMethod() + public static function getResponseMethod() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1105,7 +1105,7 @@ class Context * @param string $type Request method. (Optional - GET|POST|XMLRPC|JSON) * @return void */ - static function setRequestMethod($type = '') + public static function setRequestMethod($type = '') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1123,7 +1123,7 @@ class Context * * @return void */ - function _checkGlobalVars() + public function _checkGlobalVars() { $this->_recursiveCheckVar($_SERVER['HTTP_HOST']); } @@ -1133,7 +1133,7 @@ class Context * * @return void */ - function _setRequestArgument() + public function _setRequestArgument() { if(!count($_REQUEST)) { @@ -1175,7 +1175,7 @@ class Context } } - function _recursiveCheckVar($val) + public function _recursiveCheckVar($val) { if(is_string($val)) { @@ -1202,7 +1202,7 @@ class Context * * @return void */ - function _setJSONRequestArgument() + public function _setJSONRequestArgument() { if($this->getRequestMethod() != 'JSON') { @@ -1223,7 +1223,7 @@ class Context * * @return void */ - function _setXmlRpcArgument() + public function _setXmlRpcArgument() { if($this->getRequestMethod() != 'XMLRPC') { @@ -1256,7 +1256,7 @@ class Context * @param string $do_stripslashes Whether to strip slashes * @return mixed filtered value. Type are string or array */ - function _filterRequestVar($key, $val, $do_stripslashes = 1) + public function _filterRequestVar($key, $val, $do_stripslashes = 1) { if(!($isArray = is_array($val))) { @@ -1295,7 +1295,7 @@ class Context * * @return bool True: exists, False: otherwise */ - static function isUploaded() + public static function isUploaded() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->is_uploaded; @@ -1306,7 +1306,7 @@ class Context * * @return void */ - function _setUploadedArgument() + public function _setUploadedArgument() { if($_SERVER['REQUEST_METHOD'] != 'POST' || !$_FILES || stripos($_SERVER['CONTENT_TYPE'], 'multipart/form-data') === FALSE) { @@ -1349,7 +1349,7 @@ class Context * Return request method * @return string Request method type. (Optional - GET|POST|XMLRPC|JSON) */ - static function getRequestMethod() + public static function getRequestMethod() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->request_method; @@ -1359,7 +1359,7 @@ class Context * Return request URL * @return string request URL */ - static function getRequestUrl() + public static function getRequestUrl() { static $url = null; if(is_null($url)) @@ -1381,7 +1381,7 @@ class Context * Return js callback func. * @return string callback func. */ - static function getJSCallbackFunc() + public static function getJSCallbackFunc() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->js_callback_func; @@ -1397,7 +1397,7 @@ class Context * @param bool $autoEncode If TRUE, url encode automatically, detailed. Use this option, $encode value should be TRUE * @return string URL */ - static function getUrl($num_args = 0, $args_list = array(), $domain = null, $encode = TRUE, $autoEncode = FALSE) + public static function getUrl($num_args = 0, $args_list = array(), $domain = null, $encode = TRUE, $autoEncode = FALSE) { static $site_module_info = null; static $current_info = null; @@ -1638,7 +1638,7 @@ class Context * @param string $domain Domain * @retrun string converted URL */ - static function getRequestUri($ssl_mode = FOLLOW_REQUEST_SSL, $domain = null) + public static function getRequestUri($ssl_mode = FOLLOW_REQUEST_SSL, $domain = null) { static $url = array(); @@ -1737,7 +1737,7 @@ class Context * @param mixed $set_to_get_vars If not FALSE, Set to get vars. * @return void */ - static function set($key, $val, $set_to_get_vars = 0) + public static function set($key, $val, $set_to_get_vars = 0) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->context->{$key} = $val; @@ -1762,7 +1762,7 @@ class Context * @param string $key Key * @return string Key */ - static function get($key) + public static function get($key) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1778,7 +1778,7 @@ class Context * * @return object */ - static function gets() + public static function gets() { $num_args = func_num_args(); if($num_args < 1) @@ -1801,7 +1801,7 @@ class Context * * @return object All data */ - static function getAll() + public static function getAll() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->context; @@ -1812,7 +1812,7 @@ class Context * * @return Object Request variables. */ - static function getRequestVars() + public static function getRequestVars() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); if($self->get_vars) @@ -1828,7 +1828,7 @@ class Context * @param string $action act name * @return void */ - static function addSSLAction($action) + public static function addSSLAction($action) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1852,7 +1852,7 @@ class Context * @param string $action act name * @return void */ - static function addSSLActions($action_array) + public static function addSSLActions($action_array) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1880,7 +1880,7 @@ class Context * @param string $action act name * @return void */ - static function subtractSSLAction($action) + public static function subtractSSLAction($action) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1898,7 +1898,7 @@ class Context * * @return string acts in array */ - static function getSSLActions() + public static function getSSLActions() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); if($self->getSslStatus() == 'optional') @@ -1913,7 +1913,7 @@ class Context * @param string $action act name * @return bool If SSL exists, return TRUE. */ - static function isExistsSSLAction($action) + public static function isExistsSSLAction($action) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return isset($self->ssl_actions[$action]); @@ -1926,7 +1926,7 @@ class Context * @param string $file file path * @return string normalized file path */ - static function normalizeFilePath($file) + public static function normalizeFilePath($file) { if($file{0} != '/' && $file{0} != '.' && strpos($file, '://') === FALSE) { @@ -1948,7 +1948,7 @@ class Context * @param string $file file path * @return string Converted file path */ - static function getAbsFileUrl($file) + public static function getAbsFileUrl($file) { $file = self::normalizeFilePath($file); if(strpos($file, './') === 0) @@ -1979,7 +1979,7 @@ class Context * $args[3]: index * */ - static function loadFile($args) + public static function loadFile($args) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -1994,7 +1994,7 @@ class Context * @param string $media Media query * @return void */ - static function unloadFile($file, $targetIe = '', $media = 'all') + public static function unloadFile($file, $targetIe = '', $media = 'all') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadFile($file, $targetIe, $media); @@ -2006,7 +2006,7 @@ class Context * @param string $type Unload target (optional - all|css|js) * @return void */ - static function unloadAllFiles($type = 'all') + public static function unloadAllFiles($type = 'all') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadAllFiles($type); @@ -2025,7 +2025,7 @@ class Context * @param string $autoPath If path not readed, set the path automatically. * @return void */ - static function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null) + public static function addJsFile($file, $optimized = FALSE, $targetie = '', $index = 0, $type = 'head', $isRuleset = FALSE, $autoPath = null) { if($isRuleset) { @@ -2055,7 +2055,7 @@ class Context * @param string $targetie target IE * @return void */ - static function unloadJsFile($file, $optimized = FALSE, $targetie = '') + public static function unloadJsFile($file, $optimized = FALSE, $targetie = '') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadFile($file, $targetie); @@ -2066,7 +2066,7 @@ class Context * * @return void */ - static function unloadAllJsFiles() + public static function unloadAllJsFiles() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadAllFiles('js'); @@ -2079,7 +2079,7 @@ class Context * @param string $filename File name * @return void */ - static function addJsFilter($path, $filename) + public static function addJsFilter($path, $filename) { $oXmlFilter = new XmlJSFilter($path, $filename); $oXmlFilter->compile(); @@ -2092,7 +2092,7 @@ class Context * @param array $files File list * @return array File list */ - static function _getUniqueFileList($files) + public static function _getUniqueFileList($files) { ksort($files); $files = array_values($files); @@ -2115,7 +2115,7 @@ class Context * @param string $type Added position. (head:.., body:..) * @return array Returns javascript file list. Array contains file, targetie. */ - static function getJsFile($type = 'head') + public static function getJsFile($type = 'head') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->oFrontEndFileHandler->getJsFileList($type); @@ -2133,7 +2133,7 @@ class Context * @return void * */ - static function addCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '', $index = 0) + public static function addCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '', $index = 0) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->loadFile(array($file, $media, $targetie, $index)); @@ -2149,7 +2149,7 @@ class Context * @param string $targetie target IE * @return void */ - static function unloadCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '') + public static function unloadCSSFile($file, $optimized = FALSE, $media = 'all', $targetie = '') { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadFile($file, $targetie, $media); @@ -2160,7 +2160,7 @@ class Context * * @return void */ - static function unloadAllCSSFiles() + public static function unloadAllCSSFiles() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->oFrontEndFileHandler->unloadAllFiles('css'); @@ -2171,7 +2171,7 @@ class Context * * @return array Returns css file list. Array contains file, media, targetie. */ - static function getCSSFile() + public static function getCSSFile() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->oFrontEndFileHandler->getCssFileList(); @@ -2182,7 +2182,7 @@ class Context * @param string $pluginName * @return stdClass */ - static function getJavascriptPluginInfo($pluginName) + public static function getJavascriptPluginInfo($pluginName) { if($plugin_name == 'ui.datepicker') { @@ -2237,7 +2237,7 @@ class Context * @param string $plugin_name plugin name * @return void */ - static function loadJavascriptPlugin($plugin_name) + public static function loadJavascriptPlugin($plugin_name) { static $loaded_plugins = array(); @@ -2295,13 +2295,13 @@ class Context * @param string $header add html code before . * @return void */ - static function addHtmlHeader($header) + public static function addHtmlHeader($header) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->html_header .= "\n" . $header; } - static function clearHtmlHeader() + public static function clearHtmlHeader() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->html_header = ''; @@ -2312,7 +2312,7 @@ class Context * * @return string Added html code before */ - static function getHtmlHeader() + public static function getHtmlHeader() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->html_header; @@ -2323,7 +2323,7 @@ class Context * * @param string $class_name class name */ - static function addBodyClass($class_name) + public static function addBodyClass($class_name) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->body_class[] = $class_name; @@ -2334,7 +2334,7 @@ class Context * * @return string Return class to html body */ - static function getBodyClass() + public static function getBodyClass() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->body_class = array_unique($self->body_class); @@ -2347,7 +2347,7 @@ class Context * * @param string $header Add html code after */ - static function addBodyHeader($header) + public static function addBodyHeader($header) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->body_header .= "\n" . $header; @@ -2358,7 +2358,7 @@ class Context * * @return string Added html code after */ - static function getBodyHeader() + public static function getBodyHeader() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->body_header; @@ -2369,7 +2369,7 @@ class Context * * @param string $footer Add html code before */ - static function addHtmlFooter($footer) + public static function addHtmlFooter($footer) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->html_footer .= ($self->Htmlfooter ? "\n" : '') . $footer; @@ -2380,7 +2380,7 @@ class Context * * @return string Added html code before */ - static function getHtmlFooter() + public static function getHtmlFooter() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); return $self->html_footer; @@ -2391,7 +2391,7 @@ class Context * * @retrun string The path of the config file that contains database settings */ - static function getConfigFile() + public static function getConfigFile() { return _XE_PATH_ . 'files/config/db.config.php'; } @@ -2401,7 +2401,7 @@ class Context * * @return string The path of the config file that contains FTP settings */ - static function getFTPConfigFile() + public static function getFTPConfigFile() { return _XE_PATH_ . 'files/config/ftp.config.php'; } @@ -2411,7 +2411,7 @@ class Context * * @return bool True if the config file exists, otherwise FALSE. */ - static function isInstalled() + public static function isInstalled() { return FileHandler::hasContent(self::getConfigFile()); } @@ -2422,7 +2422,7 @@ class Context * @param string Transforms codes * @return string Transforms codes */ - static function transContent($content) + public static function transContent($content) { return $content; } @@ -2432,7 +2432,7 @@ class Context * * @return bool True if it is allowed to use rewrite mod, otherwise FALSE */ - static function isAllowRewrite() + public static function isAllowRewrite() { $oContext = self::getInstance(); return $oContext->allow_rewrite; @@ -2444,7 +2444,7 @@ class Context * @param string $path URL path * @return string Converted path */ - static function pathToUrl($path) + public static function pathToUrl($path) { $xe = _XE_PATH_; $path = strtr($path, "\\", "/"); @@ -2499,7 +2499,7 @@ class Context * Get meta tag * @return array The list of meta tags */ - static function getMetaTag() + public static function getMetaTag() { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); @@ -2526,7 +2526,7 @@ class Context * @param mixed $is_http_equiv value of http_equiv * @return void */ - static function addMetaTag($name, $content, $is_http_equiv = FALSE) + public static function addMetaTag($name, $content, $is_http_equiv = FALSE) { is_a($this, 'Context') ? $self = $this : $self = self::getInstance(); $self->meta_tags[$name . "\t" . ($is_http_equiv ? '1' : '0')] = $content;