Browse Source

added alias syntax support

fixes #13356
fixes #13359
tags/2.0.12
Tobias Munk 7 years ago committed by Carsten Brandt
parent
commit
deb1def9d3
No known key found for this signature in database
GPG Key ID: BE4F41DE1DEEEED0
  1. 1
      framework/CHANGELOG.md
  2. 4
      framework/console/controllers/BaseMigrateController.php

1
framework/CHANGELOG.md

@ -73,6 +73,7 @@ Yii Framework 2 Change Log
- Enh #13254: Core validators no longer require `Yii::$app` to be set (sammousa)
- Enh #13260: Added support for sorting by expression to `\yii\data\Sort` (LAV45, klimov-paul)
- Enh #13278: `yii\caching\DbQueryDependency` created allowing specification of the cache dependency via `yii\db\QueryInterface` (klimov-paul)
- Enh #13356: Support aliases in `MigrateController::$migrationNamespaces` to load non-namespaced migrations for BC with existing applications and extensions (schmunk42, cebe)
- Enh #13360: Added Dockerized test setup for the framework tests (schmunk42)
- Enh #13369: Added ability to render current `yii\widgets\LinkPager` page disabled (aquy)
- Enh #13376: Data provider now automatically sets an ID so there is no need to set it manually in case multiple data providers are used with pagination (SamMousa)

4
framework/console/controllers/BaseMigrateController.php

@ -13,6 +13,7 @@ use yii\console\Exception;
use yii\console\Controller;
use yii\helpers\Console;
use yii\helpers\FileHelper;
use yii\helpers\StringHelper;
/**
* BaseMigrateController is the base class for migrate controllers.
@ -718,6 +719,9 @@ abstract class BaseMigrateController extends Controller
if (strpos($class, '\\') === false) {
$file = $this->migrationPath . DIRECTORY_SEPARATOR . $class . '.php';
require_once($file);
} elseif (!class_exists($class, true)) {
// if the class with namespace does not exist, try to load it without namespace
$class = StringHelper::basename($class);
}
return new $class();

Loading…
Cancel
Save