本文整理汇总了PHP中eZTemplateCompiler::fetchTemplatePiece方法的典型用法代码示例。如果您正苦于以下问题:PHP eZTemplateCompiler::fetchTemplatePiece方法的具体用法?PHP eZTemplateCompiler::fetchTemplatePiece怎么用?PHP eZTemplateCompiler::fetchTemplatePiece使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZTemplateCompiler
的用法示例。
在下文中一共展示了eZTemplateCompiler::fetchTemplatePiece方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generatePHPCodeChildren
//.........这里部分代码省略.........
* limit is unlimited (0) we leave it be */
$maxExecutionTime = ini_get('max_execution_time');
if ($maxExecutionTime != 0 && $maxExecutionTime < 60) {
@set_time_limit(60);
}
if ($generateStatus) {
$tmpResourceData['compiled-template'] = true;
}
}
}
$GLOBALS['eZTemplateCompilerResourceCache'][$tmpResourceData['template-filename']] =& $tmpResourceData;
}
}
setlocale(LC_CTYPE, $savedLocale);
$textName = eZTemplateCompiler::currentTextName($parameters);
if ($tmpResourceData['compiled-template']) {
$hasCompiledCode = true;
// if ( !eZTemplateCompiler::isFallbackResourceCodeEnabled() )
// $useFallbackCode = false;
$keyData = $tmpResourceData['key-data'];
$templatePath = $tmpResourceData['template-name'];
$key = $resourceObject->cacheKey($keyData, $tmpResourceData, $templatePath, $node[5]);
$cacheFileName = eZTemplateCompiler::compilationFilename($key, $tmpResourceData);
$directory = eZTemplateCompiler::compilationDirectory();
$phpScript = eZDir::path(array($directory, $cacheFileName));
$phpScriptText = $php->thisVariableText($phpScript, 0, 0, false);
$resourceMap[$uriKey] = array('key' => $uriKey, 'uri' => $uri, 'phpscript' => $phpScript);
}
}
}
if ($useComments) {
$variablePlacement = $node[6];
if ($variablePlacement) {
$originalText = eZTemplateCompiler::fetchTemplatePiece($variablePlacement);
$php->addComment("Resource Acquisition:", true, true, array('spacing' => $spacing));
$php->addComment($originalText, true, true, array('spacing' => $spacing));
}
}
if ($hasCompiledCode) {
if ($resourceVariableName) {
$phpScriptText = '$phpScript';
$phpScriptArray = array();
foreach ($resourceMap as $resourceMapItem) {
$phpScriptArray[$resourceMapItem['key']] = $resourceMapItem['phpscript'];
}
if (!$resourceFilename) {
$php->addVariable("phpScriptArray", $phpScriptArray, eZPHPCreator::VARIABLE_ASSIGNMENT, array('spacing' => $spacing));
$resourceVariableNameText = "\${$resourceVariableName}";
$php->addCodePiece("\$phpScript = isset( \$phpScriptArray[{$resourceVariableNameText}] ) ? \$phpScriptArray[{$resourceVariableNameText}] : false;\n", array('spacing' => $spacing));
} else {
$php->addVariable("phpScript", $phpScriptArray[$node[10]], eZPHPCreator::VARIABLE_ASSIGNMENT, array('spacing' => $spacing));
}
// The default is to only check if it exists
$modificationCheckText = "file_exists( {$phpScriptText} )";
if (eZTemplateCompiler::isDevelopmentModeEnabled()) {
$modificationCheckText = "@filemtime( {$phpScriptText} ) > filemtime( {$uriText} )";
}
$php->addCodePiece("\$resourceFound = false;\nif " . ($resourceData['use-comments'] ? "/*TC:" . __LINE__ . "*/" : "") . "( {$phpScriptText} !== false and {$modificationCheckText} )\n{\n", array('spacing' => $spacing));
} else {
$php->addCodePiece("\$resourceFound = false;\n", array('spacing' => $spacing));
$phpScript = $resourceMap[0]['phpscript'];
$phpScriptText = $php->thisVariableText($phpScript, 0, 0, false);
// Not sure where this should come from
// if ( $resourceIndex > 0 )
// $php->addCodePiece( "else " );
// The default is to only check if it exists