Giter Site home page Giter Site logo

Comments (4)

igorw avatar igorw commented on May 2, 2024

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.

fabpot avatar fabpot commented on May 2, 2024

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.

igorw avatar igorw commented on May 2, 2024

I don't really care where things are installed, I'd be fine with having everything strictly in package dirs. Ping @everzet.

from composer.

Seldaek avatar Seldaek commented on May 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.