Modify files in /vendor directory and commit changes to composer.lock?

怎甘沉沦 提交于 2019-12-22 08:55:39

问题


I had to modify a vendor package (avatarguru/mustache-l5), which was not compatible with the latest version of Laravel 5 (dev) framework. But now when I do composer status in the project's root directory, it shows No local changes. I also tried to modify some other packages - same thing...

How do I commit that changes to composer.lock, so that other developers will not have to fix same packages again?


回答1:


You should fork the package, create a custom repo with your changes - then include that in your composer.json.

{
    "repositories": [ {
            "type": "vcs",
            "url": "https://github.com/YourGithubUsername/PackageName"
         }
    }],
    "require": {
        "laravel/framework": "4.0.*",
        "OriginalVendor/PackageName": "1.0.*"
    },
}

That way you can pull your custom changes in anytime, without having to commit it to your specific project.

You can read more about forking and loading packages here: https://getcomposer.org/doc/05-repositories.md#vcs



来源:https://stackoverflow.com/questions/28136043/modify-files-in-vendor-directory-and-commit-changes-to-composer-lock

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!