You are here

function Smarty::_compile_source in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/lib/smarty/Smarty.class.php \Smarty::_compile_source()

compile the given source

Parameters

string $resource_name:

string $source_content:

string $compiled_content:

Return value

boolean

1 call to Smarty::_compile_source()
Smarty::_compile_resource in includes/moodle/lib/smarty/Smarty.class.php
compile the template

File

includes/moodle/lib/smarty/Smarty.class.php, line 1442

Class

Smarty
@package Smarty

Code

function _compile_source($resource_name, &$source_content, &$compiled_content, $cache_include_path = null) {
  if (file_exists(SMARTY_DIR . $this->compiler_file)) {
    require_once SMARTY_DIR . $this->compiler_file;
  }
  else {

    // use include_path
    require_once $this->compiler_file;
  }
  $smarty_compiler = new $this->compiler_class();
  $smarty_compiler->template_dir = $this->template_dir;
  $smarty_compiler->compile_dir = $this->compile_dir;
  $smarty_compiler->plugins_dir = $this->plugins_dir;
  $smarty_compiler->config_dir = $this->config_dir;
  $smarty_compiler->force_compile = $this->force_compile;
  $smarty_compiler->caching = $this->caching;
  $smarty_compiler->php_handling = $this->php_handling;
  $smarty_compiler->left_delimiter = $this->left_delimiter;
  $smarty_compiler->right_delimiter = $this->right_delimiter;
  $smarty_compiler->_version = $this->_version;
  $smarty_compiler->security = $this->security;
  $smarty_compiler->secure_dir = $this->secure_dir;
  $smarty_compiler->security_settings = $this->security_settings;
  $smarty_compiler->trusted_dir = $this->trusted_dir;
  $smarty_compiler->use_sub_dirs = $this->use_sub_dirs;
  $smarty_compiler->_reg_objects =& $this->_reg_objects;
  $smarty_compiler->_plugins =& $this->_plugins;
  $smarty_compiler->_tpl_vars =& $this->_tpl_vars;
  $smarty_compiler->default_modifiers = $this->default_modifiers;
  $smarty_compiler->compile_id = $this->_compile_id;
  $smarty_compiler->_config = $this->_config;
  $smarty_compiler->request_use_auto_globals = $this->request_use_auto_globals;
  if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) {
    $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path];
  }
  $smarty_compiler->_cache_include = $cache_include_path;
  $_results = $smarty_compiler
    ->_compile_file($resource_name, $source_content, $compiled_content);
  if ($smarty_compiler->_cache_serial) {
    $this->_cache_include_info = array(
      'cache_serial' => $smarty_compiler->_cache_serial,
      'plugins_code' => $smarty_compiler->_plugins_code,
      'include_file_path' => $cache_include_path,
    );
  }
  else {
    $this->_cache_include_info = null;
  }
  return $_results;
}