/*!
\static
\return the directory for compiled templates.
540324
static function compilationDirectory()
    {
        if ( isset( $GLOBALS['eZTemplateCompilerSettings']['compilation-directory'] ) and
             $GLOBALS['eZTemplateCompilerSettings']['compilation-directory'] !== null )
        {
            return $GLOBALS['eZTemplateCompilerSettings']['compilation-directory'];
        }

        $compilationDirectory =& $GLOBALS['eZTemplateCompilerDirectory'];
        if ( !isset( $compilationDirectory ) )
        {
            $ini = eZINI::instance();
            $shareTemplates = $ini->hasVariable( 'TemplateSettings', 'ShareCompiledTemplates' ) ?
                                $ini->variable( 'TemplateSettings', 'ShareCompiledTemplates' ) == 'enabled' :
                                false;
            if ( $shareTemplates &&
                 $ini->hasVariable( 'TemplateSettings', 'SharedCompiledTemplatesDir' ) &&
                 trim( $ini->variable( 'TemplateSettings', 'SharedCompiledTemplatesDir' ) ) != '' )
            {
                $compilationDirectory = eZDir::path( array( $ini->variable( 'TemplateSettings', 'SharedCompiledTemplatesDir' ) ) );
            }
            else
            {
                $compilationDirectory = eZDir::path( array( eZSys::cacheDirectory(), 'template/compiled' ) );
            }
        }
        return $compilationDirectory;
    }
1122849
protected function getTemplatePath()
    {
        if (!isset($this->templatePath)) {
            $this->templatePath = self::$config->templates[$this->template] . '/' . $this->name;
        }

        return $this->templatePath;
    }
782377
public function setCompileDirectory()
    {
        $compilePath = $this->getTemplatesDirectory() . DIRECTORY_SEPARATOR . $this->compileDirectoryName . DIRECTORY_SEPARATOR;

        if (!file_exists($compilePath))
        {
            static::mkdir($compilePath);
        }

        $this->compilePath = $compilePath;
    }
580400
private function findTemplatesInDirectory($dir, $namespace = null, array $excludeDirs = [])
    {
        if (!is_dir($dir)) {
            return [];
        }

        $templates = [];
        foreach (Finder::create()->files()->followLinks()->in($dir)->exclude($excludeDirs) as $file) {
            $templates[] = (null !== $namespace ? '@'.$namespace.'/' : '').str_replace('\\', '/', $file->getRelativePathname());
        }

        return $templates;
    }
256970
public function setTemplateDir($dirs): Sdopx
    {
        $this->templateDirs = [];
        $this->templateJoined = '';
        if (empty($dirs)) {
            return $this;
        }
        if (is_string($dirs)) {
            $this->templateDirs[] = $dirs;
            return $this;
        } elseif (is_array($dirs)) {
            foreach ($dirs as $key => $value) {
                if (!is_string($value) || empty($value)) {
                    continue;
                }
                $this->templateDirs[$key] = $value;
            }
        }
        return $this;
    }
593641
def get_template_folder():
    """"""
    cfg = get_project_configuration()
    if 'templates' not in cfg:
        home = os.path.expanduser("~")
        rcfile = os.path.join(home, ".hwrtrc")
        cfg['templates'] = pkg_resources.resource_filename('hwrt',
                                                           'templates/')
        with open(rcfile, 'w') as f:
            yaml.dump(cfg, f, default_flow_style=False)
    return cfg['templates']
372627
public function getCacheDir()
    {
        $dir=$this->m_cacheDir;
        if(empty($dir)){
            $dir=__DIR__."/../../../../../../_cache";
        }
        if(!file_exists($dir)){
            File::createDir($dir);
        }
        return rtrim($dir)."/";
    }
295795
public function getDirectory()
    {
        $dir = clone $this;
        $dir->path = str_replace(DIRECTORY_SEPARATOR, '/', dirname($this->path));
        if (!$dir->path) $dir->path = '/';

        return $dir;
    }
572728
public function getUrlTemplateDir()
    {
        if (($sValue = $this->getViewConfigParam('urltemplatedir')) === null) {
            $sValue = $this->getConfig()->getTemplateUrl($this->isAdmin());
            $this->setViewConfigParam('urltemplatedir', $sValue);
        }

        return $sValue;
    }
1359859
public function getCompileDir()
	{
		if ($this->compileDir === null) {
			$this->setCompileDir(dirname(__FILE__).DIRECTORY_SEPARATOR.'compiled'.DIRECTORY_SEPARATOR);
		}

		return $this->compileDir;
	}
1309290
public function getDirectory() : ?string 
    {
        if ( ! $this->hasDirectory()) {
            $this->setDirectory($this->getDefaultDirectory());
        }
        return $this->directory;
    }
857583
public static function getTemplatePath()
    {
        $path = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'templates' . DIRECTORY_SEPARATOR;
        return realpath($path);
    }
1013832
function templateFile( $templateName )
    {
        if ( isset( $this->Templates[$templateName] ) )
        {
            return $this->Templates[$templateName]['filepath'];
        }
        return false;
    }
399749
function getCombinedTemplateDirectory(templateDirectories) {
    // Automatically track and clean up files at exit.
    temp.track();

    // Create a temporary directory to hold our template files.
    var combinedTemplateDirectory = temp.mkdirSync('templates');

    // Copy templates from our source directories into the combined directory.
    templateDirectories.reverse().forEach(function(templateDirectory) {
      grunt.file.expand(path.join(templateDirectory, '*.html')).forEach(function(srcPath) {
        var srcFilename = path.basename(srcPath),
            destPath = path.join(combinedTemplateDirectory, srcFilename);
        grunt.file.copy(srcPath, destPath);
      });
    });

    return combinedTemplateDirectory;
  }
297350
private function _get_template( $fallback = '' ) {
		$templates = $this->_templates();

		foreach ( $templates as $template ) {
			if ( file_exists( $template ) ) {
				return $template;
			}
		}

		return $fallback;
	}
692247
public function getRelativePath()
    {
        $templates = $this->config['directories']['templates'];

        $extension = $this->config['templates']['extension'];

        return $templates . '/' . $this->getFilename($extension);
    }
342274
public function populateCompiledFilepath(Smarty_Internal_Template $_template)
    {
        $_compile_id = isset($_template->compile_id) ? preg_replace('![^\w]+!', '_', $_template->compile_id) : null;
        if ($_template->source->isConfig) {
            $_flag = '_' .
                ((int) $_template->smarty->config_read_hidden + (int) $_template->smarty->config_booleanize * 2 +
                    (int) $_template->smarty->config_overwrite * 4);
        } else {
            $_flag =
                '_' . ((int) $_template->smarty->merge_compiled_includes + (int) $_template->smarty->escape_html * 2);
        }
        $_filepath = $_template->source->uid . $_flag;
        // 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 = $_template->source->handler->getBasename($_template->source);
        if ($_basename === null) {
            $_basename = basename(preg_replace('![^\w]+!', '_', $_template->source->name));
        }
        // separate (optional) basename by dot
        if ($_basename) {
            $_basename = '.' . $_basename;
        }

        $this->filepath = $_compile_dir . $_filepath . '.' . $_template->source->type . $_basename . $_cache . '.php';
        $this->exists = is_file($this->filepath);
        if (!$this->exists) {
            $this->timestamp = false;
        }
    }