function Smarty_Compiler::_push_cacheable_state in Quiz 6.6
Same name and namespace in other branches
- 6.5 includes/moodle/lib/smarty/Smarty_Compiler.class.php \Smarty_Compiler::_push_cacheable_state()
check if the compilation changes from cacheable to non-cacheable state with the beginning of the current plugin. return php-code to reflect the transition.
Return value
string
3 calls to Smarty_Compiler::_push_cacheable_state()
- Smarty_Compiler::_compile_block_tag in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - compile block function tag
- Smarty_Compiler::_compile_compiler_tag in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - compile the custom compiler tag
- Smarty_Compiler::_compile_custom_tag in includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php - compile custom function tag
File
- includes/
moodle/ lib/ smarty/ Smarty_Compiler.class.php, line 2204
Class
- Smarty_Compiler
- Template compiling class @package Smarty
Code
function _push_cacheable_state($type, $name) {
$_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
if ($_cacheable || 0 < $this->_cacheable_state++) {
return '';
}
if (!isset($this->_cache_serial)) {
$this->_cache_serial = md5(uniqid('Smarty'));
}
$_ret = 'if ($this->caching && !$this->_cache_including) { echo \'{nocache:' . $this->_cache_serial . '#' . $this->_nocache_count . '}\';}';
return $_ret;
}