获取CatCache信息
@param $path
@throws \Exception
543509
public function back_getCatCacheKeys($path)
    {
        $result = CatCacheRpcProxy::getRpc()->getKeys($path);
        $this->autoSend($result);
    }
292762
protected function cacheDir($path) {
		$this->dirsCache[$path] = array();
		$res = $this->query('select dat from '.$this->DB_TableName.' where path='.$this->DB->quote(strtolower($path)));
		
		if ($res) {
			foreach($res as $raw) {
				$raw = unserialize($raw);
				if ($stat = $this->parseRaw($raw)) {
					$stat = $this->updateCache($raw['path'], $stat);
					if (empty($stat['hidden'])) {
						$this->dirsCache[$path][] = $raw['path'];
					}
				}
			}
		}
		return $this->dirsCache[$path];
	}
1218239
function purge_cache( $path, $method = 'GET', $params = array() ) {
			$this->_logger->entrance( "{$method}:{$path}" );

			$cache_key = $this->get_cache_key( $path, $method, $params );

			self::$_cache->purge( $cache_key );
		}
131130
private function getImageInfoFormatData( string $path ) : array
	{
		if( !file_exists( $path ) ){
			throw new \Exception( "该文件不存在" );
		}
		$data         = [
			// 纯名字
			'name' => '',
			// 相对路径
			'path' => '',
			// 文件字节
			'size' => 0,
			// 媒体类型
			'type' => '',
		];
		$data['name'] = $this->fileName;
		$data['path'] = $path;
		$data['size'] = filesize( $path );
		$data['type'] = $this->mediaType;
		return $data;
	}
277886
protected function cacheDir($path) {
		$this->dirsCache[$path] = array();

		$sql = 'SELECT f.id, f.parent_id, f.name, f.size, f.mtime AS ts, f.mime, f.read, f.write, f.locked, f.hidden, f.width, f.height, IF(ch.id, 1, 0) AS dirs 
				FROM '.$this->tbf.' AS f 
				LEFT JOIN '.$this->tbf.' AS ch ON ch.parent_id=f.id AND ch.mime="directory"
				WHERE f.parent_id="'.$path.'"
				GROUP BY f.id';
				
		$res = $this->query($sql);
		if ($res) {
			while ($row = $res->fetch_assoc()) {
				// debug($row);
				$id = $row['id'];
				if ($row['parent_id']) {
					$row['phash'] = $this->encode($row['parent_id']);
				} 
				
				if ($row['mime'] == 'directory') {
					unset($row['width']);
					unset($row['height']);
				} else {
					unset($row['dirs']);
				}
				
				unset($row['id']);
				unset($row['parent_id']);
				
				
				
				if (($stat = $this->updateCache($id, $row)) && empty($stat['hidden'])) {
					$this->dirsCache[$path][] = $id;
				}
			}
		}
		
		return $this->dirsCache[$path];
	}
1096022
public function read($path)
    {
        $cachePath = $this->getCachePathFor($path);
        $feature = unserialize(file_get_contents($cachePath));

        if (!$feature instanceof FeatureNode) {
            throw new CacheException(sprintf('Can not load cache for a feature "%s" from "%s".', $path, $cachePath ));
        }

        return $feature;
    }
400056
public function isExpired($path)
    {
        $cachePath = $this->getCacheFile($this->getCacheKey($path));

        if (!is_file($cachePath)) {
            return true;
        }

        return filemtime($path) >= filemtime($cachePath);
    }
131362
public function setPath($path)
        {
            if ($this->validatePath($path) === false) {
                throw new Exception("Path \"$path\" is not a valid HTTP path");
            }

            $oldPath     = $this->_path;
            $this->_path = $path;

            return $oldPath;
        }
897667
public function ensureParentDirectories($path)
    {
        $object = $this->cache[$path];

        while ($object['dirname'] !== '' && ! isset($this->cache[$object['dirname']])) {
            $object = Util::pathinfo($object['dirname']);
            $object['type'] = 'dir';
            $this->cache[$object['path']] = $object;
        }
    }
740322
public function flushCache($path)
    {
        if (isset($this->attributes['paths'][$path])) {
            $clean = $this->plugin['files']->cleanDirectory($this->attributes['paths'][$path]);
            if ($clean) {
                $this->plugin['files']->put($this->attributes['paths'][$path] . '/.gitignore',"*\n!.gitignore\n");
            }
            return $clean;
        }
        return false;
    }
1079772
public static function fileToZip($path)
    {
        if (is_file($path) || is_dir($path)) {
            $zip = new \ZipArchive;
            $zip_file = ROOT . '/private/cache/zip/' . md5(microtime(true));
            if (!is_dir(dirname($zip_file))) {
                mkdir(dirname($zip_file), 0775, true);
            }

            if ($zip->open($zip_file, \ZipArchive::CREATE) === true) {
                if (is_dir($path)) {
                    $iterator = new \DirectoryIterator($path);

                    foreach ($iterator as $file) {
                        if ($file->isFile()) {
                            $bn = $file->getBasename();
                            $zip->addFile($file->getPath() . '/' . $bn, $bn);
                        }
                    }
                } else {
                    $zip->addFile($path, basename($path));
                }

                if ($zip->close()) {
                    self::send($zip_file, str_replace("/", "_", basename($path)) . '.zip');
                    unlink($zip_file);
                }
            } else {
                throw(new \Exception('failed to create zip file'));
            }
        } else {
            throw(new \Exception('No data found!'));
        }
    }
736624
private function loadFile(string $path)
    {
        if (!file_exists($path)) {
            throw new Exception('Configuration file "' . $path . '" is not found');
        }

        if (!is_readable($path)) {
            throw new Exception('Configuration file "' . $path . '" is not readable');
        }

        // Include file
        $content = include $path;

        if (!\is_array($content)) {
            throw new Exception("Passed file \"$path\" is not array");
        }

        return $content;
    }
311651
public function load($path)
    {
        $path = $this->safePath($path);
        
        if(!$this->isExist($path)) {
            throw new Exception('附件不存在。', 404);
        }
        
        if ($this->isStatic()) {
            header('Location: '.$this->getFullUrl($path));
            return true;
        } else {
                
            $pos = strrpos($path, '.');
            
            if(false !== $pos) {
                $mimes = [
                    'css'  => 'text/css',
                    'js'   => 'text/javascript',
                    'htm'  => 'text/html',
                    'html' => 'text/html',
                    'jpg'  => 'image/jpeg',
                    'jpeg' => 'image/jpeg',
                    'gif'  => 'image/gif',
                    'png'  => 'image/png',
                    'tiff' => 'image/tiff',
                    'tif'  => 'image/tif',
                    'ico'  => 'image/ico',
                    'svg'  => 'image/svg+xml',
                    'pdf'  => 'application/pdf',
                    'doc'  => 'application/msword',
                    'rtf'  => 'application/rtf',
                    'xls'  => 'application/vnd.ms-excel',
                    'ppt'  => 'application/vnd.ms-powerpoint',
                    'rar'  => 'application/x-rar-compressed',
                    'swf'  => 'application/x-shockwave-flash',
                    'zip'  => 'application/zip',
                    'msi'  => 'application/octet-stream',
                    'exe'  => 'application/octet-stream',
                    'mid'  => 'application/midi',
                    'midi' => 'application/midi',
                    'kar'  => 'application/midi',
                    'mp3'  => 'application/mpeg',
                    '3gp'  => 'application/3gpp',
                    '3gpp' => 'application/3gpp',
                    'mpg'  => 'application/mpeg',
                    'mpeg' => 'application/mpeg',
                    'mov'  => 'application/quicktime',
                    'flv'  => 'application/x-flv',
                    'mng'  => 'application/x-mng',
                    'asx'  => 'application/x-ms-asx',
                    'asf'  => 'application/x-ms-asf',
                    'wmv'  => 'application/x-ms-wmv',
                    'avi'  => 'application/x-ms-avi',
                ];
            
                $ext = substr($path, $pos+1);
            
                if(isset($mimes[$ext])) {
                    $mime = $mimes[$ext];
                } else {
                    $mime = 'application/octet-stream';
                }
                
                header("Content-Type: {$mime}");
            }
            
            header('Cache-Control: public, max-age=2592000');
            header('Pragma: public');
            header('Expires: '.date('D, d M Y H:i:s', time()+2592000). ' GMT');
            header('Last-Modified: '.date('D, d M Y H:i:s', mktime(0, 0, 1, 1, 1, 2000)). ' GMT');
            
            print $this->getContent($path);
            
            return true;
        }
    }
816903
static public function decode(string $path = ""): void
    {
        // 是否特指解析
        $replace = self::decodeConfig($path);

        // 如果是特指解析
        if ($replace) {
            // 更换路径
            $path = $replace;

            // 特指解析下,必须按路径模式
            $mode = '路径模式';
        } else {
            // URL模式:传统模式/单入口模式/路径模式
            $mode = configDefault('传统模式', 'system', 'url_mode');
        }

        // 如果路径为空,跳转到最后,补充默认控制器与方法
        // 或者不是路径模式
        if (!$path or $mode != '路径模式') {
            self::decodeDefault();
            return;
        }

        // 例 <path_root><m>/<c>/<a>/<k1>/<v1>/<k2>/<v2>/...
        // 去除前导index.php
        $path = preg_replace('/^(\w+\.php)/', '', $path);

        // 如果没有控制器和动作
        if (!$path) {
            self::decodeDefault();
            return;
        }

        // 路径分解
        $path = explode('/', $path);
        $count = count($path);

        // 如果没有
        if (!$count) {
            self::decodeDefault();
            return;
        }

        // 取当前所有可能的模块
        $modules = self::$modules;

        // 默认的模块,控制器,动作名称
        list ($module, $controller, $action) = self::getMCADefault();

        // 计算实际的MCA值
        // 如果第一个路径的值,与模式名匹配
        if ($modules and in_array($path[0], $modules)) {
            $module = array_shift($path);
        }

        // 下一个参数是C
        if (count($path)) {
            $controller = array_shift($path);
        }

        // 下一个参数是A
        if (count($path)) {
            $action = array_shift($path);
        }
        // 将解析出来的MCA重新赋值回请求参数中
        list ($m, $c, $a) = self::$mcaName;
        $_GET[$m] = $_REQUEST[$m] = $module;
        $_GET[$c] = $_REQUEST[$c] = $controller;
        $_GET[$a] = $_REQUEST[$a] = $action;

        // 如果有后继参数列表,解析
        while (count($path)) {
            $key = array_shift($path);
            $value = array_shift($path);
            $_GET[$key] = $_REQUEST[$key] = $value;
        }
    }
227018
public function read( $path )
	{
		try {
			return $this->fs->get( $path );
		} catch( \Exception $e ) {
			throw new Exception( $e->getMessage(), 0, $e );
		}
	}
651014
private function lintFile($path)
    {
        static $linter;

        if (empty($linter)) {
            $linter = function_exists('opcache_get_status')
                && !empty(opcache_get_status(false)['opcache_enabled'])
                    ? [$this, 'opcacheLint']
                    : [$this, 'commandLineLint'];
        }

        return call_user_func($linter, $path);
    }
295340
public function deleteCache($path)
    {
        if (!$this->groupCacheInFolders) {
            throw new InvalidArgumentException(
                'Deleting cached image manipulations is not possible when grouping cache into folders is disabled.'
            );
        }

        return $this->cache->deleteDir(
            dirname($this->getCachePath($path))
        );
    }