取模板文件绝对路径
@param $name
@return string
346411
private function getTemplateFile($name)
    {
        return Request::get('system.root').$this->config['path'].(isset($this->config['module']) ? $this->config['module'] : '').'/'.$name.$this->config['suffix'];
    }
861221
public function get($name) {
        $name       =  $this->options['prefix'].addslashes($name);
        N('cache_read',1);
        $result     =  $this->handler->query('SELECT `data`,`datacrc` FROM `'.$this->options['table'].'` WHERE `cachekey`=\''.$name.'\' AND (`expire` =0 OR `expire`>'.time().') LIMIT 0,1');
        if(false !== $result ) {
            $result   =  $result[0];
            if(C('DATA_CACHE_CHECK')) {//开启数据校验
                if($result['datacrc'] != md5($result['data'])) {//校验错误
                    return false;
                }
            }
            $content   =  $result['data'];
            if(C('DATA_CACHE_COMPRESS') && function_exists('gzcompress')) {
                //启用数据压缩
                $content   =   gzuncompress($content);
            }
            $content    =   unserialize($content);
            return $content;
        }
        else {
            return false;
        }
    }
329123
public static function string($name)
    {
        $buffer = [];
        foreach (self::trigger($name) as $hook) {
            $buffer[] = $hook->output;
        }
        
        return implode("", $buffer);
    }
809276
public static function getImageSize($name)
    {
        if (isset($_FILES[$name])) {
            $tempFile = $_FILES[$name]['tmp_name'];
            if (!empty($tempFile) && file_exists($tempFile)) {
                $size = getimagesize($tempFile);

                return $size;
            }
        }

        return getimagesize($name);
    }
1112844
private function resolveFileName($name): string
    {
        $filename = $this->getFilename($name);
        if ($filename === false) {
            throw new LoaderError(sprintf('Template "%s" is not defined.', $name));
        }

        return $filename;
    }
653868
public function getLoadedFile(string $name)
    {
        $properties                     = $this->getProperties();
        $loadedFiles                    = $properties['loadedFiles'];
        $names                          = array_column($loadedFiles, 'name');
        if (in_array($name, $names)) {
            $key = array_search($name, array_column($loadedFiles, 'name'));
            return $loadedFiles[$key];
        }
        return false;
    }
452091
public function getHeader($name)
    {
        $name = strtolower($name);

        return $this->hasHeader($name) ? $this->headers[$name] : [];
    }
280711
protected static function getFilePath($name)
  {
    $path = str_replace("_", DIRECTORY_SEPARATOR, $name);
    $path = str_replace(__CLASS__, dirname(__FILE__), $path);

    return $path;
  }
659474
final public function output(string $name = null)
    {
        $result = implode(static::EOL, $this->registries) . static::EOL
            . static::EOF;

        if ($name === null) {
            return $result;
        }

        Utils::checkOutput(pathinfo($name)['extension'] ?? '');

        header('Content-Type: text/plain');
        header('Content-Length: ' . strlen($result));
        header('Content-Disposition: attachment; filename="' . $name . '"');
        echo $result;
    }
574327
public function _get($name)
    {
        $name = $this->createFileName($name);
        $data = $this->redis->get($name);
        if ($data) {
            $data = $this->unpackData($data);
        }

        return $data;
    }
1245024
public function getCacheFilename($name)
    {
        if (false === $this->cache) {
            return false;
        }

        $class = substr($this->getTemplateClass($name), strlen($this->templateClassPrefix));

        return $this->getCache().'/'.substr($class, 0, 2).'/'.substr($class, 2, 2).'/'.substr($class, 4).'.php';
    }
1082364
protected function getFilePath($name)
    {
        if (pathinfo($name, PATHINFO_EXTENSION) === '') {
            $name .= (substr($name, -1) === '/' ? 'index' : '') . '.' . $this->getExt();
        }
        
        return rtrim($this->path, '/') . '/' . ltrim($name, '/');
    }
850351
public function getSluggedFileName($name)
    {
        $fileNameExploded = explode(".", $name);
        $extension = array_pop($fileNameExploded);
        $fileNameExploded = implode(".", $fileNameExploded);

        return $this->slugify($fileNameExploded) . "." . $extension;
    }
767750
public static function dumpName(string $name): string
    {
        if (self::isLikeName($name)) {
            return $name;
        }
        return self::dumpInline($name);
    }
949972
public function getFile(string $name)
    {
        $contentArea = $this->content->getFile($name);

        if ($contentArea) {
            return $contentArea->file;
        }

        return null;
    }
1362457
public function save ($name = null)
		{
			if ($name == null)
				$name = StringHelper::random();

			$ext = pathinfo($this->_params[ 'filename' ], PATHINFO_EXTENSION);
			$this->_savedFilename = $name . '.' . $ext;
			if (( $file = fopen($this->_targetDir . '/' . $this->_savedFilename, 'w') ) !== false)
			{
				if (Yii::$app->settings->get('upload_concat') == 'cat')
				{
					fclose($file);
					setlocale(LC_ALL, 'ru_RU.UTF-8');
					for ($i = 1; $i <= $this->_params[ 'totalChunks' ]; $i++)
						shell_exec('cat ' . escapeshellarg($this->getChunkPath($i)) . ' >> ' . escapeshellarg($this->_targetDir . '/' . $this->_savedFilename));
					setlocale(LC_ALL, null);
				}
				else
				{
					for ($i = 1; $i <= $this->_params[ 'totalChunks' ]; $i++)
						fwrite($file, file_get_contents($this->getChunkPath($i)));
					fclose($file);
				}
			}
			FileHelper::removeDirectory($this->_tmpDir);

			return $this->_savedFilename;
		}
1165311
public function rm($name) {
        $this->open();
        $name   =   $this->options['prefix'].$name;         
        $s      =   'D' . pack('N', strlen($name)) . $name;
        fwrite($this->handler, $s);
        $ret    = fgets($this->handler);
        $this->close();
        return $ret === "OK\n";
     }