Skip to content

Support Flysystem 3 with Glide#5551

Merged
jasonvarga merged 12 commits into
3.3from
fix/image-generator
Mar 17, 2022
Merged

Support Flysystem 3 with Glide#5551
jasonvarga merged 12 commits into
3.3from
fix/image-generator

Conversation

@jasonvarga

Copy link
Copy Markdown
Member

Fixes #5358

When using Glide to point to a non-asset there would be errors because there was still Flysystem v1 specific code.

A non-asset meaning either:

  1. a relative path to somewhere in your public directory
  2. an external URL

For the public directory stuff, we use Laravel's on-demand disks pointing to the public directory. This pushes the Flysystem-specific code off to Laravel, which already handles both versions. This method wasn't available when we supported Laravel 6/7.

For the external url stuff I've added Flysystem v3 compatible version of the Guzzle adapter. It doesn't do everything an adapter should do, but has enough for our use case.

@jasonvarga jasonvarga marked this pull request as ready for review March 17, 2022 18:29
@jasonvarga jasonvarga merged commit 14b5939 into 3.3 Mar 17, 2022
@jasonvarga jasonvarga deleted the fix/image-generator branch March 17, 2022 18:48
jasonvarga added a commit that referenced this pull request Jul 2, 2026
mimeType(), lastModified(), fileSize(), listContents(), and
visibility() were empty stubs that always crashed with a TypeError
(no code path satisfies their strict return types). They had real
HEAD-request-based implementations before the Flysystem v1->v3
migration (#5551), but were converted to stubs during that migration
and never ported forward - the underlying head() request
infrastructure this class still has today was left unused for these
methods.

Confirmed unreachable in Statamic's current usage (Glide skips
validation for remote URLs; nothing in Flysystem's internals calls
these for this adapter), so there's no working behavior to restore.
Instead, throw Flysystem's own UnableToRetrieveMetadata/
UnableToListContents exceptions - the same contract other Flysystem
adapters use to signal a genuinely unsupported operation, rather than
crashing with a raw TypeError.
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.

3.3 beta – AdapterInterface not found

1 participant