Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
2cad8fcc
Commit
2cad8fcc
authored
May 20, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3517 from klimov-paul/apply-var-dumper-var-export
`VarDumper::export()` applied over framework.
parents
800b18db
1641e057
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
14 additions
and
10 deletions
+14
-10
Generator.php
extensions/gii/Generator.php
+2
-3
ErrorHandler.php
framework/base/ErrorHandler.php
+2
-1
AssetController.php
framework/console/controllers/AssetController.php
+4
-3
MessageController.php
framework/console/controllers/MessageController.php
+2
-1
PhpManager.php
framework/rbac/PhpManager.php
+2
-1
ErrorHandler.php
framework/web/ErrorHandler.php
+2
-1
No files found.
extensions/gii/Generator.php
View file @
2cad8fcc
...
...
@@ -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
=
''
;
}
...
...
framework/base/ErrorHandler.php
View file @
2cad8fcc
...
...
@@ -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
'<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
);
exit
(
1
);
}
...
...
framework/console/controllers/AssetController.php
View file @
2cad8fcc
...
...
@@ -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
=
<<<EOD
<?php
...
...
@@ -573,8 +574,8 @@ EOD;
*/
public
function
actionTemplate
(
$configFile
)
{
$jsCompressor
=
var_export
(
$this
->
jsCompressor
,
true
);
$cssCompressor
=
var_export
(
$this
->
cssCompressor
,
true
);
$jsCompressor
=
VarDumper
::
export
(
$this
->
jsCompressor
);
$cssCompressor
=
VarDumper
::
export
(
$this
->
cssCompressor
);
$template
=
<<<EOD
<?php
...
...
framework/console/controllers/MessageController.php
View file @
2cad8fcc
...
...
@@ -11,6 +11,7 @@ use Yii;
use
yii\console\Controller
;
use
yii\console\Exception
;
use
yii\helpers\FileHelper
;
use
yii\helpers\VarDumper
;
/**
* Extracts messages to be translated from source files.
...
...
@@ -374,7 +375,7 @@ class MessageController extends Controller
if
(
$format
===
'po'
)
{
$content
=
$merged
;
}
else
{
$array
=
str_replace
(
"
\r
"
,
''
,
var_export
(
$merged
,
true
)
);
$array
=
VarDumper
::
export
(
$merged
);
$content
=
<<<EOD
<?php
/**
...
...
framework/rbac/PhpManager.php
View file @
2cad8fcc
...
...
@@ -10,6 +10,7 @@ namespace yii\rbac;
use
yii\base\InvalidCallException
;
use
yii\base\InvalidParamException
;
use
Yii
;
use
yii\helpers\VarDumper
;
/**
* PhpManager represents an authorization manager that stores authorization
...
...
@@ -703,6 +704,6 @@ class PhpManager extends BaseManager
*/
protected
function
saveToFile
(
$data
,
$file
)
{
file_put_contents
(
$file
,
"<?php
\n
return "
.
var_export
(
$data
,
true
)
.
";
\n
"
,
LOCK_EX
);
file_put_contents
(
$file
,
"<?php
\n
return "
.
VarDumper
::
export
(
$data
)
.
";
\n
"
,
LOCK_EX
);
}
}
framework/web/ErrorHandler.php
View file @
2cad8fcc
...
...
@@ -11,6 +11,7 @@ use Yii;
use
yii\base\Exception
;
use
yii\base\ErrorException
;
use
yii\base\UserException
;
use
yii\helpers\VarDumper
;
/**
* ErrorHandler handles uncaught PHP errors and exceptions.
...
...
@@ -262,7 +263,7 @@ class ErrorHandler extends \yii\base\ErrorHandler
$request
=
''
;
foreach
([
'_GET'
,
'_POST'
,
'_SERVER'
,
'_FILES'
,
'_COOKIE'
,
'_SESSION'
,
'_ENV'
]
as
$name
)
{
if
(
!
empty
(
$GLOBALS
[
$name
]))
{
$request
.=
'$'
.
$name
.
' = '
.
var_export
(
$GLOBALS
[
$name
],
true
)
.
";
\n\n
"
;
$request
.=
'$'
.
$name
.
' = '
.
VarDumper
::
export
(
$GLOBALS
[
$name
]
)
.
";
\n\n
"
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment