ntzm/tusk
Composer 安装命令:
composer require ntzm/tusk
包简介
PSR-7 compatible tus server for PHP
关键字:
README 文档
README
PSR-7 compatible tus server for PHP
Available storage drivers
S3
Stores files in S3
$storage = new Tusk\Storage\S3Storage(new Aws\S3\S3Client([ 'version' => '2006-03-01', 'region' => 'eu-west-1', ]), 'bucket-name');
See the documentation for PHP AWS SDK for more information.
ID Generation
By default, file IDs are created using the RandomHexIdGenerator, which should give you 32-character IDs that look like 69ed96b70ab30c8f046e79b74faf481b.
If you'd like to change how this works, you can inject a custom class that implements IdGenerator.
Location Generation
When a file upload begins, the server returns a URL that the client can continue to send data to.
By default this is whatever the POST URL is, plus the file ID.
This is handled by the RelativeLocationGenerator.
For example, if the POST endpoint's URL was /files, the file location would be files/<id>.
If you'd like to change this, you can inject a custom class that implements LocationGenerator.
Events
Tusk emits events when certain things happen during a file's lifecycle. You can hook into these with any PSR-14 compatible event dispatcher implementation.
UploadComplete
Tusk\Event\UploadComplete is fired when a file has been uploaded completely.
It has one method, fileId() which can be called to get the file's ID.
Compatibility
Tusk is compatible with tus 1.0.0 and the following extensions:
ntzm/tusk 适用场景与选型建议
ntzm/tusk 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 3 次下载、GitHub Stars 达 7, 最近一次更新时间为 2020 年 01 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「tus」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ntzm/tusk 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ntzm/tusk 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ntzm/tusk 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Laravel package for handling resumable file uploads with tus protocol and native Uppy.js support without additional tus servers
Upload files to your Laravel application with the tus.io resumable upload protocol.
Laminas (PHP) library for tus server, based on php-tus library by Simon Leblanc.
Laravel package for handling resumable file uploads with tus protocol and native Uppy.js support without additional tus servers
Uppy Blade components for Laravel
A laravel implementation of tus-php
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 7
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-01-24