Problem/Motivation

twistor/flysystem-stream-wrapper has been abandoned, so we should look for a different package with support for Flysystem 2 & 3.

Some options:
elazar/flystream
m2mtech/flysystem-stream-wrapper

Remaining tasks

  • Add library
  • Add some unit tests to verify the integration

Issue fork flysystem-3227240

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mglaman created an issue. See original summary.

benjifisher’s picture

Status: Active » Postponed
Related issues: +#3227239: 3.0.x has invalid composer.json, cannot be installed

I think the correct status for this issue is Postponed.

bradjones1’s picture

Status: Postponed » Active
dieterholvoet’s picture

Title: Use elazar/flystream for stream wrapper support » Use a different package for stream wrapper support
Issue summary: View changes
Related issues: -#3227239: 3.0.x has invalid composer.json, cannot be installed +#3196064: Create the abstract class Flysystem StreamWrapper

Another option is m2mtech/flysystem-stream-wrapper, it's a fork of the twistor/flysystem-stream-wrapper package we're currently using and seems to have more downloads on Packagist.

lisa.rae’s picture

Version: 3.0.x-dev » 2.1.x-dev

Switching this for 2.1.x branch, let's apply there and work toward a total replacement using the updated Flysystem V3 for 3.0.x

lisa.rae’s picture

Assigned: Unassigned » lisa.rae
lisa.rae’s picture

Assigned: lisa.rae » Unassigned
Status: Active » Needs review
Issue tags: +PHP 8.1, +Drupal 10 compatibility

Unfortunately just switching out the dependency is not an option without significant refactoring because ` m2mtech/flysystem-stream-wrapper` is a complete rewrite of `twistor/flysystem-stream-wrapper` with multiple change to the API.

Attached is a patch to port the code for the third party libraries that are dependencies for this module, effectively:

* twistor/flysystem-stream-wrapper
* league/flysystem
* league/flysystem-replicate-adapter

And remediating the ported code for PHP 8.1 compliance and D10 compliance.

Would love to be able to go back to utilizing external libraries, as this adds alot of additional code to maintain, and I'm not yet convinced the test coverage is here to support the ported code (I did also port several of the tests, but may have missed some).

It's a good starting point. Failing tests have been remediated, but ported code is not Drupal coding standards compliant..

lisa.rae’s picture

Priority: Normal » Critical
dieterholvoet’s picture

I'm not sure copying the code of those libraries to this module is a good solution. We'll have to migrate to Flysystem V2 or V3 at some point, might as well do it now, right?

lisa.rae’s picture

Oh, I agree, I'm looking to get the 2.1 branch stable for D10, then start working on the 3.0.x branch and using either Flysystem v2 or v3. That will be a breaking change because the APIs on V2 and V3 changed significantly from V1, with alot of refactoring along the way to eliminate the dependencies on abandoned third party packages.

dieterholvoet’s picture

Okay, makes sense.

lisa.rae’s picture

Ran a code coverage report after applying this patch:

* Code Coverage for the original module code (not ported) is very good, exceeding 90%.

More test coverage could be used:

Drupal\flysystem\EventSubscriber\EnsureSubscriber
  Methods:  66.67% ( 2/ 3)   Lines:  92.31% ( 12/ 13)
Drupal\flysystem\Asset\CssCollectionOptimizer
  Methods:   0.00% ( 0/ 1)   Lines:  83.33% ( 10/ 12)
Drupal\flysystem\Asset\JsCollectionOptimizer
  Methods:   0.00% ( 0/ 1)   Lines:  83.33% ( 10/ 12)

For the Optimizers, the original maintainer extended Drupal Core classes instead of implementing Interfaces, so these statistics may be misleading, as test coverage may exist in Drupal Core for Methods that are part of the parent class.

At this time, I'm not going to port all of the tests for the ported code, primarily because the goal is to stabilize the module for D10, and focus on a rewrite for a new major version release using league/flysystem v2 or v3.

I'm going to merge this patch in "As Is" to the dev branch, but hold off for a bit on generating another release until this has had some time to percolate a bit.

Same with Coding Standards compliance for the ported code. Would rather focus time and energy on v3.0. However if someone wants to tackle coding standards, I'll accept patches!

  • lhridley committed cdc72cc4 on 2.1.x
    Issue #3227240: Use a different package for stream wrapper support
    
lisa.rae’s picture

Status: Needs review » Fixed
dieterholvoet’s picture

Are you sure all this is actually necessary? Because I have a project which is running Drupal 10.1.1, PHP 8.1 and Flysystem 2.1.0-rc4 and everything is working as expected. The only patches I have applied are these:

twistor/flysystem-stream-wrapper

flysystem

dieterholvoet’s picture

I think it would be enough to fix this on the 3.x branch.

lisa.rae’s picture

Rethinking this one, which is why it's not yet part of a release.

lisa.rae’s picture

Status: Fixed » Needs work
dieterholvoet’s picture

I don't think this issue has anything to do with Drupal 10 / PHP 8.1 compatibility, as far as I know 2.1.0-rc5 is completely D10 compatible, except #3376399: Support new lazy asset collection optimizers & deprecate the serve_* options. This is just about getting rid of an abandoned dependency. Let's remove those tags and change this issue to target 3.x. If this does impact D10/PHP8.1 compatibility, please tell me how and maybe we can figure out another way to fix it.

lisa.rae’s picture

I moved this back to "Needs Work", i have a revert patch running through tests currently, took a bit to make sure that I didn't lose other MRs that had been merged. I'll be updating the 2.1.x-dev branch with the revered code as soon as I get through with my team meetings today, in a couple of hours tops.

  • b07e2fca committed on 2.1.x
    Issue #3227240: Reverting the refactoring associated with eliminiating...
lisa.rae’s picture

Reverted the refactoring while keeping other merged MRs. Closing this issue.

lisa.rae’s picture

Status: Needs work » Closed (outdated)
dieterholvoet’s picture

Why close? This still needs to happen in the 3.0.x branch, right?

lisa.rae’s picture

Version: 2.1.x-dev » 3.0.x-dev
Status: Closed (outdated) » Needs work
Issue tags: -PHP 8.1 +PHP 8.3

Reopening this issue, as it is now relevant to the 3.0.x branch work. Will evaluate to determine what changes may be needed.

lisa.rae’s picture

Status: Needs work » Closed (outdated)

Closing as outdated. See latest 3.0.x dev branch code as of 2026 June 12, which is a complete rewrite of the existing codebase. Notes are in the README.md file as well as the DeveloperNotes.md file.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.