From 57e5474143d02e77b0c8279d755c58e0c8b7d91e Mon Sep 17 00:00:00 2001 From: Klimov Paul Date: Sun, 19 May 2013 15:46:24 +0300 Subject: [PATCH] Method "yii\console\controllers\AssetController::loadBundleDependency()" has been improved allowing dection of the circular dependency. --- yii/console/controllers/AssetController.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/yii/console/controllers/AssetController.php b/yii/console/controllers/AssetController.php index 1f2be91..fcf8846 100644 --- a/yii/console/controllers/AssetController.php +++ b/yii/console/controllers/AssetController.php @@ -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; } } }