-
-
Notifications
You must be signed in to change notification settings - Fork 189
Mongo driver shouldn't be dependency #88
Comments
Shouldn't it just warn if the mongo driver isn't installed, but not fail the composer install completely? The requirement is pointless if installing on your local machine, but then serving your project via Vagrant, because each has it's own install of PHP. The latter being the one which needs the requirement. |
This library has a hard dependency on the driver's classes, so it makes sense to require it. Your argument (installing sources on a development machine that will never execute the code) sounds like something worth discussing on the composer mailing list. One possible solution might be having a command line flag to ignore PHP module requirements. Additionally, the version information in composer.json is also helpful for clarifying exactly which versions of the PHP driver are compatible with this library. On a somewhat related note, I spoke to @beberlei about doctrine/dbal requiring PDO in its composer.json file and he admitted that it was probably an oversight, and the dependency should be added. |
@jmikola Wondering if any consideration has been given to this in light of hhvm, which includes the classes that doctrine/mongodb uses but does not seem to pass the extension requisite in composer. |
@stanlemon We would consider it. What is your suggestion? Make the dependency require-dev? It sounds like this should be something that composer solves. |
Personally, I'd rather see this solved in composer. If any other library (and be it hhvm itself) provides the same functionality as ext-mongo, the composer requirement for it should pass, period. As it is now, doctrine/mongodb requires ext-mongo to run, so it should still fail if ext-mongo (or an equivalent) is not present. |
For context, Composer can ignore platform requirements as of October 2014 (this comment):
@stanlemon: Regarding "in light of hhvm, which includes the classes that doctrine/mongodb uses", are you referring to: https://github.com/facebook/hhvm/tree/master/hphp/runtime/ext_zend_compat/mongo. I wasn't aware that any code from the extension was imported into HHVM, but that source appears to be about 2 years old. I initially thought you were referring to mongofill, which I assume most HHVM users may be using at present. That library, which is implemented completely in PHP, happens to provide |
@jmikola Yes, that's what I had in mind. It's possible it's not usable - I confess that Travis was sort of my avenue to explore it as I have a project that uses ODM. This makes me wonder if there would be an easy enough way to add mongofill for hhvm runs in travis just to see how ODM holds up. |
I did just that in bernardphp/bernard#133. The mongofill installation is now handled by tests/travis.sh. |
I use vagrant for development so don't want to be forced to install the mongo driver on my local machine.
The text was updated successfully, but these errors were encountered: