Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite linking engine #235

Open
xepozz opened this issue Oct 1, 2022 · 1 comment
Open

Rewrite linking engine #235

xepozz opened this issue Oct 1, 2022 · 1 comment

Comments

@xepozz
Copy link
Member

xepozz commented Oct 1, 2022

I've made some research how to decrease linking customisation.

Composer already support linking but it makes us add the repositories section into each package and handle it in the right way if we use or not yii-dev-tool. So basically we can create a plugin that will add the repositories section at runtime and link packages if they are present locally.
I've developed this plugin and it works easy:

  1. At installation step it collects each packages that the composer.json contains in addition to they versions.
  2. Registers "in-memory repository" that will provide that packages, but refer to their local versions.

The rest process is the same as we added the repositories section into composer.json.

The installation process is also easy:

  1. composer req yiisoft/yii-dev-tool-installer. It's is not registered in packagist.org and you may face with error.
  2. Allow it in composer.json config.allow-plugins section:
    "config": {
         "allow-plugins": {
             "yiisoft/yii-dev-tool-installer": true
         }
     }

Here is the plugin: https://github.com/xepozz/yii-dev-tool-installer/blob/master/src/InstallerPlugin.php.

Advantages:

  1. It works better that our mechanism of linking packages
  2. It works faster because of the overhead as linking packages after downloading originals
  3. It follows all package installations' instructions and also autoloading processes.

@yiisoft/yii3 I'd like to hear your opinions.

@arogachev
Copy link
Contributor

I like this idea. Looks more efficient. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants