I have a local dependency which is hosted on a private Gitlab repo. I am however, having difficulty pulling this into my project via Composer.
My composer.json
:
"require": {
"crmpicco/GolfBundle": "dev-master"
},
"repositories": [
{
"type": "package",
"package": {
"name": "crmpicco/GolfBundle",
"version": "dev-master",
"source": {
"url": "https://git.crmpicco.com/rfc1872/golfbundle.git",
"type": "git",
"reference": "master"
},
"autoload": {
"psr-4": {
"crmpicco\\GolfBundle\\": ""
}
}
}
}
],
When I look in the vendor directory the directories are doubled-up when I would not expect that, e.g.
/vendor/crmpicco/GolfBundle/crmpicco/GolfBundle
When I run a composer update crmpicco\GolfBundle
I get the following error when Symfony tries to do a cache:clear:
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when executing the "'cache:clear --no-warmup'" command:
PHP Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted
to load class "crmpiccoGolfBundle from namespace "crmpicco\GolfBundle".
Did you forget a "use" statement for "crmpicco\GolfBundle\crmpiccoGolfBundle"?
in /var/www/crmpicco/symfony/app/AppKernel.php:31
What am I missing/doing wrong in my composer.json
setup?
Bundle dir structure:
/crmpicco
/GolfBundle
/Component
/DependencyInjection
crmpiccoGolfBundle.php
Bundle composer.json:
{
"name": "crmpicco/GolfBundle",
"type": "library",
"description": "A Symfony 2 bundle which provides an easy way to handle billing and subscriptions.",
"license": "MIT",
"require": {
"php": ">=7.0",
"symfony/config": "~2.8.34",
"symfony/dependency-injection": "~2.8.34",
"symfony/http-kernel": "~2.8.34",
},
"autoload": {
"psr-4": {
"crmpicco\\GolfBundle\\": ""
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative"
}
}
composer.json
? – Nikita Leshchevcomposer.json
in my bundle dir. – crmpiccocomposer.json
which belongs to my bundle to the question above. – crmpicco