Skip to content
This repository was archived by the owner on Nov 11, 2020. It is now read-only.

Mongo driver shouldn't be dependency #88

Closed
colinmeinke opened this issue Dec 17, 2012 · 8 comments
Closed

Mongo driver shouldn't be dependency #88

colinmeinke opened this issue Dec 17, 2012 · 8 comments

Comments

@colinmeinke
Copy link

I use vagrant for development so don't want to be forced to install the mongo driver on my local machine.

Problem 1
    - Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb dev-    master.
    - doctrine/mongodb dev-master requires ext-mongo * -> the requested PHP extension mongo is missing from your system.
  Problem 2
    - Installation request for doctrine/mongodb 1.0.x-dev -> satisfiable by doctrine/mongodb 1.0.x-dev.
    - doctrine/mongodb 1.0.x-dev requires ext-mongo * -> the requested PHP extension mongo is missing from your system.
  Problem 3
    - doctrine/mongodb 1.0.x-dev requires ext-mongo * -> the requested PHP extension mongo is missing from your system.
    - iampersistent/mongodb-acl-bundle dev-master requires doctrine/mongodb 1.0.x-dev -> satisfiable by doctrine/mongodb 1.0.x-dev.
    - Installation request for iampersistent/mongodb-acl-bundle dev-master -> satisfiable by iampersistent/mongodb-acl-bundle dev-master
@davidwinter
Copy link

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.

@jmikola
Copy link
Member

jmikola commented Dec 17, 2012

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.

@stanlemon
Copy link

@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.

@jwage
Copy link
Member

jwage commented Apr 7, 2015

@stanlemon We would consider it. What is your suggestion? Make the dependency require-dev? It sounds like this should be something that composer solves.

@alcaeus
Copy link
Member

alcaeus commented Apr 7, 2015

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.

@jmikola
Copy link
Member

jmikola commented Apr 7, 2015

For context, Composer can ignore platform requirements as of October 2014 (this comment):

Latest composer now has --ignore-platform-reqs in update and install to ignore php, hhvm and ext-* requirements.

@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 ext-mongo and satisfy Doctrine MongoDB's Composer dependency.

@stanlemon
Copy link

@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.

@jmikola
Copy link
Member

jmikola commented Apr 8, 2015

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants