esperecyan/url
Composer 安装命令:
composer require esperecyan/url
包简介
Makes the algorithms and APIs defined by URL Standard (replaces RFC 3986 and RFC 3987) available on PHP. / URL Standard (RFC 3986、RFC 3987 を置き換える Web 標準仕様) で定義されているアルゴリズム、および API を PHP から利用できるようにします。
README 文档
README
English / 日本語
URL Standard
Makes the algorithms and APIs defined by URL Standard available on PHP.
Description
URL Standard is the Web standard specification that replaces the previous standards RFC 3986 and RFC 3987.
The specification defines URL interface and URLSearchPrams interface as API. This library allows you to use esperecyan\url\URL class as URL interface and esperecyan\url\URLSearchParams class as URLSearchPrams interface. The documents on MDN may be easy to understand by way of explanation of the interfaces https://developer.mozilla.org/docs/Web/API/URL https://developer.mozilla.org/docs/Web/API/URLSearchParams .
This library allows you to use the algorithms defined by URL Standard. For details, see The correspondence table of the algorithms.
Example
<?php require_once 'vendor/autoload.php'; use esperecyan\url\URL; $url = new URL('http://url.test/foobar?name=value'); var_dump($url->protocol, $url->pathname, $url->searchParams->get('name'));
The above example will output:
string(5) "http:"
string(7) "/foobar"
string(5) "value"
Requirement
- PHP 5.4, or 7.2 or later (PHP 5.4 and 7.2 are deprecated)
- SPL Types PECL library is not supported
Install
composer require esperecyan/url
For help with installation of Composer, see Composer documentation.
Contribution
- Fork it ( https://github.com/esperecyan/url )
- Create your feature branch
git checkout -b my-new-feature - Commit your changes
git commit -am 'Add some feature' - Push to the branch
git push origin my-new-feature - Create new Pull Request
Or
Create new Issue
If you find any mistakes of English in the README or Doc comments or any flaws in tests, please report by such as above means. I also welcome translations of README too.
Acknowledgement
I use the code from コードポイントから UTF-8 の文字を生成する - Qiita and UTF-8 の文字からコードポイントを求める - Qiita in implementing URLencoding class.
I use URL Standard (Japanese translation) as reference in creating this library.
HADAA helped me translate README to English.
Semantic Versioning
This library uses Semantic Versioning. The classes, methods, constants, and properties in the documentation of the library are the public API.
Licence
This library is licensed under the Mozilla Public License Version 2.0 (MPL-2.0).
The correspondence table of the algorithms
| 5. application/x-www-form-urlencoded | |
|---|---|
| application/x-www-form-urlencoded parser | esperecyan\url\lib\URLencoding::parseURLencoded() |
| application/x-www-form-urlencoded byte serializer | esperecyan\url\lib\URLencoding::serializeURLencodedByte() |
| application/x-www-form-urlencoded serializer | esperecyan\url\lib\URLencoding::serializeURLencoded() |
| application/x-www-form-urlencoded string parser | esperecyan\url\lib\URLencoding::parseURLencodedString() |
| name-value or name-value-type tuples | An array of two-element or three-element arrays with the first element the name, the second the value, and the third the type. The value is an array with the value for name key as the name |
esperecyan/url 适用场景与选型建议
esperecyan/url 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8.33k 次下载、GitHub Stars 达 15, 最近一次更新时间为 2015 年 06 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「url」 「W3C」 「RFC 3986」 「Web Standards」 「WHATWG」 「URLSearchParams」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 esperecyan/url 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 esperecyan/url 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 esperecyan/url 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Streaming zlib compressor and decompressor for ReactPHP, supporting compression and decompression of GZIP, ZLIB and raw DEFLATE formats.
Easily disable HTML5 validation errors.
PHP/SAP implementation for Gregor Kraliks sapnwrfc module. See https://php-sap.github.io for details.
Thinbus SRP PHP is an implementation of the SRP-6a Secure Remote Password protocol.
Email address value object checked against RFC 3696, RFC 1123, RFC 4291, RFC 5321 and RFC 5322.
Easy URL rewrites in your Laravel application
统计信息
- 总下载量: 8.33k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 15
- 点击次数: 26
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MPL-2.0
- 更新时间: 2015-06-20