# tus-php-hyperf **Repository Path**: mrpzx/tus-php-hyperf ## Basic Information - **Project Name**: tus-php-hyperf - **Description**: The Hyperf Tus-php package. - **Primary Language**: PHP - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-04-20 - **Last Updated**: 2022-08-30 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hyperf 可恢复文件上传组件 该组件移植了 Tus-php 组件([Tus-php](https://github.com/ankitpokhrel/tus-php ))相对完整的功能特性。 * Swoole无法获取 `php://input`,用 `Swoole\Http\Request->getContent()` 代替 ## 安装 ```shell script composer require he426100/tus-php-hyperf ``` ## 发布配置 ```shell script php bin/hyperf.php vendor:publish he426100/tus-php-hyperf ``` > 文件位于 `config/autoload/tus.php`。 ## 使用示例 * hyperf/app/Controller/TusController.php ``` request, $this->response))->setUploadDir(\dirname(__DIR__, 3) . '/public/' . 'uploads'); return $server->serve(); } } ``` * nano/index.php ``` config([ 'cache.default' => [ 'driver' => \Hyperf\Cache\Driver\RedisDriver::class, 'packer' => \Hyperf\Utils\Packer\PhpSerializerPacker::class, 'prefix' => 'c:', ], ]); $app->addRoute(['HEAD', 'GET', 'POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE'], '/', function() { $server = new Server($this->request, $this->response); return $server->serve(); }); $app->run(); ``` * uppy.html ```