thecodingmachine / mouf

The Mouf PHP framework: an open-source PHP framework providing an easy way to download, install, use and reuse components, with a graphical user interface.
MIT License
54 stars 28 forks source link

Why does installing Mouf install its dependencies again in vendor/mouf/mouf/vendor ? #109

Open stof opened 9 years ago

stof commented 9 years ago

When installing dependencies in Packanalyst, the Mouf dependencies are getting installed again in vendor/mouf/mouf/vendor, leading to duplicated class definitions confusing the IDE (and potentially not even at the same version)

stof commented 9 years ago

If the goal is to install the dependencies necessary for the Mouf admin UI, my suggestion would be to move this admin UI to a separate package, which would be installed as a dev dependency of the project, instead of doing a separate composer installation with duplicate versions of the dependencies

moufmouf commented 9 years ago

Absolutely. The admin UI will ultimately be in a separate package, which will be installed as a dev dependency. This is planned for the next release.

However, I will still need to put dependencies in the vendor/mouf/mouf/vendor directory.

The reason is that the admin UI has a big number of dependencies, and I don't want to bring these dependencies back in the main vendor directory. For instance, the admin UI requires Splash v4 (this is the MVC framework). But in many projects, I'm using a newer version of Splash (v7 that is compatible with PSR-7). If everything was in the same vendor directory, I would have a conflict, and I would not be able to use Mouf in most projects.

I understand this is confusing the IDE. This is mostly an issue with PHPStorm that triggers warnings (Eclipse deals correctly with this issue). I'm not sure if there is a way to write a sort of .phpstormignore file that would automatically exclude some files from the IDE.... that might solve the problem.

stof commented 9 years ago

For instance, the admin UI requires Splash v4 (this is the MVC framework). But in many projects, I'm using a newer version of Splash (v7 that is compatible with PSR-7)

Given that it is a full rewrite of the package as a different MVC framework (using PSR-7 and Zend Stragility instead of Symfony HttpFoundation and HttpKernel), a better solution may be to make it a separate package, so that they can be used in parallel.