cloudstek / scim-filter-parser
SCIM (IETF RFC 7644,跨域身份管理系统) 过滤语法的解析器。
v3.0.0
2022-03-22 00:13 UTC
Requires
- php: ^8.1
- nette/tokenizer: ^3.1
Requires (Dev)
- php-coveralls/php-coveralls: ^2.2
- phpunit/phpunit: ^9.0
- squizlabs/php_codesniffer: ^3.5
- vimeo/psalm: ^4.22
This package is auto-updated.
Last update: 2024-09-22 05:50:09 UTC
README
SCIM (IETF RFC 7644,跨域身份管理系统) 过滤语法的解析器。
安装
此库作为composer包提供,这是推荐安装此库的方式。
$ composer require cloudstek/scim-filter-parser
手动安装
如果您不使用composer,可以使用以下步骤手动安装此库
- 克隆此存储库或从发布页面下载最新版本。
- 手动要求所有文件或使用PSR-4自动加载器(推荐)。
用法
如代码常言,少说空话,以下是一点代码供您开始。
<?php use Cloudstek\SCIM\FilterParser\FilterParser; // Create the filter parser. $filterParser = new FilterParser(); // Parse a filter string $firstFilterAst = $filterParser->parse('userName eq "foobar"'); // Cloudstek\SCIM\FilterParser\AST\Comparison ... // ... walk through the AST (abstract syntax tree) and do something with it. // The parser is stateless so you can safely parse another filter if you like. $secondFilterAst = $filterParser->parse('name[given eq "John" and family eq "Dough"]'); // Cloudstek\SCIM\FilterParser\AST\ValuePath ... // Create the path parser. $pathParser = new PathParser(); // Parse a path string, used in for example PATCH operations. $pathAst = $pathParser->parse('name[given eq "John"].familyName'); // Cloudstek\SCIM\FilterParser\AST\ValuePath ...
问题
请在项目的GitHub问题页面上报告问题,并确保包括有关您的PHP版本、库版本、过滤字符串和结果AST的信息。
已知限制
目前有一些限制需要注意,尽管将来可能会解决这些问题。