찾다
php教程php手册class.rFastTemplate.php二

// // Description // Recursive internal parse routine. This will recursively parse a // template containing dynamic inferior templates. Each of these // inferior templates gets their own entry in the TEMPLATE array. // function &parse_internal_1 ($tag, $rest = ) { $debug = $this->DEBUGALL || $this->DEBUG[parse_internal_1]; if (empty($tag)) { $this->error ("parse_internal_1: empty tag invalid", true); } if ($debug) $this->logwrite ("parse_internal_1 (tag=$tag, rest=$rest)"); while (!empty($rest)) { if ($debug) $this->logwrite (parse_internal_1: REGEX_DYNBEG search: rest => . $rest); if (preg_match ($this->REGEX_DYNBEG, $rest, $dynbeg)) { // Found match, now split into two pieces and search the second // half for the matching END. The string which goes into the // next element includes the HTML comment which forms the BEGIN // block. if ($debug) $this->logwrite (parse_internal_1: match beg => . $dynbeg[1]); $pos = strpos ($rest, $dynbeg[1]); // See if the text on either side of the BEGIN comment is only // whitespace. If so, we delete the entire line. $okay = false; for ($offbeg = $pos - 1; $offbeg >= 0; $offbeg--) { $c = $rest{$offbeg}; if ($c == " ") { $okay = true; $offbeg++; break; } if (($c != ) && ($c != " ")) { $offbeg = $pos; break; } } if (! $okay) { $offend = $pos + strlen($dynbeg[1]); } else { $l = strlen ($rest); for ($offend = $pos + strlen($dynbeg[1]); $offend 0) $part[] = substr ($rest, 0, $offbeg); $rest = substr ($rest, $offend); $sub = ; if ($debug) $this->logwrite ("parse_internal_1: found at pos = $pos"); // Okay, here we are actually NOT interested in just the next // END block. We are only interested in the next END block that // matches this BEGIN block. This is not the most efficient // because we really could do this in one pass through the // string just marking BEGIN and END blocks. But the recursion // makes for a simple algorithm (if there was a reverse // preg...). $found = false; while (preg_match ($this->REGEX_DYNEND, $rest, $dynend)) { if ($debug) $this->logwrite (parse_internal_1: REGEX_DYNEND search: rest => . $rest); if ($debug) $this->logwrite (parse_internal_1: match beg => . $dynend[1]); $pos = strpos ($rest, $dynend[1]); if ($dynbeg[2] == $dynend[2]) { $found = true; // See if the text on either side of the END comment is // only whitespace. If so, we delete the entire line. $okay = false; for ($offbeg = $pos - 1; $offbeg >= 0; $offbeg--) { $c = $rest{$offbeg}; if ($c == " ") { $offbeg++; $okay = true; break; } if (($c != ) && ($c != " ")) { $offbeg = $pos; break; } } if (! $okay) { $offend = $pos + strlen($dynend[1]); } else { $l = strlen ($rest); for ($offend = $pos + strlen($dynend[1]); $offend logwrite ("parse_internal_1: DYNAMIC BEGIN: (pos,len,beg,end) => ($pos, " . strlen($dynbeg[1]) . ", $offbeg, $offend) // This includes the contents of the REGEX_DYNEND in the output // $rest = substr ($rest, $pos); // This preserves whitespace on the END block line(s). // $rest = substr ($rest, $pos+strlen($dynend[1])); // $sub .= substr ($rest, 0, $pos); $sub .= substr ($rest, 0, $offbeg); $rest = substr ($rest, $offend); // Already loaded templates will not be reloaded. The // clear test was actually hiding a bug in the clear() // logic.... if (false && isset($this->TEMPLATE[$dynend[2]][clear]) && $this->TEMPLATE[$dynend[2]][clear]) { $this->TEMPLATE[$dynend[2]][string] = ; $this->TEMPLATE[$dynend[2]][result] = ; $this->TEMPLATE[$dynend[2]][part] = $this->parse_internal_1 ($dynend[2], ); } else if (!isset($this->TEMPLATE[$dynend[2]][loaded]) || !$this->TEMPLATE[$dynend[2]][loaded]) { // Omit pathological case of empty dynamic template. if (strlen($sub) > 0) { $this->TEMPLATE[$dynend[2]][string] = $sub; $this->TEMPLATE[$dynend[2]][part] = $this->parse_internal_1 ($dynend[2], $sub); $this->TEMPLATE[$dynend[2]][part][parent] = $tag; } } $this->TEMPLATE[$dynend[2]][loaded] = true; $part[] = &$this->TEMPLATE[$dynend[2]]; $this->TEMPLATE[$dynend[2]][tag] = $dynend[2]; break; } else { $sub .= substr ($rest, 0, $pos+strlen($dynend[1])); $rest = substr ($rest, $pos+strlen($dynend[1])); if ($debug) $this->logwrite ("parse_internal_1: $dynbeg[2] != $dynend[2]"); } } if (!$found) { $this->error ("malformed dynamic template, missing END
" . "$dynbeg[1]
", true); } } else { // Although it would appear to make sense to check that we dont // have a dangling END block, we will, in fact, ALWAYS appear to // have a dangling END block. We stuff the BEGIN string in the // part before the inferior template and the END string in the // part after the inferior template. So for this test to work, // we would need to look just past the final match. if (preg_match ($this->REGEX_DYNEND, $rest, $dynend)) { // $this->error ("malformed dynamic template, dangling END
" . // "$dynend[1]
", 1); } $part[] = $rest; $rest = ; } } return $part; } // // Description // Parse the template. If $tag is actually an array, we iterate over // the array elements. If it is a simple string tag, we may still // recursively parse the template if it contains dynamic templates and // we are configured to automatically load those as well. // function parse_internal ($tag) { $debug = $this->DEBUGALL || $this->DEBUG[parse_internal]; $append = false; if ($debug) $this->logwrite ("parse_internal (tag=$tag)"); // If we are handed an array of tags, iterate over all of them. This // is really a holdover from the way class.FastTemplate.php3 worked; // I think subst() already pulls that array apart for us, so this // should not be necessary unless someone calls the internal member // function directly. if (gettype($tag) == array) { reset ($tag); foreach ($tag as $t) { $this->parse_internal ($t); } } else { // Load the file if it hasnt already been loaded. It might be // nice to put in some logic that reloads the file if it has // changed since we last loaded it, but that probably gets way too // complicated and only makes sense if we start keeping it floating // around between page loads as a persistent variable. if (!isset($this->TEMPLATE[$tag][loaded])) { if ($this->TEMPLATE[$tag][dynamic]) { // Template was declared via define_dynamic(). if ($this->TEMPLATE[$tag][parent]) $tag = $this->TEMPLATE[$tag][parent]; else { // Try to find a non-dynamic template with the same file. // This would have been defined via define(array(), true) reset ($this->TEMPLATE); foreach (array_keys($this->TEMPLATE) as $ptag) { if ($debug) $this->logwrite ("parse_internal: looking for non-dynamic parent, $ptag"); if (!$this->TEMPLATE[$ptag][dynamic] && ($this->TEMPLATE[$ptag][file] == $this->TEMPLATE[$tag][file])) { $tag = $ptag; break; } } } } $this->TEMPLATE[$tag][string] = &$this->load($this->TEMPLATE[$tag][file]); $this->TEMPLATE[$tag][loaded] = 1; } // If we are supposed to automatically detect dynamic templates and the dynamic // flag is not set, scan the template for dynamic sections. Dynamic sections // markers have a very rigid syntax as HTML comments.... if ($this->DYNAMIC) { $this->TEMPLATE[$tag][tag] = $

성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

AI Hentai Generator

AI Hentai Generator

AI Hentai를 무료로 생성하십시오.

인기 기사

R.E.P.O. 에너지 결정과 그들이하는 일 (노란색 크리스탈)
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 최고의 그래픽 설정
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. 아무도들을 수없는 경우 오디오를 수정하는 방법
3 몇 주 전By尊渡假赌尊渡假赌尊渡假赌
WWE 2K25 : Myrise에서 모든 것을 잠금 해제하는 방법
4 몇 주 전By尊渡假赌尊渡假赌尊渡假赌

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SecList

SecList

SecLists는 최고의 보안 테스터의 동반자입니다. 보안 평가 시 자주 사용되는 다양한 유형의 목록을 한 곳에 모아 놓은 것입니다. SecLists는 보안 테스터에게 필요할 수 있는 모든 목록을 편리하게 제공하여 보안 테스트를 더욱 효율적이고 생산적으로 만드는 데 도움이 됩니다. 목록 유형에는 사용자 이름, 비밀번호, URL, 퍼징 페이로드, 민감한 데이터 패턴, 웹 셸 등이 포함됩니다. 테스터는 이 저장소를 새로운 테스트 시스템으로 간단히 가져올 수 있으며 필요한 모든 유형의 목록에 액세스할 수 있습니다.

DVWA

DVWA

DVWA(Damn Vulnerable Web App)는 매우 취약한 PHP/MySQL 웹 애플리케이션입니다. 주요 목표는 보안 전문가가 법적 환경에서 자신의 기술과 도구를 테스트하고, 웹 개발자가 웹 응용 프로그램 보안 프로세스를 더 잘 이해할 수 있도록 돕고, 교사/학생이 교실 환경 웹 응용 프로그램에서 가르치고 배울 수 있도록 돕는 것입니다. 보안. DVWA의 목표는 다양한 난이도의 간단하고 간단한 인터페이스를 통해 가장 일반적인 웹 취약점 중 일부를 연습하는 것입니다. 이 소프트웨어는

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

WebStorm Mac 버전

WebStorm Mac 버전

유용한 JavaScript 개발 도구