Commit 1641e057 by Klimov Paul

`VarDumper::export()` applied over framework.

parent 2b26dd32
...@@ -11,6 +11,7 @@ use Yii; ...@@ -11,6 +11,7 @@ use Yii;
use ReflectionClass; use ReflectionClass;
use yii\base\InvalidConfigException; use yii\base\InvalidConfigException;
use yii\base\Model; use yii\base\Model;
use yii\helpers\VarDumper;
use yii\web\View; use yii\web\View;
/** /**
...@@ -496,9 +497,7 @@ abstract class Generator extends Model ...@@ -496,9 +497,7 @@ abstract class Generator extends Model
if ($this->enableI18N) { if ($this->enableI18N) {
// If there are placeholders, use them // If there are placeholders, use them
if (!empty($placeholders)) { if (!empty($placeholders)) {
$search = ['array (', ')']; $ph = ', ' . VarDumper::export($placeholders);
$replace = ['[', ']'];
$ph = ', ' . str_replace($search, $replace, var_export($placeholders, true));
} else { } else {
$ph = ''; $ph = '';
} }
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
namespace yii\base; namespace yii\base;
use Yii; use Yii;
use yii\helpers\VarDumper;
use yii\web\HttpException; use yii\web\HttpException;
/** /**
...@@ -107,7 +108,7 @@ abstract class ErrorHandler extends Component ...@@ -107,7 +108,7 @@ abstract class ErrorHandler extends Component
echo '<pre>' . htmlspecialchars($msg, ENT_QUOTES, Yii::$app->charset) . '</pre>'; echo '<pre>' . htmlspecialchars($msg, ENT_QUOTES, Yii::$app->charset) . '</pre>';
} }
} }
$msg .= "\n\$_SERVER = " . var_export($_SERVER, true); $msg .= "\n\$_SERVER = " . VarDumper::export($_SERVER);
error_log($msg); error_log($msg);
exit(1); exit(1);
} }
......
...@@ -10,6 +10,7 @@ namespace yii\console\controllers; ...@@ -10,6 +10,7 @@ namespace yii\console\controllers;
use Yii; use Yii;
use yii\console\Exception; use yii\console\Exception;
use yii\console\Controller; use yii\console\Controller;
use yii\helpers\VarDumper;
/** /**
* Allows you to combine and compress your JavaScript and CSS files. * Allows you to combine and compress your JavaScript and CSS files.
...@@ -392,7 +393,7 @@ class AssetController extends Controller ...@@ -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()); $version = date('Y-m-d H:i:s', time());
$bundleFileContent = <<<EOD $bundleFileContent = <<<EOD
<?php <?php
...@@ -573,8 +574,8 @@ EOD; ...@@ -573,8 +574,8 @@ EOD;
*/ */
public function actionTemplate($configFile) public function actionTemplate($configFile)
{ {
$jsCompressor = var_export($this->jsCompressor, true); $jsCompressor = VarDumper::export($this->jsCompressor);
$cssCompressor = var_export($this->cssCompressor, true); $cssCompressor = VarDumper::export($this->cssCompressor);
$template = <<<EOD $template = <<<EOD
<?php <?php
......
...@@ -11,6 +11,7 @@ use Yii; ...@@ -11,6 +11,7 @@ use Yii;
use yii\console\Controller; use yii\console\Controller;
use yii\console\Exception; use yii\console\Exception;
use yii\helpers\FileHelper; use yii\helpers\FileHelper;
use yii\helpers\VarDumper;
/** /**
* Extracts messages to be translated from source files. * Extracts messages to be translated from source files.
...@@ -374,7 +375,7 @@ class MessageController extends Controller ...@@ -374,7 +375,7 @@ class MessageController extends Controller
if ($format === 'po') { if ($format === 'po') {
$content = $merged; $content = $merged;
} else { } else {
$array = str_replace("\r", '', var_export($merged, true)); $array = VarDumper::export($merged);
$content = <<<EOD $content = <<<EOD
<?php <?php
/** /**
......
...@@ -10,6 +10,7 @@ namespace yii\rbac; ...@@ -10,6 +10,7 @@ namespace yii\rbac;
use yii\base\InvalidCallException; use yii\base\InvalidCallException;
use yii\base\InvalidParamException; use yii\base\InvalidParamException;
use Yii; use Yii;
use yii\helpers\VarDumper;
/** /**
* PhpManager represents an authorization manager that stores authorization * PhpManager represents an authorization manager that stores authorization
...@@ -703,6 +704,6 @@ class PhpManager extends BaseManager ...@@ -703,6 +704,6 @@ class PhpManager extends BaseManager
*/ */
protected function saveToFile($data, $file) protected function saveToFile($data, $file)
{ {
file_put_contents($file, "<?php\nreturn " . var_export($data, true) . ";\n", LOCK_EX); file_put_contents($file, "<?php\nreturn " . VarDumper::export($data) . ";\n", LOCK_EX);
} }
} }
...@@ -11,6 +11,7 @@ use Yii; ...@@ -11,6 +11,7 @@ use Yii;
use yii\base\Exception; use yii\base\Exception;
use yii\base\ErrorException; use yii\base\ErrorException;
use yii\base\UserException; use yii\base\UserException;
use yii\helpers\VarDumper;
/** /**
* ErrorHandler handles uncaught PHP errors and exceptions. * ErrorHandler handles uncaught PHP errors and exceptions.
...@@ -262,7 +263,7 @@ class ErrorHandler extends \yii\base\ErrorHandler ...@@ -262,7 +263,7 @@ class ErrorHandler extends \yii\base\ErrorHandler
$request = ''; $request = '';
foreach (['_GET', '_POST', '_SERVER', '_FILES', '_COOKIE', '_SESSION', '_ENV'] as $name) { foreach (['_GET', '_POST', '_SERVER', '_FILES', '_COOKIE', '_SESSION', '_ENV'] as $name) {
if (!empty($GLOBALS[$name])) { if (!empty($GLOBALS[$name])) {
$request .= '$' . $name . ' = ' . var_export($GLOBALS[$name], true) . ";\n\n"; $request .= '$' . $name . ' = ' . VarDumper::export($GLOBALS[$name]) . ";\n\n";
} }
} }
......
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