dflydev / ant-path-matcher
Ant Path Matcher 实用工具
v1.0.4
2023-01-23 23:02 UTC
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: ^4|^5|^6|^7|^8|^9
README
PHP 的 Ant 路径模式匹配器。从 Spring 中友好地借用实现。
要求
- PHP 5.3+
用法
<?php use dflydev\util\antPathMatcher\AntPathMatcher; $antPathMatcher = new AntPathMatcher(); if ($antPathMatcher->match('foo/**/baz/*.txt', 'foo/bar/baz/hello-world.txt')) { echo "This is true!\n"; }
许可证
此库采用新 BSD 许可证授权 - 请参阅 LICENSE 文件以获取详细信息。
社区
如果您有问题或想提供帮助,请加入 irc.freenode.net 上的 #dflydev 频道。
非原创
存在其他类似 Ant 的模式匹配 PHP 端口,但大多数要么不完整,要么与实际遍历磁盘相关联,或者如此深入地嵌入到另一个更大的项目中,以至于无法使用。
此实现完全是基于字符串的,并且基于 Spring 中找到的 AntPathMatcher。