src/core/framework/core/3rdparty/dwoo/Dwoo/Template/String.php
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;
	}
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;
	}
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 ; }
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
returns the compiled template file name