seyyed
(Arash)
1
Hi guys,
after I add yii2/mongodb composer remove some of packages.why?
D:\wamp\www\AppEngine>php composer.phar require --prefer-dist yiisoft/
yii2-mongodb "*"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing yiisoft/yii2 (dev-master 8d2fa00)
- Installing yiisoft/yii2-dev (dev-master 8984930)
Downloading: 100%
- Removing yiisoft/yii2-bootstrap (dev-master 58421f9)
- Removing yiisoft/yii2-debug (dev-master 6fcb473)
- Removing yiisoft/yii2-gii (dev-master 2735ad6)
- Removing yiisoft/yii2-swiftmailer (dev-master 21062fb)
- Removing yiisoft/yii2-codeception (dev-master 6468a92)
Writing lock file
Generating autoload files
CeBe
2
Looks like you changed your composer.json before and did not run composer update after that.
can you show composer.json?
seyyed
(Arash)
3
After
php composer.phar create-project --prefer-dist --stability=dev yiisoft/yii2-app-basic AppEngine
I updated it and then
php composer.phar require --prefer-dist yiisoft/yii2-mongodb "*"
This is composer.json:
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Application Template",
"keywords": ["yii", "framework", "basic", "application template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "dev",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "*",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*",
"yiisoft/yii2-mongodb": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"codeception/codeception": "*",
"codeception/specify": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*"
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::setPermission"
]
},
"config": {
"process-timeout": 1800
},
"extra": {
"writable": [
"runtime",
"web/assets"
],
"executable": [
"yii"
]
}
}
CeBe
4
Found the problem. mongodb extension does not seem to be available on packagist. We’ll fix it.
CeBe
5
Must have been some temporary issue with packagist. Was not able to see the package minutes ago but now it is there:
https://packagist.org/packages/yiisoft/yii2-mongodb
Found the real cause of the problem:
Looks like you do not have the mongodb php extension installed that is required by yii2-mongodb package.
Composer now falls back to installing yii2-dev instead which provides yii2-mongodb without this dependency 
To fix this, install the mongodb php extension and run composer update