Skip to content

build: make the S3, SFTP and WebDAV drivers optional packages - #4

Merged
elcreator merged 1 commit into
fix-mount-destinationsfrom
optional-drivers
Nov 15, 2026
Merged

elcreator merged 1 commit into
fix-mount-destinationsfrom
optional-drivers

Conversation

@elcreator

Copy link
Copy Markdown
Owner

Stacked on #3, which sets the SFTP ^3.36 minimum that conflict takes over here. Merge #3 first; GitHub then retargets this PR to main.

Only the local folder driver is needed by every installation, yet every site installed the AWS SDK (77 MB), phpseclib (3.2 MB) and sabre/dav (3.5 MB). Their Flysystem adapters were referenced only inside their own drivers, and Driver::available() already reports a missing package with its install command, so they move from require to suggest, like the other drivers.

composer.json

  • require keeps only league/flysystem, which the core services use outside the drivers, and gains league/flysystem-local. The local driver needs it, but until now only the core's own dependencies happened to bring it in.
  • suggest: league/flysystem-aws-s3-v3, league/flysystem-sftp-v3, league/flysystem-webdav.
  • conflict keeps the minimum versions when these packages are installed: S3 <3.10, SFTP <3.36, WebDAV <3.6. Below 3.36, SFTP accepts neither several pinned keys nor the SHA256: form.

Builds keep the three drivers

  • PLUGIN_EXTRAS in ci/plugin.env is installed next to the plugin by compose-evo.sh, so the unit suite, the demo stack and the published zip and images still ship S3, SFTP and WebDAV. Setting PLUGIN_EXTRAS= builds the bare plugin. Both scripts are changed generically, with an empty default, so they can still be copied to the other plugin repositories.
  • smoke.sh checks that the extras are present.
  • amount:demo --s3 skips with the install command when S3 is missing, instead of failing.

Upgrade note (breaking for existing sites)

On composer update, Composer removes the three packages if nothing else requires them. Mounts using them then report the install command instead of connecting. The README says how to install them, with one package:installrequire call per package, because the command takes a single package.

Tests

  • New PackagesTest: it fails if any of the following drifts:
    • require holding more than flysystem and flysystem-local;
    • a driver package declared nowhere (packages the CMS core brings, such as guzzle, count as declared);
    • the conflict minimums;
    • PLUGIN_EXTRAS versus suggest.
  • Unit: 284 passed, 7 skipped, in a build with the extras.
  • Bare build (PLUGIN_EXTRAS=, --install): no aws, sabre or phpseclib in vendor. Migrations, tables and permissions are in place, and the site answers 200. amount:drivers lists S3, SFTP and WebDAV as missing, with their install commands.

🤖 Generated with Claude Code

Only the local folder driver is needed by every installation, yet the AWS SDK
(77 MB), phpseclib and sabre/dav were installed on every site. Their adapters
move from require to suggest, like the other drivers; Driver::available()
already reports a missing one with its install command. "conflict" keeps the
minimum versions when they are installed (SFTP <3.36 would break host-key
pinning). league/flysystem-local, which the local driver needs and only the
core's dependencies happened to bring, is now required.

The builds keep these drivers: ci/plugin.env PLUGIN_EXTRAS is installed next to
the plugin (tests, demo, zip, images; empty builds the bare plugin) and the
smoke test checks it. amount:demo --s3 skips with the install command when S3
is missing. Upgrading sites lose the three drivers on composer update unless
they install them; the README says so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@elcreator
elcreator merged commit 1daefc2 into fix-mount-destinations Nov 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant