本文整理汇总了PHP中eZTemplateCompiler::executeCompilationHelper方法的典型用法代码示例。如果您正苦于以下问题:PHP eZTemplateCompiler::executeCompilationHelper方法的具体用法?PHP eZTemplateCompiler::executeCompilationHelper怎么用?PHP eZTemplateCompiler::executeCompilationHelper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZTemplateCompiler
的用法示例。
在下文中一共展示了eZTemplateCompiler::executeCompilationHelper方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeCompilation
static function executeCompilation($tpl, &$textElements, $key, &$resourceData, $rootNamespace, $currentNamespace)
{
if (!eZTemplateCompiler::isCompilationEnabled()) {
return false;
}
if (!eZTemplateCompiler::isExecutionEnabled()) {
return false;
}
$cacheFileName = eZTemplateCompiler::compilationFilename($key, $resourceData);
$resourceData['use-comments'] = eZTemplateCompiler::isCommentsEnabled();
$directory = eZTemplateCompiler::compilationDirectory();
$phpScript = eZDir::path(array($directory, $cacheFileName));
if (file_exists($phpScript)) {
$text = false;
$helperStatus = eZTemplateCompiler::executeCompilationHelper($phpScript, $text, $tpl, $key, $resourceData, $rootNamespace, $currentNamespace);
if ($helperStatus) {
$textElements[] = $text;
return true;
} else {
eZDebug::writeError("Failed executing compiled template '{$phpScript}'", 'eZTemplateCompiler::executeCompilation');
}
} else {
eZDebug::writeError("Unknown compiled template '{$phpScript}'", 'eZTemplateCompiler::executeCompilation');
}
return false;
}
示例2: executeCompilation
/**
* Tries to execute the compiled template. Returns true if successful,
* returns false if the compilation is disabled or the compiled template
* does not exist.
*
* @param eZTemplate $tpl
* @param array $textElements
* @param string $key
* @param array $resourceData
* @param $rootNamespace
* @param $currentNamespace
*
* @throws eZTemplateFailedExecutingCompiledTemplate if the compiled
* template could not be executed
* @return bool
*/
static function executeCompilation($tpl, &$textElements, $key, &$resourceData, $rootNamespace, $currentNamespace)
{
if (!eZTemplateCompiler::isCompilationEnabled()) {
return false;
}
if (!eZTemplateCompiler::isExecutionEnabled()) {
return false;
}
$cacheFileName = eZTemplateCompiler::compilationFilename($key, $resourceData);
$resourceData['use-comments'] = eZTemplateCompiler::isCommentsEnabled();
$directory = eZTemplateCompiler::compilationDirectory();
$phpScript = eZDir::path(array($directory, $cacheFileName));
if (file_exists($phpScript)) {
$text = false;
$helperStatus = eZTemplateCompiler::executeCompilationHelper($phpScript, $text, $tpl, $key, $resourceData, $rootNamespace, $currentNamespace);
if ($helperStatus) {
$textElements[] = $text;
return true;
} else {
eZDebug::writeError("Failed executing compiled template '{$phpScript}'," . " if this file is valid, then the error is probably" . " related to APC usage, try restarting the webserver", __METHOD__);
throw new eZTemplateFailedExecutingCompiledTemplate("Failed executing a compiled template, see error.log for details");
}
} else {
eZDebug::writeError("Unknown compiled template '{$phpScript}'", __METHOD__);
}
return false;
}