Composer package development

When developing a composer package locally, you sometimes need to test the package in an actual project, if only to make sure that the package installs correctly. The package itself probably works fine (you write tests don’t you?) but adding it to another project may reveal issues or you simply need resources to be in place, e.g. when creating a Symfony Bundle. To set the development package up in your composer.json file add this:

Then once this is done you can do a composer require:

This will create a symlink in vendor/my to the directory set in the “url” and points to the branch name of your local repository.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.