DEV Community

Dimitrios Desyllas
Dimitrios Desyllas

Posted on

How I can apply a patch to specific files depending the installed version of a composer dependency

In my php projects I want to develop and apply patches relatively fast.

Therefore I want to use this approach:

In my case I want once I do:

composer install

After the dependencies being downloaded to replace some files in vendor based upon a json names hotpatch.json and will have theese entries:


{
  "my_dependency":{
     "v1.1":[
          {
            "original":"./vendor/my_dependency/app/Myclass.php"
            "replacement":"./hotpatch/my_dependency/app/v1/Myclass.php"
          }
     ]
  }
}

Or in case a php version and extention…

Is there a way to do this?

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more