burzum/cakephp-file-storage
最新稳定版本:3.0.0-beta
Composer 安装命令:
composer require burzum/cakephp-file-storage
包简介
This plugin is giving you the possibility to store files in virtually any kind of storage backend. This plugin is wrapping the Gaufrette library (https://github.com/KnpLabs/Gaufrette) library in a CakePHP fashion and provides a simple way to use the storage adapters through the StorageManager class.
README 文档
README
If you're upgrading from CakePHP 2.x please read the migration guide.
The File Storage plugin is giving you the possibility to upload and store files in virtually any kind of storage backend. The plugin features the Gaufrette and FlySystem library in a CakePHP fashion and provides a simple way to use the storage adapters through the StorageManager class.
Storage adapters are an unified interface that allow you to store file data to your local file system, in memory, in a database or into a zip file and remote systems. There is a database table keeping track of what you stored where. You can always write your own adapter or extend and overload existing ones.
How it works
The whole plugin is build with clear Separation of Concerns (SoC) in mind: A file is always an entry in the file_storage table from the app perspective. The table is the reference to the real place of where the file is stored and keeps some meta information like mime type, filename, file hash (optional) and size as well. Storing the path to a file inside an arbitrary table along other data is considered as bad practice because it doesn't respect SoC from an architecture perspective but many people do it this way for some reason.
You associate the file_storage table with your model using the FileStorage or ImageStorage model from the plugin via hasOne, hasMany or HABTM. When you upload a file you save it to the FileStorage model through the associations, Documents.file for example. The FileStorage model dispatches then file storage specific events, the listeners listening to these events process the file and put it in the configured storage backend using adapters for different backends and build the storage path using a path builder class.
List of supported Adapters
- Apc
- Amazon S3
- ACL Aware Amazon S3
- Azure
- Doctrine DBAL
- Dropbox
- Ftp
- Grid FS
- In Memory
- Local File System
- MogileFS
- Open Cloud
- Rackspace Cloudfiles
- Sftp
- Zip File
Supported CakePHP Versions
- CakePHP 4.x -> 3.0 Branch
- CakePHP 3.x -> 2.0 Branch
- CakePHP 2.x -> 1.0 Branch
Requirements
- PHP 7.2+
- CakePHP 4.x
- Gaufrette Storage Library 0.7.x
Optional but required if you want image processing out of the box:
- The Imagine Image processing plugin if you want to process and store images.
- FlySystem as alternative library over Gaufrette
You can still implement whatever file processing you want very easy. It's not tied to Imagine.
Documentation
For documentation, as well as tutorials, see the docs directory of this repository.
Support
For bugs and feature requests, please use the issues section of this repository.
Contributing
To contribute to this plugin please follow a few basic rules.
- Pull requests must be send to the branch that reflects the version you want to contribute to.
- Unit tests are required.
License
Copyright Florian Krämer
Licensed under The MIT License Redistributions of files must retain the above copyright notice.
burzum/cakephp-file-storage 适用场景与选型建议
burzum/cakephp-file-storage 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 197.08k 次下载、GitHub Stars 达 196, 最近一次更新时间为 2026 年 01 月 04 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「media」 「file」 「filesystem」 「abstraction」 「storage」 「upload」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 burzum/cakephp-file-storage 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 burzum/cakephp-file-storage 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 burzum/cakephp-file-storage 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A SDK for working with B2 cloud storage.
A PHP class providing static methods for reading, writing, copying, moving, and deleting files and directories, MIME type detection, image size detection, and file permission management
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
Simple Sharing generates social media share links within CP entry pages, allowing you to quickly & easily share entries.
The flysystem adapter for yandex disk rest api.
A sleek PHP wrapper around rclone with Laravel-style fluent API syntax
统计信息
- 总下载量: 197.08k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 196
- 点击次数: 32
- 依赖项目数: 6
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-01-04