returns the compiled template file name

@param Dwoo $dwoo the dwoo instance that requests it
@param Dwoo_ICompiler $compiler the compiler that must be used
@return string
183628
public function getCompiledTemplate(Dwoo $dwoo, Dwoo_ICompiler $compiler = null)
	{
		$compiledFile = $this->getCompiledFilename($dwoo);

		if ($this->compilationEnforced !== true && isset(self::$cache['compiled'][$this->compileId]) === true) {
			// already checked, return compiled file
		} elseif ($this->compilationEnforced !== true && $this->isValidCompiledFile($compiledFile)) {
			// template is compiled
			self::$cache['compiled'][$this->compileId] = true;
		} else {
			// compiles the template
			$this->compilationEnforced = false;

			if ($compiler === null) {
				$compiler = $dwoo->getDefaultCompilerFactory($this->getResourceName());

				if ($compiler === null || $compiler === array('Dwoo_Compiler', 'compilerFactory')) {
					if (class_exists('Dwoo_Compiler', false) === false) {
						include DWOO_DIRECTORY . 'Dwoo/Compiler.php';
					}
					$compiler = Dwoo_Compiler::compilerFactory();
				} else {
					$compiler = call_user_func($compiler);
				}
			}

			$this->compiler = $compiler;

			$compiler->setCustomPlugins($dwoo->getCustomPlugins());
			$compiler->setSecurityPolicy($dwoo->getSecurityPolicy());
			$this->makeDirectory(dirname($compiledFile), $dwoo->getCompileDir());
			file_put_contents($compiledFile, $compiler->compile($dwoo, $this));
			if ($this->chmod !== null) {
				chmod($compiledFile, $this->chmod);
			}

			self::$cache['compiled'][$this->compileId] = true;
		}

		return $compiledFile;
	}
923340
protected function getTemplateUid(Smarty $smarty, $resource_name, $cache_id, $compile_id)
    {
        $uid = '';
        if (isset($resource_name)) {
            $tpl = new $smarty->template_class($resource_name, $smarty);
            if ($tpl->source->exists) {
                $uid = $tpl->source->uid;
            }

            // remove from template cache
            if ($smarty->allow_ambiguous_resources) {
                $_templateId = $tpl->source->unique_resource . $tpl->cache_id . $tpl->compile_id;
            } else {
                $_templateId = $smarty->joined_template_dir . '#' . $resource_name . $tpl->cache_id . $tpl->compile_id;
            }
            if (isset($_templateId[150])) {
                $_templateId = sha1($_templateId);
            }
            unset($smarty->template_objects[$_templateId]);
        }

        return $uid;
    }
1260235
protected function getTemplateName($fileName)
    {
        $pathFn = function ($dir) use ($fileName) {
            return static::$widgetTemplateDir . '/' . $dir . '/' . $fileName;
        };

        $pathToCheckFn = function ($path) {
            return APP_DIR . '/templates/' . $path . '.mustache';
        };

        $path = $pathFn($this->className);
        $pathToCheck = $pathToCheckFn($path);

        // If doesn't exists just take it by default from current APP
        if (!file_exists($pathToCheck)) {

            $path = $pathFn(static::$widgetTemplateDirDefault);
            $pathToCheck = $pathToCheckFn($path);

            // If doesn't exists take it by default from Knob-base
            if (!file_exists($pathToCheck)) {
                $path = '../../vendor/chemaclass/knob-base/src/templates/' . $path;
            }
        }

        return $path;
    }
1119496
protected function getCacheFilename(Dwoo $dwoo)
	{
		// no cache id provided, use request_uri as default
		if ($this->cacheId === null) {
			if (isset($_SERVER['REQUEST_URI']) === true) {
				$cacheId = $_SERVER['REQUEST_URI'];
			} elseif (isset($_SERVER['SCRIPT_FILENAME']) && isset($_SERVER['argv'])) {
				$cacheId = $_SERVER['SCRIPT_FILENAME'].'-'.implode('-', $_SERVER['argv']);
			} else {
				$cacheId = '';
			}
			// force compiled id generation
			$this->getCompiledFilename($dwoo);

			$this->cacheId = str_replace('../', '__', $this->compileId . strtr($cacheId, '\\%?=!:;'.PATH_SEPARATOR, '/-------'));
		}
		return $dwoo->getCacheDir() . $this->cacheId.'.html';
	}
602531
public function getTemplateCompileId()
    {
        $shopId = \OxidEsales\Eshop\Core\Registry::getConfig()->getShopId();
        $templateDirectories = $this->getTemplateDirs();

        return md5(reset($templateDirectories) . '__' . $shopId);
    }
930596
public function compilerFactory()
	{
		if (class_exists('Dwoo_Compiler', false) === false) {
			include DWOO_DIRECTORY . 'Dwoo/Compiler.php';
		}
		$compiler = Dwoo_Compiler::compilerFactory();
		$compiler->setAutoEscape((bool) $this->getParameter('auto_escape', false));
		return $compiler;
	}
769277
private function _compileTemplate($templateCode, $compilationFile)
    {
        //start bufora
        ob_start();
        //wymuszona kompilacja
        if ($this->_alwaysCompile) {
            file_put_contents($compilationFile, $this->template($templateCode));
        }
        //próba włączenia skompilowanego pliku
        try {
            //włączenie kompilanta do kodu
            include $compilationFile;
        } catch (\Exception $e) {
            //kompilacja i zapis i włączenie kompilanta do kodu
            file_put_contents($compilationFile, $this->template($templateCode));
            include $compilationFile;
        }
        //przechwycenie danych z bufora
        return ob_get_clean();
    }
219128
public function getFilename($extension = '.php')
    {
        // If template is named,
        // return joined template names.
        if ($this->isNamed()) {
            return join('-', $this->file) . $extension;
        }

        // Use first template name, if template
        // file is an array, but is not named.
        if (is_array($this->file) && isset($this->file[0])) {
            return "{$this->file[0]}{$extension}";
        }

        return apply_filters('tonik/gin/template/filename', "{$this->file}{$extension}");
    }
354883
public static function getPackageName($source)
    {
        $ignore_yaml_files = ['blueprints', 'languages'];

        foreach (glob($source . '*.yaml') as $filename) {
            $name = strtolower(basename($filename, '.yaml'));
            if (in_array($name, $ignore_yaml_files)) {
                continue;
            }
            return $name;
        }
        return false;
    }
1333489
protected function getTemplate($template, $name)
    {
        $this->template = $this->file->get($template);

        if ($this->needsScaffolding($template))
        {
            return $this->getScaffoldedTemplate($name);
        }

        // Otherwise, just set the file
        // contents to the file name
        return $name . PHP_EOL;
    }
798709
private function compileMasterBlock(\Twig_Compiler $compiler)
    {
        $name = $this->getAttribute('name');

        $compiler
            ->addDebugInfo($this)
            // create block
            ->write('list($')->raw($name)->raw(', $')->raw($name)->raw('Children) = $this->block_')->raw($name)->raw('($context, $blocks);')
            // inject children in parents
            ->write('foreach ($')->raw($name)->raw('Children as $index => $cConfig) {')->raw("\n")
            ->indent()
            ->write('$cConfig[\'parent\']->add($cConfig[\'child\']);')->raw("\n")
            ->outdent()
            ->write('}')->raw("\n")
            ->write('$')->raw($name)->raw(' = $')->raw($name)->raw(' ')
            ->raw('instanceof \Fxp\Component\Block\BlockView ? $')->raw($name)->raw(' : $')->raw($name)->raw('->createView();')->raw("\n")
            // render
            ->write('echo $this->env->getExtension(\'Fxp\Component\Block\Twig\Extension\BlockExtension\')->renderer->searchAndRenderBlock(')->raw("\n")
            ->indent()
            ->write('$')->raw($name)
            // renderer prefix
            ->raw(',')->raw("\n")
            ->write('"widget"')
            ->raw(', ')->raw("\n")
            // variables
            ->write('')
            ->subcompile($this->getAttribute('variables'))->raw(')')->raw("\n")
            ->outdent()->write(';')->raw("\n")
        ;
    }
1046375
public function compile(\Twig_Compiler $compiler)
    {
        $compiler->addDebugInfo($this);

        $compiler
            ->raw('ob_start();' . PHP_EOL)
            ->subcompile($this->getNode('source'))
            ->raw('$source = ob_get_contents();' . PHP_EOL)
            ->raw('ob_clean();' . PHP_EOL)
            ->raw('echo $this->env->getExtension(\'highlight_extension\')->highlight(' . PHP_EOL)
            ->raw('   $source,' . PHP_EOL)
            ->raw('   \'' . $this->getNode('lexer')->getAttribute('name') . '\' ' . PHP_EOL)
            ->raw(');' . PHP_EOL);
    }
1157207
public function display($sTemplate, $return = FALSE) {
        // Start benchmark
        $CI = get_instance();
        $CI->benchmark->mark('dwoo_parse_start');

        // Check if file exists
        if ( !file_exists($this->template_dir . $sTemplate ) ) {
            $message = sprintf('Template file \'%s\' not found.', $sTemplate);
            show_error($message);
            log_message('error', $message);
        }

        // Create new template
        $tpl = new Dwoo_Template_File($this->template_dir . $sTemplate);

        // render the template
        $template = $this->get($tpl, $this->dwoo_data);

        // Finish benchmark
        $CI->benchmark->mark('dwoo_parse_end');

        // Return results or not ?
        if ($return == FALSE) {
            $CI->output->final_output = $template;
        } else {
            return $template;
        }
    }
25146
public function populateCompiledFilepath(Smarty_Template_Compiled $compiled, Smarty_Internal_Template $_template)
    {
        $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w\|]+!', '_', $_template->compile_id) : null;
        $_filepath = $compiled->source->uid;
        // if use_sub_dirs, break file into directories
        if ($_template->smarty->use_sub_dirs) {
            $_filepath = substr($_filepath, 0, 2) . DS
             . substr($_filepath, 2, 2) . DS
             . substr($_filepath, 4, 2) . DS
             . $_filepath;
        }
        $_compile_dir_sep = $_template->smarty->use_sub_dirs ? DS : '^';
        if (isset($_compile_id)) {
            $_filepath = $_compile_id . $_compile_dir_sep . $_filepath;
        }
        // caching token
        if ($_template->caching) {
            $_cache = '.cache';
        } else {
            $_cache = '';
        }
        $_compile_dir = $_template->smarty->getCompileDir();
        // set basename if not specified
        $_basename = $this->getBasename($compiled->source);
        if ($_basename === null) {
            $_basename = basename( preg_replace('![^\w\/]+!', '_', $compiled->source->name) );
        }
        // separate (optional) basename by dot
        if ($_basename) {
            $_basename = '.' . $_basename;
        }

        $compiled->filepath = $_compile_dir . $_filepath . '.' . $compiled->source->type . $_basename . $_cache . '.php';
    }
683386
public static function compile(Compiler $compiler, $file)
    {
        $file = substr($file, 1, - 1);

        if ($file === '') {
            return '';
        }

        if (preg_match('#^([a-z]{2,}):(.*)$#i', $file, $m)) {
            // resource:identifier given, extract them
            $resource   = $m[1];
            $identifier = $m[2];
        } else {
            // get the current template's resource
            $resource   = $compiler->getCore()->getTemplate()->getResourceName();
            $identifier = $file;
        }

        $tpl = $compiler->getCore()->templateFactory($resource, $identifier);

        if ($tpl === null) {
            throw new CompilationException($compiler,
                'Load Templates : Resource "' . $resource . ':' . $identifier . '" not found.');
        } elseif ($tpl === false) {
            throw new CompilationException($compiler,
                'Load Templates : Resource "' . $resource . '" does not support includes.');
        }

        $cmp = clone $compiler;
        $cmp->compile($compiler->getCore(), $tpl);
        foreach ($cmp->getTemplatePlugins() as $template => $args) {
            $compiler->addTemplatePlugin($template, $args['params'], $args['uuid'], $args['body']);
        }
        foreach ($cmp->getUsedPlugins() as $plugin => $type) {
            $compiler->addUsedPlugin($plugin, $type);
        }

        $out = '\'\';// checking for modification in ' . $resource . ':' . $identifier . "\r\n";

        $modCheck = $tpl->getIsModifiedCode();

        if ($modCheck) {
            $out .= 'if (!(' . $modCheck . ')) { ob_end_clean(); return false; }';
        } else {
            $out .= 'try {
	$tpl = $this->templateFactory("' . $resource . '", "' . $identifier . '");
} catch (Dwoo\Exception $e) {
	$this->triggerError(\'Load Templates : Resource <em>' . $resource . '</em> was not added to Dwoo, can not extend <em>' . $identifier . '</em>\', E_USER_WARNING);
}
if ($tpl === null)
	$this->triggerError(\'Load Templates : Resource "' . $resource . ':' . $identifier . '" was not found.\', E_USER_WARNING);
elseif ($tpl === false)
	$this->triggerError(\'Load Templates : Resource "' . $resource . '" does not support extends.\', E_USER_WARNING);
if ($tpl->getUid() != "' . $tpl->getUid() . '") { ob_end_clean(); return false; }';
        }

        return $out;
    }
805858
protected function getTemplateName() {
				$templateName = $this->templateName;
				
				if($templatePrefix = $this->templatePrefix())
						$templateName = $this->joinPrefix($templateName, $templatePrefix);
				
				if($templateSuffix = $this->templateSuffix())
						$templateName = $this->joinSuffix($templateName, $templateSuffix);
				
				return $templateName;
		}
416844
public function compile(Twig_Compiler $compiler)
    {
        $hasBody = $this->hasNode('default');
        $varId = '__placeholder_'.$this->getAttribute('name').'_default_contents';
        $compiler
            ->addDebugInfo($this)
            ->write("\$context[")
            ->raw("'".$varId."'")
            ->raw("] = null;");

        if ($hasBody) {
            $compiler
                ->addDebugInfo($this)
                ->write('ob_start();')
                ->subcompile($this->getNode('default'))
                ->write("\$context[")
                ->raw("'".$varId."'")
                ->raw("] = ob_get_clean();");
        }

        $isText = $this->hasAttribute('type') && $this->getAttribute('type') == 'text';

        $compiler->addDebugInfo($this);
        if (!$isText) {
            $compiler->write("echo \$this->env->getExtension('Cms\Twig\Extension')->displayBlock(");
        }
        else {
            $compiler->write("echo twig_escape_filter(\$this->env, \$this->env->getExtension('Cms\Twig\Extension')->displayBlock(");
        }

        $compiler
            ->raw("'".$this->getAttribute('name')."', ")
            ->raw("\$context[")
            ->raw("'".$varId."'")
            ->raw("]")
            ->raw(")");

        if (!$isText) {
            $compiler->raw(";\n");
        }
        else {
            $compiler->raw(");\n");
        }

        $compiler
            ->addDebugInfo($this)
            ->write("unset(\$context[")
            ->raw("'".$varId."'")
            ->raw("]);");
    }