From aea9de4d8811d72fa9c411e4ba894487ee33bb03 Mon Sep 17 00:00:00 2001 From: zero Date: Mon, 27 Sep 2010 12:54:00 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9E=98=EB=AA=BB=EB=90=9C=20=ED=85=9C?= =?UTF-8?q?=ED=94=8C=EB=A6=BF=20=EB=AC=B8=EB=B2=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7701 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/template/TemplateParser.tag.php | 71 ------------------------- 1 file changed, 71 deletions(-) diff --git a/classes/template/TemplateParser.tag.php b/classes/template/TemplateParser.tag.php index d474c2095..233fa96f2 100644 --- a/classes/template/TemplateParser.tag.php +++ b/classes/template/TemplateParser.tag.php @@ -34,9 +34,6 @@ // include 태그의 변환 $buff = preg_replace_callback('!]+)>!is', array($this, '_replaceInclude'), $buff); - // PHP 변수형의 변환 ($문자등을 공유 context로 변환) - $buff = $this->_replaceVarInPHP($buff); - $buff = preg_replace_callback('/\{[^@^ ]([^\{\}\n]+)\}/i', array($this, '_replaceVar'), $buff); // unload/ load 태그의 변환 $buff = preg_replace_callback('!<(unload|load) ([^>]+)>!is', array($this, '_replaceLoad'), $buff); @@ -211,74 +208,6 @@ return $buff; } - /** - * @brief $문자 의 PHP 변수 변환 - **/ - function _replaceVarInPHP($buff) { - $head = $tail = ''; - while(false !== $pos = strpos($buff, ''); - $body = substr($buff,0,$pos+2); - $head .= preg_replace_callback('/(.?)\$([a-z0-9\_\-\[\]\'\"]+)/is',array($this, '_replaceVarString'), $body); - - $buff = substr($buff,$pos+2); - } - return $head.$buff; - } - - - /** - * @brief $문자 의 PHP 변수 변환 후 어긋나는 변수 정리 - **/ - function _replaceVar($matches) { - $str = trim(substr($matches[0],1,-1)); - if(!$str) return $matches[0]; - if(!in_array(substr($str,0,1),array('(','$','\'','"'))) - { - if(preg_match('/^([^\( \.]+)(\(| \.)/i',$str,$m)) - { - $func = trim($m[1]); - if(strpos($func,'::')===false) { - if(!function_exists($func)) - { - return $matches[0]; - } - } - else - { - list($class, $method) = explode('::',$func); - if(!class_exists($class) || !in_array($method, get_class_methods($class))) - { - list($class, $method) = explode('::',strtolower($func)); - if(!class_exists($class) || !in_array($method, get_class_methods($class))) - { - return $matches[0]; - } - } - } - } - else - { - if(!defined($str)) return $matches[0]; - } - } - $str = preg_replace_callback('/(.?)\$([a-z0-9\_\-\[\]\'\"]+)/is',array($this, '_replaceVarString'), $str); - return ''; - } - - /** - * @brief 변수명 변경 - **/ - function _replaceVarString($matches) - { - if($matches[1]==':') return $matches[0]; - if(substr($matches[2],0,1)=='_') return $matches[0]; - return $matches[1].'$__Context->'.$matches[2]; - } - /** * @brief 다른 template파일을 include하는 include tag의 변환 **/