Comments (4)
For this reason we already do have a target-dir
property that can be set. This is the same as the originally proposed "installAs". It allows you to specify where the package is installed.
For bundles:
{
"name": "fos/rest-bundle",
"type": "symfony-bundle",
"target-dir": "FOS/RestBundle",
"autoload": {
"FOS\\RestBundle": "."
}
}
This will install the package into vendor/bundles/FOS/RestBundle
and set the autoloader to point to vendor/bundles.
For components:
{
"name": "symfony/console",
"target-dir": "symfony/src/Symfony/Component/Console",
"autoload": {
"Symfony\\Component\\Console": "symfony/src"
}
}
Will install into vendor/symfony/src/Symfony/Component/Console
and point the autoloader to vendor/symfony/src
.
Basically, if a target-dir
is provided, the target-dir
is relative to the main install dir (like vendor
or vendor/bundles
), if none is provided, it's relative to where the package is installed (e.g. vendor/monolog/monolog
).
from composer.
Thanks for the info.
But why things are installed relative to the main install dir when using target-dir
? It's not consistent and I really like the fact that an installed library is always installed under its name. That way, no conflict is ever possible.
from composer.
I don't really care where things are installed, I'd be fine with having everything strictly in package dirs. Ping @everzet.
from composer.
Yeah I am with @fabpot on this one. I didn't care enough to spend hours arguing it back then, but I prefer complete isolation of packages as well.
As for supporting one namespace in multiple dirs. It is already possible, but I don't think it's necessary in this case? Do you have an example?
from composer.
Related Issues (20)
- `--ignore` option in `composer show -o` could work with asterisk pattern
- Composer prefer lowest does not stop running HOT 7
- getcomposer.org/installer fails this morning (with output) HOT 17
- Composer Installer producing PHP error HOT 4
- Error when running composer-setup.php HOT 12
- Document Plugin API version bump HOT 3
- Composer 2.7.0 usage with root user leads to plugins not being loaded HOT 24
- Composer 2.7.0 breaks PHP Stan HOT 6
- Composer 2.7.x returns code 5 even if security audit passes HOT 1
- NeedsSudoCheck docker detection not working with Docker Buildx HOT 12
- unset autoload-dev.classmap via cli command
- Unable to Create "web" Directory for Drupal Projects in Docker with Composer 2.7.0 #11853 HOT 13
- Support for `safe.bareRepository explicit` Git config HOT 1
- ERROR: /packages.json: URL using bad/illegal format or missing URL when creating a new Docker/Laravel project HOT 3
- [ErrorException] Undefined array key "uid" when requiring package from artifactory HOT 2
- --ignore does not ignore package HOT 13
- Inconsistency in `Filesystem::ensureDirectoryExists` HOT 8
- Stand with Palestine against the occupation HOT 1
- Every time I execute dump-autoload οΌit has a zombie process HOT 2
- Socialite installation will have the default packages removed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from composer.