Skip to content

Rewrite linking engine #235

@xepozz

Description

@xepozz

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions