得到当前Module的模板文件夹下某文件内容
@param $path
@return string
776776
protected function getModuleTemplateContent($path)
    {
        $path = $this->getModuleTemplatePath($path);
        $content = file_get_contents($path);
        return $content;
    }
1117525
private function getPath($path)
    {
        if ($this->basePath === '' || strpos($path, $this->basePath) === 0) {
            $path = substr($path, strlen($this->basePath)) ?: '';
        }

        return $path === '' ? '/' : $path;
    }
210893
final public function getFileContents($path)
    {
        return $this->getRepositoryContent()->download(
            $this->settings->getVendor(),
            $this->settings->getPackage(),
            $path,
            $this->settings->getReference()
        );
    }
1075945
protected function formatPath($path)
    {
        $path = trim($path, '/') . '/';
        if (strlen($path) > 1) {
            $path = '/' . $path;
        }

        return $path;
    }
235012
private function getFileExtension($path) {
		if (empty($path)) return '';
		$ext = pathinfo($path, PATHINFO_EXTENSION);
		return strtolower($ext); 
	}
268943
private function rooted($path)
	{
		if (substr($path, 0, strlen(PATH_ROOT)) == PATH_ROOT)
		{
			$path = 'ROOT' . substr($path, strlen(PATH_ROOT));
		}
		return $path;
	}
206615
public static function get($path)
    {
        $ext = strtolower(pathinfo($path, PATHINFO_EXTENSION));
        if (!isset(self::$fileTypes[$ext])) {
            return false;
        }
        return self::$fileTypes[$ext];
    }
1276050
public static function getFilename($path)
    {
        $name = pathinfo($path, PATHINFO_FILENAME);

        $ext = pathinfo($path, PATHINFO_EXTENSION);

        if ($ext) {
            $name .= '.' . $ext;
        }

        return $name;
    }
1148429
public function path($path = '')
    {
        $appPath = $this->appPath ?: $this->basePath.DIRECTORY_SEPARATOR.'app';

        return $appPath.($path ? DIRECTORY_SEPARATOR.$path : $path);
    }
1199048
public function scriptFile($path) {
        if ($this->skipOtherScriptFiles)
            return "";
        
        if ('http' != substr($path, 0, 4)) {
            $path = \mpf\WebApp::get()->request()->getWebRoot() . $path;
        }

        $md5 = md5($path);
        if (in_array($md5, self::$cssScriptHistory))
            return '';
        self::$cssScriptHistory[] = $md5;
        return '<script type="text/javascript" src="' . self::encode($path) . '"></script>';
    }
266134
public function read($path)
    {
        $contents = file_get_contents($this->applyPathPrefix($path));

        return $contents !== false ? compact('contents') : false;
    }
557928
protected function getDestenationPath($path)
    {
        if (!empty($path)) {
            $path = Helpers::getPathWithSlash($path);
        }

        return Config::getViewsPath() . $path;
    }
971238
public function path($path)
    {
        $path  = strtolower(trim($path));
        $first = substr($path, 0, 1);
        
        if ($first == '@' && isset($this->aliases[$path])) {
            $path = $this->aliases[$path];
            
        } elseif ($first == '/') {
            $path = preg_replace('/\\//', $this->root() . '/', $path, 1);
            
        }
        if ($path = realpath($path)) {
            $path = static::clean($path);
        }
        
        return $path;
    }
869910
protected function cleanPath($path)
    {
        $lastDot = strrpos(
            $path,
            '.'
        );

        $replace = [
            '.',
            ','
        ];

        $string = str_replace(
                      $replace,
                      '',
                      substr(
                          $path,
                          0,
                          $lastDot
                      )
                  ) . substr(
                      $path,
                      $lastDot
                  );

        return $string;
    }
1159492
public static function getFromFile($path)
    {
        if (!($path instanceof File))
            $path = new File($path);

        $ext = $path->getExtension();
        $path = $path->getFullPath();

        $type = new FileType($ext ?? "", "");
        if (empty($type->getMimeType()) && file_exists($path))
            $type->setMimeType(mime_content_type($path));

        return $type;
    }
339132
public static function type(string $path): string
    {
        $result = @filetype($path);
        return $result !== false ? $result : '';
    }
1287217
protected static function encodePath(string $path): string
    {
        // http://tools.ietf.org/html/rfc3986#section-3.3
        // path          = path-abempty    ; begins with "/" or is empty
        //               / path-absolute   ; begins with "/" but not "//"
        //               / path-noscheme   ; begins with a non-colon segment
        //               / path-rootless   ; begins with a segment
        //               / path-empty      ; zero characters
        //
        // path-abempty  = *( "/" segment )
        // path-absolute = "/" [ segment-nz *( "/" segment ) ]
        // path-noscheme = segment-nz-nc *( "/" segment )
        // path-rootless = segment-nz *( "/" segment )
        // path-empty    = 0<pchar>
        // segment       = *pchar
        // segment-nz    = 1*pchar
        // segment-nz-nc = 1*( unreserved / pct-encoded / sub-delims / "@" )
        //               ; non-zero-length segment without any colon ":"
        // pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
        $excluded = static::UNRESERVED_SET.static::SUB_DELIMS_SET.':@\/';

        return static::encode($path, $excluded);
    }