A
A
Andrey Surzhikov2016-12-15 22:23:39
PHP
Andrey Surzhikov, 2016-12-15 22:23:39

How to painlessly fix a third party package?

I'm doing a project on Laravel;
One of the packages loaded with Composer from Packagist.org I need to edit. And then upload the project to a Git server. However, the Vendor folder must be in Gitignore.
How is it more logical and correct to make the package that I have corrected loaded by composer install / update?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Aksentiev, 2016-12-15
@Sanasol

1. Fork
2.

"repositories": [
          {
              "type": "vcs",
              "url": "https://github.com/S-anasol/myfork"
          }
    ],

3. composer require "s-anasol/myfork"
4. composer remove "original/package"

V
VovanZ, 2016-12-15
@VovanZ

If this task can be solved by means of OOP, then you need to do this:
1. Derivate from the class that needs to be edited
2. Redefine the necessary methods in it with your own, corrected versions.
3. Slip your class everywhere instead of the original one.

H
he he, 2016-12-15
@tosha_lol_daaa

If the package is public (and this is most likely the case, i.e. free) - fix it and add it to the package manager, while downloading your own package.
Or, "forcibly" throw the vendor folder with this package.
Ps: there may be another (more reasonable) solution.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question