K
K
Khaybulla Musaev2016-02-29 12:20:26
PHP
Khaybulla Musaev, 2016-02-29 12:20:26

What to do when a third-party library loaded via composer needs to be customized?

Guys, the alignment is this - I connected several libraries through composer. The form validation library had to be filed for itself, since it is foreign and did not work with Russian characters. It turns out that now if someone wants to deploy my project with the composer update command, then the library will be loaded into the vendor folder without my edits, of course.
Here I have several options. Upload the library to yourself on github and connect it from there. Or just delete the composer file and run the project with a bunch of third-party libraries.
In general, it is clear that the developer community has developed some kind of working solution regarding this situation. Therefore, I ask those who know to share their experience of what you do in similar situations.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stanislav Pochepko, 2016-02-29
@DJZT

Fork the library project. Make edits. Push to your fork. And then connect it in the composer from your account. You must specify

"repositories": [
        {
            "url": "https://github.com/ВашАккНаГитхабе/РепоНаВашемАккаунте.git",
            "type": "git"
        }
    ],

"license": "MIT",
    "type": "project",

    "repositories": [
        {
            "url": "https://github.com/ВашАккНаГитхабе/admin.git",
            "type": "git"
        }
    ],
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.2.*",
        "sleeping-owl/admin": "dev-НазваниеВашейВеткиФорка",
        "laravelcollective/html": "5.2.*",
        "cartalyst/sentinel": "2.0.*"

    },

Implementation example taken from this article. Works Article

A
Alexey Nikolaev, 2016-02-29
@Heian

If the library is written, as they say, developer-friendly, and it has the ability to connect using filters / changing parameters / configuration - whatever, I use these features. If not, I throw out kaku and never use it again: editing directly in the library is very bad , because even you yourself can forget in a year what you have changed there, and perform an update, overwriting all the changes.

M
Mikhail Osher, 2016-02-29
@miraage

fork

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question