phpactor/file-path-resolver
最新稳定版本:0.8.3
Composer 安装命令:
composer require phpactor/file-path-resolver
包简介
Resolve files paths for your application (e.g. cache, data, etc)
README 文档
README
Resolves file paths by filtering and replacing tokens with values.
- Canonicalization support via
webmozart/path-util - XDG directory expansion via
dnoegel/php-xdg-base-dir
This package can be used in, for example, a CLI application such as Phpactor to resolve application paths.
Usage
$pathResolver = new PathResolver([ new CanonicalizationFilter(), new TokenExpandingFilter([ new ValueExpander('%my_token%', 'my_value'), new XdgCacheExpander('%xdg_cache%'), new XdgConfigExpander('%xdg_conifg%'), new CallbackExpander('%callback%', function () { return 'hello from callback'; }); ]) ]); $pathResolver->resolve('/foo/../foo/%my_token%'); // foo/my_value $pathResolver->resolve('%xdg_home%/my_app'); // /home/user/.config/my_app $pathResolver->resolve('%callback%'); // hello from callback
Contributing
This package is open source and welcomes contributions! Feel free to open a pull request on this repository.
Support
- Create an issue on the main Phpactor repository.
- Join the
#phpactorchannel on the Slack Symfony Devs channel.
统计信息
- 总下载量: 55.13k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-10-30