Commit 57e54741 by Klimov Paul

Method "yii\console\controllers\AssetController::loadBundleDependency()" has…

Method "yii\console\controllers\AssetController::loadBundleDependency()" has been improved allowing dection of the circular dependency.
parent 4695362a
......@@ -203,12 +203,16 @@ class AssetController extends Controller
$assetManager = $this->getAssetManager();
foreach ($bundle->depends as $dependencyName) {
if (!array_key_exists($dependencyName, $result)) {
if ($result[$dependencyName] === false) {
throw new Exception("A circular dependency is detected for target '{$dependencyName}'.");
}
$dependencyBundle = $assetManager->getBundle($dependencyName);
if ($dependencyBundle === null) {
throw new Exception("Unable to load dependency bundle '{$dependencyName}' for bundle '{$name}'.");
} else {
$result[$dependencyName] = $dependencyBundle;
$result[$dependencyName] = false;
$this->loadBundleDependency($dependencyName, $dependencyBundle, $result);
$result[$dependencyName] = $dependencyBundle;
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment