hollogram/stapler2
Composer 安装命令:
composer require hollogram/stapler2
包简介
Elegant and simple ORM-based file upload package for php.
README 文档
README
Note: If you've previously been using this package, then you've been using it with Laravel. This package is no longer directly coupled to the Laravel framework. As of 1.0.0, Stapler is now framework agnostic. In order to take advantage of the Laravel specific features provided by the previous Beta releases (service providers, IOC container, commands, migration generator, etc) , I've created a separate package specifically for the purpose of using Stapler within Laravel: Laravel-Stapler. If you're using Stapler inside a Laravel application I strongly recommend you use this package (it will save you a bit of boilerplate).
Stapler is a php-based framework agnostic file upload package inspired by the Ruby Paperclip gem. It can be used to add file file uploads (as attachment objects) to your ORM records. While not an exact duplicate, if you've used Paperclip before then you should feel quite comfortable using this package.
Stapler was created by Travis Bennett.
Requirements
Stapler currently requires php >= 5.4 (Stapler is implemented via the use of traits).
Installation
Stapler is distributed as a composer package, which is how it should be used in your app.
Install the package using Composer. Edit your project's composer.json file to require codesleeve/stapler.
"require": { "codesleeve/stapler": "1.0.*" }
About Stapler
Stapler works by attaching file uploads to database table records. This is done by defining attachments inside the table's corresponding model and then assigning uploaded files (from your forms) as properties (named after the attachments) on the model before saving it. Stapler will listen to the life cycle callbacks of the model (after save, before delete, and after delete) and handle the file accordingly. In essence, this allows uploaded files to be treated just like any other property on the model; stapler will abstract away all of the file processing, storage, etc so you can focus on the rest of your project without having to worry about where your files are at or how to retrieve them.
Key Benefits
- Modern: Stapler runs on top of php >= 5.4 and takes advantage of many of the new features provided by modern php (traits, callable typehinting, etc).
- Simple: Traditionally, file uploading has been known to be an arduous task; Stapler reduces much of the boilerplate required throughout this process. Seriously, Stapler makes it dead simple to get up and running with file uploads (of any type).
- Flexible: Stapler provides an extremely flexible cascading configuration; files can be configured for storage locally or via AWS S3 by changing only a single configuration option.
- Scalable: Storing your assets in a central location (such as S3) allows your files to be accessable by multiple web instances from a single location.
- Powerful: Stapler makes use of modern object oriented programming patterns in order to provide a rock solid architecture for file uploading. It's trait-based driver system provides the potential for it to work across multiple ORMS (both Active Record and Data Mapper implementations) that implement life cycle callbacks.
Documentation
hollogram/stapler2 适用场景与选型建议
hollogram/stapler2 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 316 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 02 月 12 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「orm」 「file」 「s3」 「upload」 「aws」 「paperclip」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 hollogram/stapler2 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 hollogram/stapler2 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 hollogram/stapler2 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Kinikit - PHP Application development framework MVC component
The file manager intended for using Laravel with CKEditor / TinyMCE / Colorbox
PHP Database ORM for Symfony1. Do NOT use for new projects: please move to a newest Symfony release and Doctrine2
Laravel Media Popup to upload/view the files
PeskyORM - annoying ORM that contains tons of exceptions and throws them when anything goes wrong
PMVC Plugin for File information
统计信息
- 总下载量: 316
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-02-12