From b68bd8ef631b7ef154d4b6fc092fe546eb5d915e Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Thu, 9 May 2013 11:53:13 -0400 Subject: [PATCH] Fixed Yii::importNamespaces() bug. --- framework/YiiBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/framework/YiiBase.php b/framework/YiiBase.php index aeed6f5..faf8a6e 100644 --- a/framework/YiiBase.php +++ b/framework/YiiBase.php @@ -158,8 +158,8 @@ class YiiBase { foreach ($namespaces as $name => $path) { if ($name !== '') { - $name = '@' . str_replace('\\', '/', $name); - static::setAlias($name, $path); + $name = trim(strtr($name, array('\\' => '/', '_' => '/')), '/'); + static::setAlias('@' . $name, rtrim($path, '/\\') . '/' . $name); } } }