phore/filesystem

访问文件层

v1.1.0 2024-02-09 00:37 UTC

This package is auto-updated.

Last update: 2024-08-27 21:20:42 UTC


README

Actions Status

文件访问函数

  • 处理子路径
  • 检查符号链接

安装

compser require phore/filesystem

通用用法

echo phore_uri("/tmp/some.file")->withDirName();

将导致

/tmp

子路径

echo phore_uri("/tmp")->withSubPath("./some/other/file")
/tmp/some/other/file

断言

phore_uri("/tmp")->assertIsFile()->assertIsWritable();

读取 YAML

phore_uri("/tmp/somefile.yml")->assertFile()->get_yaml();

临时文件

当对象销毁时将被解除链接。

$file = new PhoreTempFile();