diff --git a/extensions/gii/Generator.php b/extensions/gii/Generator.php index 32735824ba..243811ddbf 100644 --- a/extensions/gii/Generator.php +++ b/extensions/gii/Generator.php @@ -11,6 +11,7 @@ use Yii; use ReflectionClass; use yii\base\InvalidConfigException; use yii\base\Model; +use yii\helpers\VarDumper; use yii\web\View; /** @@ -496,9 +497,7 @@ abstract class Generator extends Model if ($this->enableI18N) { // If there are placeholders, use them if (!empty($placeholders)) { - $search = ['array (', ')']; - $replace = ['[', ']']; - $ph = ', ' . str_replace($search, $replace, var_export($placeholders, true)); + $ph = ', ' . VarDumper::export($placeholders); } else { $ph = ''; } diff --git a/framework/base/ErrorHandler.php b/framework/base/ErrorHandler.php index 4dd06817a9..9ec0b85ffd 100644 --- a/framework/base/ErrorHandler.php +++ b/framework/base/ErrorHandler.php @@ -8,6 +8,7 @@ namespace yii\base; use Yii; +use yii\helpers\VarDumper; use yii\web\HttpException; /** @@ -107,7 +108,7 @@ abstract class ErrorHandler extends Component echo '
' . htmlspecialchars($msg, ENT_QUOTES, Yii::$app->charset) . ''; } } - $msg .= "\n\$_SERVER = " . var_export($_SERVER, true); + $msg .= "\n\$_SERVER = " . VarDumper::export($_SERVER); error_log($msg); exit(1); } diff --git a/framework/console/controllers/AssetController.php b/framework/console/controllers/AssetController.php index b7e1356008..7e016cf78e 100644 --- a/framework/console/controllers/AssetController.php +++ b/framework/console/controllers/AssetController.php @@ -10,6 +10,7 @@ namespace yii\console\controllers; use Yii; use yii\console\Exception; use yii\console\Controller; +use yii\helpers\VarDumper; /** * Allows you to combine and compress your JavaScript and CSS files. @@ -392,7 +393,7 @@ class AssetController extends Controller } } } - $array = var_export($array, true); + $array = VarDumper::export($array); $version = date('Y-m-d H:i:s', time()); $bundleFileContent = <<