コード例 #1
0
/**
* Compiles all source templates below the source scheme directory
* including subdirectories
* 
* @param string $ root directory name
* @param string $ path relative to root
* @return void 
* @access protected 
*/
function recursive_compile_all($root, $path)
{
	if ($dh = opendir($root . $path))
	{
		while (($file = readdir($dh)) !== false)
		{
			if (substr($file, 0, 1) == '.')
			{
				continue;
			} 
			if (is_dir($root . $path . $file))
			{
				recursive_compile_all($root, $path . $file . '/');
				continue;
			} 
			if (substr($file, -5, 5) == '.html')
			{
				compile_template_file($path . $file);
			} 
			else if (substr($file, -5, 5) == '.vars')
			{
				compile_var_file($path . $file);
			} 
		} 
		closedir($dh);
	} 
} 
コード例 #2
0
/**
* Compiles all templates in the scheme
* 
* @return void 
* @access protected 
*/
function compile_entire_file_scheme()
{
    // Need to add support for accumulating error messages.
    $root = get_ini_option('config.ini', 'filescheme', 'templateroot');
    if (isset($root)) {
        $source_root = $root . '/source';
    } else {
        $source_root = dirname($_SERVER['SCRIPT_FILENAME']) . '/templates/source';
    }
    recursive_compile_all($source_root, '/');
}