composer-locator icon indicating copy to clipboard operation
composer-locator copied to clipboard

Add support for stream-wrapper

Open mindplay-dk opened this issue 4 years ago • 5 comments

See documentation for the stream-wrapper feature in the README diff below.

Upgraded Symfony dependencies require PHP 7.2: support for older versions (PHP 5.4-7.1) has been removed.

I've proposed this become a built-in Composer feature.

For discussion:

  • Is composer:// an appropriate name for the stream-wrapper? Something like packages:// might be more neutral.

  • Should we alter the local file-stats and prevent opening of files in write-mode? Opening files in the vendor folder in write-mode probably doesn't make a lot of sense, but isn't really a security issue either: you could already locate those files by other means. This would be more of a helpful sanity check to avoid accidental writes.

Try it out:

You can try it out by using a temporary version constraint in your composer.json , such as: dev-stream-wrapper as 1.2.0.

mindplay-dk avatar Feb 07 '21 11:02 mindplay-dk

My thoughts:

  • composer:// is the right choice. Another package manager could emerge?
  • We should prevent opening of files in write-mode.

Edit: I think its a great idea to have a composer stream-wrapper. 👍

cedx avatar Feb 07 '21 19:02 cedx

So I was just made aware that Composer 2.0 actually introduces a standard API for everything this plugin does.

Note that not everything is documented yet - you can find more methods in the source, but it does appear to do everything this package does.

So that leaves the question of whether to make further upgrades to this branch, to enable the stream-wrapper to work with the standard Composer API instead.

I will leave this branch here for the time, but I'm leaning towards archiving the whole package and directing people to the standard API instead, as there's not much argument in favor of doing the stream-wrapper at all, beyond sheer convenience - and not much reason for this package to exist at all.

mindplay-dk avatar Feb 09 '21 15:02 mindplay-dk

Okay, so the Composer API doesn't quite to everything this package does - they're still working on installed package paths.

So this package will live for a little while longer. I'm watching that issue for progress.

mindplay-dk avatar Feb 09 '21 15:02 mindplay-dk

Looks like a PR is in the works. 👀

mindplay-dk avatar Feb 27 '21 09:02 mindplay-dk

The PR has been merged.

mindplay-dk avatar May 24 '21 18:05 mindplay-dk