How do I have do modify my composer.json to install directly into the src-dir (Symfony/src)?
{
"name": "acme/example-bundle",
"type": "symfony-bundle",
"license": "MIT",
"require": {
"php": ">=5.3.2",
"symfony/framework-bundle": "2.1.*"
},
"suggest": {
"doctrine/doctrine-bundle": "*"
},
"autoload": {
"psr-0": { "Acme": "src/" }
},
"target-dir": "../../src/Acme/ExampleBundle"
}
actually it's not a good idea to install vendor packages to the src dir because vendor packages should not be edited and the src directory is meant for code that is edited in the development process.
one reason that comes to my mind is that you want do modify these packages. if this is the point, you'd better be off using git submodules because composer only has a one way flow, meaning changes can only come from the source of the vendor package and there is no upstream to the source.
i use git submodules for the bundles in my projects that are not project specific and thus reside in their own git repository but are actively developed during in the project.
The src directory of a PHP/Symfony project is typically used only for the code of that project. Code you install as a dependency goes into the vendor directory.
This makes it easy to keep track of which code is part of the project itself and which code is maintained in a separate repository.
As such you should not install a bundle from a separate repository into your src directory. Bundles in Symfony work just fine if they are located in the vendor directory just like many of the core framework bundles.
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