A
A
Artyom Starchenko2014-06-23 02:50:23
symfony
Artyom Starchenko, 2014-06-23 02:50:23

Is it possible to merge Symfony components installed via composer?

I started using the Silex microframework and, obviously, I need to add Symfony packages to it. After adding the dependencies to composer and running install, the directory tree looked something like this:
42f687ee18d3407084c5e01ed156685b.png
This raises the question of whether Symfony/Components can be made a common parent for all installed packages. For example something like this:

vendor
   |- Symfony
      |- Components
          |- Config
          |- Console
          |- Debug
          .......

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Zelenin, 2014-06-23
@Starche

no, they are different composer packages

S
svscorp, 2014-06-26
@svscorp

Different composer packages of one vendor are stacked in that vendor's folder. Not for nothing they have the format: vendorName /packageName
Here is my composer.json of my Silex project:

{
    "require": {
        "silex/silex": "~1.2",
        "smarty/smarty": "dev-trunk",
        "cboden/Ratchet": "0.3.*",
        "react/zmq": "0.2.*",
        "doctrine/mongodb-odm": "1.0.0-BETA10",
        "neutron/mongo-odm-silex-provider": "*",
        "symfony/console": "2.6.*@dev"
    },
    "autoload": {
        "psr-0": {
            "Acme": "src/"
        }
    }
}

Here is the contents of the vendor folder after running the php composer.phar update command :
[email protected]:/var/www/silex$ ls vendor/
autoload.php  cboden  composer  doctrine  evenement  guzzle  neutron  pimple  psr  react  silex  smarty  symfony

Here is the contents of the symfony folder :
As you can see from here, the console package ended up in the symfony vendor folder . And it didn't get into Component , because is not a component of the symfony package =)
I.e.:
* HTTPFoundation is a component of the vendor's symfony package symfony (symfony/symfony)
* config or console is the vendor's symfony package
I.e. config could be in vendor/symfony/symfony/src/Symfony/Component/ if it were a component of the symfony/symfony package. But it is a separate symfony package.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question