From 239778efbddca81c42716b59b25a4141d3456b38 Mon Sep 17 00:00:00 2001 From: Qiang Xue Date: Thu, 2 Jan 2014 23:34:00 -0500 Subject: [PATCH] minor issue fix about fixture controllers. --- extensions/yii/faker/FixtureController.php | 2 +- framework/yii/console/controllers/FixtureController.php | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/yii/faker/FixtureController.php b/extensions/yii/faker/FixtureController.php index d36083d..613a309 100644 --- a/extensions/yii/faker/FixtureController.php +++ b/extensions/yii/faker/FixtureController.php @@ -219,7 +219,7 @@ class FixtureController extends \yii\console\controllers\FixtureController if (empty($files)) { throw new Exception( - "No files were found by name: \"{$file}\". \n" + "No files were found by name: \"" . implode(', ', $file) . "\". \n" . "Check that template with these name exists, under template path: \n\"{$templatePath}\"." ); } diff --git a/framework/yii/console/controllers/FixtureController.php b/framework/yii/console/controllers/FixtureController.php index 6a86e23..84ab7d4 100644 --- a/framework/yii/console/controllers/FixtureController.php +++ b/framework/yii/console/controllers/FixtureController.php @@ -8,8 +8,8 @@ namespace yii\console\controllers; use Yii; -use yii\base\InvalidConfigException; use yii\console\Controller; +use yii\console\Exception; use yii\test\DbTestTrait; /** @@ -122,14 +122,14 @@ class FixtureController extends Controller /** * Checks if the database and fixtures path are available. - * @throws InvalidConfigException + * @throws Exception */ public function checkRequirements() { $path = Yii::getAlias($this->fixturePath, false); if (!is_dir($path) || !is_writable($path)) { - throw new InvalidConfigException("The fixtures path \"{$this->fixturePath}\" not exist or is not writable"); + throw new Exception("The fixtures path \"{$this->fixturePath}\" not exist or is not writable"); } } @@ -137,14 +137,14 @@ class FixtureController extends Controller /** * Returns database connection component * @return \yii\db\Connection - * @throws InvalidConfigException if [[db]] is invalid. + * @throws Exception if [[db]] is invalid. */ public function getDbConnection() { $db = Yii::$app->getComponent($this->db); if ($db == null) { - throw new InvalidConfigException("There is no database connection component with id \"{$this->db}\"."); + throw new Exception("There is no database connection component with id \"{$this->db}\"."); } return $db;