2
I am designing a relatively large project in my company that consists of several packages in PHP. Some of these packages are normal packages and others are Bundles of Symfony applications.
When we work with Composer, we usually name a dependency the branch or version to use - however, this dependency usually has to be on Github and listed in Packagist. (this is the normal flow, although there are alternatives)
In my case, I still don’t want to have to commit any code, so the dependencies need to be local directories. I’ve already set the file composer.json
of dependency so:
{
"name": "rodrigorigotti/shared"
"autoload": {
"psr-0": {
"RodrigoRigotti": "src/"
}
}
}
And the project that contains this dependency is with the composer.json
that way:
{
"name": "rodrigorigotti/app",
"repositories": [
{
"type": "vcs",
"url": "/var/www/rodrigorigotti/shared"
}
],
"require": {
"php": ">=5.3.3",
"symfony/symfony": "~2.4",
"rodrigorigotti/shared": "*"
},
"autoload": {
"psr-0": { "": "src/" }
},
}
(note: the files composer.json
are WELL simplified for the purpose of the question)
However, when rotating the command composer install
or composer update
in the application that has the dependency, I have received this error:
[InvalidArgumentException]
No driver found to handle VCS repository /var/www/rodrigorigotti/shared
Does anyone know how to solve?
I use Satis to manage these packages: https://blog.adlermedrado.com.br/configurando-um-reposit%C3%B3rio-privado-usando-Composer-e-satis-f7a32fd4f804#. ou1oep27y adds the repository to Composer and use it normally as if it were in packagist. Some additional settings in Composer may be required such as: "config": { "Secure-http": false, "disable-tls": true }, if Satis is not on a server using https
– Sileno Brito