A
A
Alexey Volegov2015-07-01 09:04:56
Yii
Alexey Volegov, 2015-07-01 09:04:56

How to organize a portable package?

Hello. An interesting question arose.
For several projects, I made a library that extends yii2 which I connect via composer. I also wrapped the library itself in git, and now when I edit its files in the project, I see the git of the project itself and the git of my package separately. As long as it works within the framework of one project, everything is fine and predictable.
But now I have launched 2 more projects and in each of them my library is already working as a composer package. If I make changes to this library, then they do not get into git accordingly. How to be in such a situation? And what about the fact that if new changes get from one project to the git library, then all other projects must be firmly fixed on the old version and not updated to the latest version without the necessary requirement.
1. How to organize a library connected via composer into 3+ projects and commit changes from any project?
2. How to limit the package version for a project?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
matperez, 2015-07-01
@matperez

Basically, you need to separate changing the library and connecting it to other projects via composer. Those. Committing changes "from any project" will not work, only directly to the library and then pulling updates to the current project.
If you want to fix the version of the library in this project, when describing a private turnip in composer.json, you can specify the revision number or branch (via the reference attribute)

"source": {
              "url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
              "type": "git",
              "reference":"master"
            }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question