From 5fd5590ecf5e86b396ebc4bef2bb8edfd8e71d22 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Fri, 2 Jun 2017 13:41:23 +0200 Subject: [PATCH 1/2] forward compatibility with Yii 2.0.12 to be merged when https://github.com/yiisoft/yii2/pull/14241 is ready. --- console/controllers/MigrateController.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/console/controllers/MigrateController.php b/console/controllers/MigrateController.php index ecfa93e9a..a087ba085 100644 --- a/console/controllers/MigrateController.php +++ b/console/controllers/MigrateController.php @@ -130,10 +130,16 @@ public function beforeAction($action) */ protected function createMigration($class) { - $class = trim($class, '\\'); - if (strpos($class, '\\') === false) { - $file = $this->migrationPath . DIRECTORY_SEPARATOR . $class . '.php'; - require_once($file); + // since Yii 2.0.12 includeMigrationFile() exists, which replaced the code below + // remove this construct when composer requirement raises above 2.0.12 + if (method_exists($this, 'includeMigrationFile')) { + $this->includeMigrationFile($class); + } else { + $class = trim($class, '\\'); + if (strpos($class, '\\') === false) { + $file = $this->migrationPath . DIRECTORY_SEPARATOR . $class . '.php'; + require_once($file); + } } return new $class(['db' => $this->db]); From 2c119760f4a3fc613266394a08948905430ff80b Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Tue, 6 Jun 2017 13:11:55 +0200 Subject: [PATCH 2/2] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b4a6bbbc..c1bfd7726 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ Yii Framework 2 mongodb extension Change Log - Bug #205: Fixed negative value passed to `yii\mongodb\Query::limit()` or `yii\mongodb\Query::offset()` does not disables query limit or offset correspondingly (klimov-paul) - Bug #207: Fixed `yii\mongodb\validators\MongoDateValidator` corrupts date value, while validating existing `MongoDB\BSON\UTCDateTime` instance (klimov-paul) - Bug #210: Fixed `yii\mongodb\debug\MongoDbPanel` overrides explain action of `yii\debug\panels\DbPanel` (Liv1020, klimov-paul) - +- Bug #213: Made `MigrateController` compatible with Yii 2.0.12 (cebe) 2.1.3 February 15, 2017 -----------------------