laravelcomposer-phpsymfony-process

Changing Symfony\Component\Process code in laravel


I have found a problem in the symfony package and I have a very little fix I want to implement. How to change it with my own code and implement it globally in my laravel.


Solution

  • You can fork the package make the changes, and have the composer package point to your version instead of the primary location.

    Here is a quick recap of how to do it:

    // for the require
    // assuming you forked the repo and made the changes on master branch
    require: {
       "symfony/process": "dev-master"
    }
    
    // if you don't have this key simply add it:
    // replace: YOURNAME with your name (this assumes you are using github, any git repo URL will work)
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/YOURNAME/process"
        }
    ]
    
    

    Then simply run: composer update

    Here is a longer guide and explanation:

    https://medium.com/swlh/using-your-own-forks-with-composer-699358db05d9

    Might be worth doing a pull request to the maintainer of the package as well, this way you can simply remove your forked package and simply update when the maintainer updates their version.