Skip to content

Instantly share code, notes, and snippets.

@alcaeus
Created February 25, 2016 06:59
Show Gist options
  • Save alcaeus/c10ef3ce0ff18209de3d to your computer and use it in GitHub Desktop.
Save alcaeus/c10ef3ce0ff18209de3d to your computer and use it in GitHub Desktop.
Tests of different composer.json settings for mongo-php-adapter
$ composer --version
Composer version 1.0.0-alpha11 2015-11-14 16:21:07
{
"type": "package",
"name": "alcaeus/adapter-test",
"require": {
"alcaeus/mongo-php-adapter": "dev-master",
"doctrine/mongodb": "dev-master"
}
}
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
- doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
{
"type": "package",
"name": "alcaeus/adapter-test",
"require": {
"alcaeus/mongo-php-adapter": "dev-composer-provide",
"doctrine/mongodb": "dev-master"
}
}
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
- doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.
{
"type": "package",
"name": "alcaeus/adapter-test",
"replace": {
"ext-mongo": "1.6.12"
},
"require": {
"alcaeus/mongo-php-adapter": "dev-master",
"doctrine/mongodb": "dev-master"
}
}
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
- don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
- Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].
{
"type": "package",
"name": "alcaeus/adapter-test",
"provide": {
"ext-mongo": "1.6.12"
},
"require": {
"alcaeus/mongo-php-adapter": "dev-master",
"doctrine/mongodb": "dev-master"
}
}
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
- don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
- Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].
{
"type": "package",
"name": "alcaeus/adapter-test",
"replace": {
"ext-mongo": "1.6.12"
},
"require": {
"alcaeus/mongo-php-adapter": "dev-composer-provide",
"doctrine/mongodb": "dev-master"
}
}
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing mongodb/mongodb (1.0.0)
Loading from cache
- Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8
- Installing doctrine/lexer (v1.0.1)
Loading from cache
- Installing doctrine/annotations (v1.2.7)
Loading from cache
- Installing doctrine/collections (v1.3.0)
Loading from cache
- Installing doctrine/cache (v1.6.0)
Loading from cache
- Installing doctrine/inflector (v1.1.0)
Loading from cache
- Installing doctrine/common (v2.6.1)
Loading from cache
- Installing doctrine/mongodb (dev-master 293f403)
Cloning 293f4033146667ca61392ba4e67425cb09f949df
doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Writing lock file
Generating autoload files
{
"type": "package",
"name": "alcaeus/adapter-test",
"provide": {
"ext-mongo": "1.6.12"
},
"require": {
"alcaeus/mongo-php-adapter": "dev-composer-provide",
"doctrine/mongodb": "dev-master"
}
}
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
- Installing mongodb/mongodb (1.0.0)
Loading from cache
- Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8
- Installing doctrine/lexer (v1.0.1)
Loading from cache
- Installing doctrine/annotations (v1.2.7)
Loading from cache
- Installing doctrine/collections (v1.3.0)
Loading from cache
- Installing doctrine/cache (v1.6.0)
Loading from cache
- Installing doctrine/inflector (v1.1.0)
Loading from cache
- Installing doctrine/common (v2.6.1)
Loading from cache
- Installing doctrine/mongodb (dev-master 293f403)
Cloning 293f4033146667ca61392ba4e67425cb09f949df
doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Writing lock file
Generating autoload files
@alcaeus
Copy link
Author

alcaeus commented Feb 25, 2016

git clone https://gist.github.com/c10ef3ce0ff18209de3d.git
cd c10ef3ce0ff18209de3d
for f in composer*.json; do echo "$f:"; rm -rf vendor composer.lock; COMPOSER=$f composer install; done

@alcaeus
Copy link
Author

alcaeus commented Feb 25, 2016

Interestingly enough, once I try it with a slightly more recent version of composer, the following happens:

$ composer --version
Composer version 1.0-dev (dc2f201152f37c2563e328531a6af349ac287cce) 2016-02-24 19:54:01

$ for f in composer*.json; do echo "$f:"; rm -rf vendor composer.lock; COMPOSER=$f composer install; done
composer01.json:
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
    - doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.

  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/php.ini
    - /usr/local/etc/php/5.6/conf.d/additional.ini
    - /usr/local/etc/php/5.6/conf.d/ext-intl.ini
    - /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
    - /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
composer02.json:
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
    - doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.

  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/php.ini
    - /usr/local/etc/php/5.6/conf.d/additional.ini
    - /usr/local/etc/php/5.6/conf.d/ext-intl.ini
    - /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
    - /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
composer03.json:
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
    - don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].

composer04.json:
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
    - don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].

composer05.json:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
    - don't install alcaeus/mongo-php-adapter dev-composer-provide|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
    - Installation request for alcaeus/mongo-php-adapter dev-composer-provide -> satisfiable by alcaeus/mongo-php-adapter[dev-composer-provide].

composer06.json:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
  - Installing doctrine/lexer (v1.0.1)
    Downloading: 100%         

  - Installing doctrine/annotations (v1.2.7)
    Downloading: 100%         

  - Installing doctrine/cache (v1.6.0)
    Downloading: 100%         

  - Installing doctrine/collections (v1.3.0)
    Downloading: 100%         

  - Installing doctrine/inflector (v1.1.0)
    Downloading: 100%         

  - Installing mongodb/mongodb (1.0.0)
    Downloading: 100%         

  - Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
    Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8

  - Installing doctrine/common (v2.6.1)
    Downloading: 100%         

  - Installing doctrine/mongodb (dev-master 293f403)
    Cloning 293f4033146667ca61392ba4e67425cb09f949df

doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Generating autoload files

@dzuelke
Copy link

dzuelke commented Feb 25, 2016

$ composer --version
Composer version 1.0-dev (cd21505c8d58499a9b4d38573881cfec49c51ffd) 2016-01-27 13:04:22


$ php $(which composer) show --platform | grep mongo
ext-mongo           1.6.12   The mongo PHP extension
ext-mongodb         1.1.2    The mongodb PHP extension


$ PHP_INI_SCAN_DIR= php -c /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini $(which composer) show --platform | grep mongo
ext-mongodb         1.1.2    The mongodb PHP extension


$ for f in composer*.json; do echo "*** $f with ext-mongo installed:"; COMPOSER=$f php $(which composer) update; rm -rf composer*.lock vendor; echo "*** $f without ext-mongo installed:"; PHP_INI_SCAN_DIR= COMPOSER=$f php -c /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini $(which composer) update; rm -rf composer*.lock vendor; done


*** composer01.json with ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for ext-mongo 1.6.12 -> satisfiable by ext-mongo[1.6.12].
    - don't install alcaeus/mongo-php-adapter dev-master|remove ext-mongo 1.6.12
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].

  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/php.ini
    - /usr/local/etc/php/5.6/conf.d/ext-intl.ini
    - /usr/local/etc/php/5.6/conf.d/ext-mongo.ini
    - /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
    - /usr/local/etc/php/5.6/conf.d/ext-opcache.ini
    - /usr/local/etc/php/5.6/conf.d/ext-pdo_pgsql.ini
    - /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.


*** composer01.json without ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
    - doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.

  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.


*** composer02.json with ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing mongodb/mongodb (1.0.0)
    Loading from cache

  - Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
    Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8

  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing doctrine/annotations (v1.2.7)
    Loading from cache

  - Installing doctrine/collections (v1.3.0)
    Loading from cache

  - Installing doctrine/cache (v1.6.0)
    Loading from cache

  - Installing doctrine/inflector (v1.1.0)
    Loading from cache

  - Installing doctrine/common (v2.6.1)
    Loading from cache

  - Installing doctrine/mongodb (dev-master 293f403)
    Cloning 293f4033146667ca61392ba4e67425cb09f949df

doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Writing lock file
Generating autoload files


*** composer02.json without ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].
    - doctrine/mongodb dev-master requires ext-mongo ^1.5 -> the requested PHP extension mongo is missing from your system.

  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.


*** composer03.json with ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
    - don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].


*** composer03.json without ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
    - don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].


*** composer04.json with ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].
    - doctrine/mongodb dev-master requires ext-mongo ^1.5 -> satisfiable by ext-mongo[1.6.12].
    - don't install alcaeus/mongo-php-adapter dev-master|remove ext-mongo 1.6.12
    - Installation request for doctrine/mongodb dev-master -> satisfiable by doctrine/mongodb[dev-master].

  To enable extensions, verify that they are enabled in those .ini files:
    - /usr/local/etc/php/5.6/php.ini
    - /usr/local/etc/php/5.6/conf.d/ext-intl.ini
    - /usr/local/etc/php/5.6/conf.d/ext-mongo.ini
    - /usr/local/etc/php/5.6/conf.d/ext-mongodb.ini
    - /usr/local/etc/php/5.6/conf.d/ext-opcache.ini
    - /usr/local/etc/php/5.6/conf.d/ext-pdo_pgsql.ini
    - /usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.


*** composer04.json without ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for alcaeus/adapter-test No version set (parsed as 1.0.0) -> satisfiable by alcaeus/adapter-test[No version set (parsed as 1.0.0)].
    - don't install alcaeus/mongo-php-adapter dev-master|remove alcaeus/adapter-test No version set (parsed as 1.0.0)
    - Installation request for alcaeus/mongo-php-adapter dev-master -> satisfiable by alcaeus/mongo-php-adapter[dev-master].


*** composer05.json with ext-mongo installed:
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Loading composer repositories with package information
Updating dependencies (including require-dev)


  [InvalidArgumentException]                    
  Package is not installed: ext-mongo-1.6.12.0  


update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--] [<packages>]...


*** composer05.json without ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing mongodb/mongodb (1.0.0)
    Loading from cache

  - Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
    Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8

  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing doctrine/annotations (v1.2.7)
    Loading from cache

  - Installing doctrine/collections (v1.3.0)
    Loading from cache

  - Installing doctrine/cache (v1.6.0)
    Loading from cache

  - Installing doctrine/inflector (v1.1.0)
    Loading from cache

  - Installing doctrine/common (v2.6.1)
    Loading from cache

  - Installing doctrine/mongodb (dev-master 293f403)
    Cloning 293f4033146667ca61392ba4e67425cb09f949df

doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Writing lock file
Generating autoload files


*** composer06.json with ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing mongodb/mongodb (1.0.0)
    Loading from cache

  - Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
    Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8

  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing doctrine/annotations (v1.2.7)
    Loading from cache

  - Installing doctrine/collections (v1.3.0)
    Loading from cache

  - Installing doctrine/cache (v1.6.0)
    Loading from cache

  - Installing doctrine/inflector (v1.1.0)
    Loading from cache

  - Installing doctrine/common (v2.6.1)
    Loading from cache

  - Installing doctrine/mongodb (dev-master 293f403)
    Cloning 293f4033146667ca61392ba4e67425cb09f949df

doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Writing lock file
Generating autoload files


*** composer06.json without ext-mongo installed:
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing mongodb/mongodb (1.0.0)
    Loading from cache

  - Installing alcaeus/mongo-php-adapter (dev-composer-provide 698d301)
    Cloning 698d3012c306af299491aa166dc9aa29a4bce5b8

  - Installing doctrine/lexer (v1.0.1)
    Loading from cache

  - Installing doctrine/annotations (v1.2.7)
    Loading from cache

  - Installing doctrine/collections (v1.3.0)
    Loading from cache

  - Installing doctrine/cache (v1.6.0)
    Loading from cache

  - Installing doctrine/inflector (v1.1.0)
    Loading from cache

  - Installing doctrine/common (v2.6.1)
    Loading from cache

  - Installing doctrine/mongodb (dev-master 293f403)
    Cloning 293f4033146667ca61392ba4e67425cb09f949df

doctrine/mongodb suggests installing jmikola/geojson (Support GeoJSON geometry objects in 2dsphere queries)
Writing lock file
Generating autoload files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment