bentools/querystring
Composer 安装命令:
composer require bentools/querystring
包简介
Query String manipulation library. PHP 7.1+. No dependency, immutable, PSR-7 compliant.
README 文档
README
QueryString
A lightweight, object-oriented, Query String manipulation library.
Why?
Because I needed an intuitive way to add or remove parameters from a query string, in any project.
Oh, and, I also wanted that ['foos' => ['foo', 'bar']] resolved to foos[]=foo&foos[]=bar instead of foos[0]=foo&foos[1]=bar, unlike many libraries do.
Thanks to object-oriented design, you can define the way query strings are parsed and rendered.
Usage
Simple as that:
require_once __DIR__ . '/vendor/autoload.php'; use function BenTools\QueryString\query_string; $qs = query_string( 'foo=bar&baz=bat' ); $qs = $qs->withParam('foo', 'foofoo') ->withoutParam('baz') ->withParam('ho', 'hi'); print_r($qs->getParams()); /* Array ( [foo] => foofoo [ho] => hi ) */ print $qs; // foo=foofoo&ho=hi
Documentation
Installation
PHP 7.1+ is required.
composer require bentools/querystring:^1.0
Tests
./vendor/bin/phpunit
License
MIT
See also
bentools/uri-factory - A PSR-7 UriInterface factory based on your own dependencies.
bentools/pager - A simple, object oriented Pager.
bentools/where - A framework-agnostic fluent, immutable, SQL query builder.
bentools/picker - Pick a random item from an array, with weight management.
bentools/psr7-request-matcher - A PSR-7 request matcher interface.
bentools/cartesian-product - Generate all possible combinations from a multidimensionnal array.
bentools/string-combinations - A string combinations generator.
bentools/flatten-iterator - An iterator that flattens multiple iterators or arrays.
bentools/querystring 适用场景与选型建议
bentools/querystring 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 41.73k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2017 年 11 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「url」 「uri」 「query string」 「querystring」 「psr-7」 「psr7」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 bentools/querystring 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 bentools/querystring 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 bentools/querystring 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Safely namespaced guzzle psr7 for WP2Static
Query filtering in your frontend
Easy URL rewrites in your Laravel application
uri signer with expiration option
Anax Database Active Record module for model classes.
Zend Framework 1 Uri package
统计信息
- 总下载量: 41.73k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 11
- 依赖项目数: 8
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-11-08