ezsystems/ezdfs-fsbackend-dispatcher 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ezsystems/ezdfs-fsbackend-dispatcher

Composer 安装命令:

composer require ezsystems/ezdfs-fsbackend-dispatcher

包简介

eZ Publish Dispatcher DFS backend

README 文档

README

What is it ?

This extension by itself won't provide any new end-user feature.

This extension provides a custom DFSBackend that dispatches calls to any DFS backend to a backend from a custom list, based on the path of the file.

It makes it possible to store some storage subdirectories to custom handlers, such as a cloud based one.

Actual handlers

An AWS-S3 handler, that stores binary files to Amazon S3, is available: http://github.com/ezsystems/ezdfs-fsbackend-aws-s3.

Requirements

  • eZ Publish master (5.4.0-dev or 2014.05).
  • eZ DFS configured (NFS itself doesn't matter, a local directory will work just as fine)

Installation

Using composer

It can be installed via composer from eZ Publish, new stack or legacy:

composer require "ezsystems/ezdfs-fsbackend-dispatcher:~1.0@beta"

Or by adding "ezsystems/ezdfs-fsbackend-dispatcher": "~1.0@beta" to your project's composer.json.

Configuration

Due to INI settings loading order limitations, some settings can't be stored into extension INI files but in a global override.

The contents of the settings/file.ini.append.php file must be copied to settings/override/file.ini.append.php, or obviously merged into it, since it should already exist.

Backends are configured by adding their class name to the DFSBackends array in file.ini. This will make the dispatcher send operations on files with a path starting with var/ezdemo_site/storage/images to MyCustomBackend.

PathBackends[var/ezdemo_site/storage/images]=MyCustomBackend

Priority is a simple first-come, first-served. Path that aren't matched by any path in PathBackends are handled by DispatchableDFS.DefaultBackend, by default set to the native eZDFSFileHandlerDFSBackend.

Backends initialization

By default, backends are instanciated with a simple "new $class". But if a backend implements eZDFSFileHandlerDFSFactoryBackendInterface interface, it will be built by calling the static build() method.

If any kind of initialization or injection is required, it can be done in this method.

A typical settings/override/file.ini.append.php with a custom handler enabled would look like this:

[ClusteringSettings]
FileHandler=eZDFSFileHandler

[eZDFSClusteringSettings]
MountPointPath=/media/nfs
DFSBackend=eZDFSFileHandlerDFSDispatcher
DBHost=cluster_server
DBName=db_cluster
DBUser=root
DBPassword=
MetaDataTableNameCache=ezdfsfile_cache

[DispatchableDFS]
DefaultBackend=eZDFSFileHandlerDFSBackend

PathBackends[var/site/storage/images]=MyCustomBackend

Remember that DefaultBackend must be explicitly configured in the global override to be taken into account.

统计信息

  • 总下载量: 10.06k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 8
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 13
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2014-06-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固