承接 phpactor/file-path-resolver 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

CI

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 #phpactor channel on the Slack Symfony Devs channel.

统计信息

  • 总下载量: 55.13k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-30