Revolution: Refactor modMediaSource for composer Amazon S3 support

Created on 20 Nov 2017  路  6Comments  路  Source: modxcms/revolution

Summary/Task

Refactor modMediaSource, modFileMediaSource and modS3MediaSource to use Flysystem. Flysystem abstracts the S3 to allow MODX to only focus on configuration and implementation. Additionally allow MODX to easily use any of the following: Azure, Copy.com, DigitalOcean Spaces, Dropbox, FTP, GridFS, Memory, Rackspace, ReplicateAdapter, SFTP, WebDAV, PHPCR, ZipArchive or write your own adapter.

Step to reproduce

N/A

Observed behavior

Legacy AWS S3 code must be updated to use composer.

Expected behavior

Keep the modMediaSourceInterface class as close as possible to avoid breaking ExtJS. Potential effected files:

  • core/model/modx/processors/browser
  • core/model/modx/processors/source
  • core/model/modx/sources - major refactor will happen here, contains the xPDO DB objects and ACL related perms
  • core/model/schema/modx.sources.*
  • core/model/modx/modcachemanager.class.php
  • core/model/modx/processors/system/phpthumb.class.php
  • core/model/modx/modtemplatevar.class.php
  • manager/controllers/default/system/file/*
  • _build/data/transport.core.media_sources.php
  • _build/test/Tests/Model/Sources/modMediaSourceTest.php
  • _build/test/Tests/Model/Sources/modFileMediaSourceTest.php
  • setup/includes/upgrade/common/2.2-media-sources.php
  • setup/includes/upgrade/mysql/2.2.0-rc1.php
  • setup/includes/upgrade/sqlsrv/2.2.0-rc1.php

Environment

MODX 3.0+ version

Most helpful comment

FYI I will be working on a PR for this soon.

All 6 comments

FYI I will be working on a PR for this soon.

That will be great! I was able to get an sftp source that could actually connect and list files, but every example I looked at was done so differently that it never got any further.

I would like to use visibility instead of chmod, any objections? Would only be public or private.

In the case of a local filesystem, visibility would be an abstraction over the top of file permissions I assume? What's the main benefit? To simplify it?

@digitalpenguin

Visibility is the abstraction of file permissions across multiple platforms. Visibility can be either public or private.

I think the reason is that nearly no adapters have something that can compare to chmod, except traditional file systems.

Done in 3.0

Was this page helpful?
0 / 5 - 0 ratings