2.7 KiB
Upgrading Instructions for Yii Framework v2
!!!IMPORTANT!!!
The following upgrading instructions are cumulative. That is, if you want to upgrade from version A to version C and there is version B between A and C, you need to following the instructions for both A and B.
Upgrade from Yii 2.0.5
-
PHP mongodb extension is now used instead of mongo. Make sure you have 'mongodb' extension at your environment. Some features based on old driver may become unavailable. In particular: fields
Connection::mongoClient,Database::mongoDbandCollection::mongoCollectionare no longer exist. Old driver type classes such as\MongoId,\MongoCode,\MongoDateand so on, are no longer returned or recognized. Make sure you are using their analogs from\MongoDB\BSON\*namespace. -
MongoDB server versions < 3.0 are no longer supported. Make sure you are running MongoDB server >= 3.0
-
The signature of the following
\yii\mongodb\Collectionmethods has been changed:aggregate(),distinct(),find(),findOne(),findAndModify(). Make sure you invoke those methods correctly. In case you are extending\yii\mongodb\Collection, you should check, if overridden methods match parent declaration. -
Command and query composition methods at
\yii\mongodb\Collection, such asbuildCondition(),ensureMongoId()and so on, have been removed. Use\yii\mongodb\QueryBuildermethods instead. -
Method
Database::executeCommand()has been removed. UseCommandclass for plain MongoDB command execution. You may create command with database scope usingDatabase::createCommand()method. -
Method
Collection::fullTextSearch()has been removed. Use$textquery condition instead. -
Method
Collection::getName()has been removed. UseCollection::namein order to get collection self name. -
For GridFS
yii\mongodb\file\Downloadis returned instead of\MongoGridFSFilefor the query result set. -
Cursor composed via
yii\mongodb\file\Collection::find()now returns result in the same format asyii\mongodb\file\Query::one(). If you wish to perform file manipulations on returned row you should usefilekey instead of direct method invocations.
Upgrade from Yii 2.0.1
- MongoDB PHP extension min version raised up to 1.5.0. You should upgrade your environment in case you are using older version.
Upgrade from Yii 2.0.0
- MongoDB PHP extension min version raised up to 1.4.0. You should upgrade your environment in case you are using older version.