定制 netzmacht/contao-flysystem 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

netzmacht/contao-flysystem

最新稳定版本:1.0.0-beta1

Composer 安装命令:

composer require netzmacht/contao-flysystem

包简介

This integrates the flysystem filesystem abstraction into Contao

README 文档

README

Build Status Version License Downloads Contao Community Alliance coding standard

This library integrates the flysystem filesystem abstraction into Contao.

It provides a fully configured filesystem service for TL_ROOT and an adapter for the Dbafs of Contao!

Install

You can install this library using Composer. It requires at least PHP 5.4 and Contao 3.2.

$ php composer.phar require netzmacht/contao-flysystem:~1.0

Features

  • Filesystem abstraction for whole Contao installation
  • Dbafs adapter
  • Metadata caching

Usage

Access to the mount manager and the default file system

<?php

// First get the mount manager to get the file system.
$manager    = $GLOBALS['container']['flysystem.mount-manager'];
$fileSystem = $manager->getFilesystem('local');

// Alternatively use the FlysystemTrait
class MyContentElement
{
   use Netzmacht\Contao\Flysystem\Integration\FlysystemTrait;
   
   protected function compile()
   {
      $fileSystem = $this->getMountManager()->getFilesystem('local');
   }
}

Dbafs file system

For the dbafs filesystem exists an separate filesystem adapter. It allows to fetch files by path or uuid. The meta data is enriched with model details id, uuid, hash, meta, importantPart.

It keeps the dbafs in sync when performing file system actions.

<?php
 
$manager    = $GLOBALS['container']['flysystem.mount-manager'];
$fileSystem = $manager->getFilesystem('dbafs');

// Get file path.
$metadata = $fileSystem->getMetadata('files/path/to/file');

// Get file by binary uuid.
$metadata = $fileSystem->getMetadata($this->multiSRC);

// Get file by binary uuid.
$metadata = $fileSystem->getMetadata(\String::binToUuid($this->multiSRC));

Note: You have to prepend the file path with the upload path as this is the Contao standard. If you try to access a file out of the upload path scope you'll get an RootViolationException.

统计信息

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

GitHub 信息

  • Stars: 1
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0
  • 更新时间: 2015-09-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固