in my project i need to use two versions of twitter bootstrap (v2.x and v3.x) 2 for the backend and 3 for the frontend. is it somehow possible to require both and tell composer to install them in different directoreies?
something like that:
{
"name": "acme/hello-world",
"require": {
"twitter/bootstrap": "2.3.*",
"twitter/bootstrap": "3.0.* as 'twitter/bootstrap3'"
}
}
If you want you can overwrite the namespace inside loader object. Not exactly having two version at the same time. But maybe you want to use an other version somewhere in your scripts.
$reflection = new \ReflectionClass(\Composer\Autoload\ClassLoader::class);
$vendorDir = dirname(dirname($reflection->getFileName()));
$loader->set('Company\\Classname\\', $vendorDir.'/composer/../Other_company/OrOtherClassname/src');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With