wolnosciowiec/file-repository-bundle

此包已被弃用且不再维护。没有建议替代包。

提供连接到 `wolnosciowiec/image-repository` 服务器的接口

v2.1.0.1b 2018-02-13 19:10 UTC

This package is not auto-updated.

Last update: 2020-09-18 21:21:24 UTC


README

Build Status Coverage Status

这是一个 Symfony 扩展包,提供文件存储接口并处理错误。文件存储允许将静态文件存储在成本最低的存储上(例如每月1美元)。文件存储的责任是重新分配文件,处理识别和验证,去重,以便主应用程序只需发送最小数量的文件,并在必要时删除它们。

要求

  • Symfony

设置

  1. 注册扩展包
new Wolnosciowiec\FileRepositoryBundle\FileRepositoryBundle(),
  1. 在配置步骤中,您需要输入服务器地址、秘密令牌和缓存类名称

配置

    file_repository:
        cache_class: "Doctrine\\Common\\Cache\\VoidCache"
        url: "https://image-repository-test.herokuapp.com"
        token: "api-key-here-for-external-remote-control"

示例用法

// upload an image to the file repository
// the repository handles itself de-duplication, so we don't need to take care of it
// in the application
$this->uploader->uploadFromUrl($event->getBackgroundImage());