There is a project on Yii. Installed several third-party extensions in the vendor folder.

The problem is that during the development process a single coder got into the vendor instead of overriding the classes and methods of the module. I understand that when you run the command: composer update all third-party code for the module will disappear from vendor.

The solution is obvious: rewrite in a normal way. But for the time being we will leave it as it is.

Actually, how to upgrade other packages without touching the affected ones?

    1 answer 1

    You can fix the current installed version of the package, then it will not be updated and the changes will not be lost.

    Example:

     { "name": "The app", "require":{ "monolog/monolog": "1.20.0.0", "phpoffice/phpexcel": "~1.8.0" } } 

    Here, the monolog will not be updated if the current installed version is 1.20.0 (1.20.0.0 normalized version)

    phpoffice will be updated to version <1.9.0

    The currently installed version can be found in the file vendor/composer/installed.json