Commit fcaddb0c by Qiang Xue

Fixes #4609. Fixes #4610.

parent 66dca873
...@@ -11,6 +11,7 @@ use Yii; ...@@ -11,6 +11,7 @@ use Yii;
use yii\console\Exception; use yii\console\Exception;
use yii\helpers\Console; use yii\helpers\Console;
use yii\helpers\FileHelper; use yii\helpers\FileHelper;
use yii\helpers\VarDumper;
/** /**
* This command manage fixtures creations based on given template. * This command manage fixtures creations based on given template.
...@@ -316,22 +317,7 @@ class FixtureController extends \yii\console\controllers\FixtureController ...@@ -316,22 +317,7 @@ class FixtureController extends \yii\console\controllers\FixtureController
*/ */
public function exportFixtures($fixtures) public function exportFixtures($fixtures)
{ {
$content = "<?php\n\nreturn ["; return "<?php\n\nreturn " . VarDumper::export($fixtures) . ";\n";
foreach ($fixtures as $fixture) {
$content .= "\n\t[";
foreach ($fixture as $name => $value) {
$content .= "\n\t\t'{$name}' => '{$value}',";
}
$content .= "\n\t],";
}
$content .= "\n];\n";
return $content;
} }
/** /**
......
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