togos/php-n2r
Composer 安装命令:
composer require togos/php-n2r
包简介
Library (and stand-alone scripts) for handling /uri-res/N2R requests backed by a ccouch repository.
README 文档
README
Serves blobs identified by urn:sha1 and urn:bitprint URNs via the
/uri-res/N2R?+(URN) convention (see RFC 2169).
Can be used as a library or by itself.
Installation as stand-alone script
- Check this project out to a directory under your document root called
uri-res. - If you feel like it, run
composer install - Copy config.php.example to config.php and edit it.
- Serve using your favorite web server (or
php -S localhost:1234 dispatch.php)
If vendor/autoload.php does not exist (because you did not run composer install),
scripts will fall back to loading the included versions of the libraries from ext-lib.
This way PHPN2R can continue to run on old computers with very old versions
of PHP and composer isntalled, like that raspberry Pi 2B under the stairs that's been
running the same old Raspbian since 2012.
Repository format
See ContentCouchRepositoryFormat.
The repositories listed in config.php are assumed to be of the following format
<repository directory>/
data/
<arbitrary sector name>/
<first 2 letters of base32-encoded SHA-1>/
<base32-encoded SHA-1 of file contents>
You can have any number of sectors, and their names are not important. They just act as buckets within which you can organize your data (e.g. you might put really important stuff in one, less important stuff somewhere else, data of questionable value in yet another).
Use as a library
Explicitly not documented, because the API isn't so nice and I'm probably the only one in the world to whom it is useful, anyway.
TODO:
Look at http://pablotron.org/software/zipstream-php/ for making zips of directories
togos/php-n2r 适用场景与选型建议
togos/php-n2r 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 14.18k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2014 年 07 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 togos/php-n2r 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 togos/php-n2r 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 14.18k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 20
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2014-07-10