I have a main php project that needs a php component developed by me, that i intend to reuse in other projects, the component is in the main project vendor directory. However pushing to Github the component, go to the main project, running composer update is time consuming. In order to speed up the development of the component, is there a way to include the local component project into the main project?
This is how I do local composer package development.
vendor-repo
folder next to the vendor folder.vendor-repo/vendorname/packagename
packagename
folder and build your composer package complete with composer.json
etc.composer.json
(the one that requires your package). You can also disable the packagist repo by adding the "packagist": false
as per the example below. This will speed things up and is a good idea if you aren't using any packages from packagist."repositories": [
{
"type": "path",
"url": "vendor-repo/vendorname/packagename"
},
{
"packagist": false
}
]
Then when you run composer update
it will get your package from your local repo rather than needing to get it from GitHub.