victor-codigo/upload-file
最新稳定版本:v1.0.2
Composer 安装命令:
composer require victor-codigo/upload-file
包简介
Classes to manage file uploads
README 文档
README
Classes to manage file upload with symfony or package http-foundation.
This package is in charge of Geting the file uploaded, and move it to a new path, with a secure name.
It also allows to replace a file by the new uploaded.
Prerequisites
- PHP 8.1
- Symfony 6.4 or package http-foundation
Stack
Usage
-
Install
composer require victor-codigo/upload-file -
Classes
- UploadFileService: It is the main class. Manages file uploads.
- FileSymfonyAdapter: It is a wrapper for http-foundation package class File.
- UploadedFileSymfonyAdapter: Its a wrapper for http-foundation package class UploadedFile.
UploadFileService methods:
| Method | Description | Params | Return |
|---|---|---|---|
| __construct | Creates class instance | Symfony\Component\String\Slugger\SluggerInterface | VictorCodigo\UploadFile\Adapter\UploadFileService |
| __invoke | Moves the uploaded file to a new location | 1. VictorCodigo\UploadFile\Domain\UploadedFileInterface: The file uploaded. 2. string: path where files are uploaded. 3. string or null: File name to remove in uploads path. |
VictorCodigo\UploadFile\Domain\FileInterface |
| getFileName | Gets the name of the file, after been renamed | string | |
| getNewInstance | Creates a new instance of the class | VictorCodigo\UploadFile\Adapter\UploadFileService |
统计信息
- 总下载量: 43
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-02-13