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
4b97abac
Commit
4b97abac
authored
Nov 07, 2014
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #5954: `yii message` command now shows user friendly error if it's not…
Fixes #5954: `yii message` command now shows user friendly error if it's not able to parse source file
parent
b8cb5e2a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
0 deletions
+13
-0
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
MessageController.php
framework/console/controllers/MessageController.php
+12
-0
No files found.
framework/CHANGELOG.md
View file @
4b97abac
...
@@ -31,6 +31,7 @@ Yii Framework 2 Change Log
...
@@ -31,6 +31,7 @@ Yii Framework 2 Change Log
-
Enh #5735: Added
`yii\bootstrap\Tabs::renderTabContent`
to support manually rendering tab contents (RomeroMsk)
-
Enh #5735: Added
`yii\bootstrap\Tabs::renderTabContent`
to support manually rendering tab contents (RomeroMsk)
-
Enh #5770: Added more PHP error names for
`ErrorException`
(mongosoft)
-
Enh #5770: Added more PHP error names for
`ErrorException`
(mongosoft)
-
Enh #5806: Allow
`Html::encode()`
to be used when the application is not started (qiangxue)
-
Enh #5806: Allow
`Html::encode()`
to be used when the application is not started (qiangxue)
-
Enh #5954:
`yii message`
command now shows user friendly error if it's not able to parse source file (samdark)
-
Enh:
`Console::confirm()`
now uses
`Console::stdout()`
instead of
`echo`
to be consistent with all other functions (cebe)
-
Enh:
`Console::confirm()`
now uses
`Console::stdout()`
instead of
`echo`
to be consistent with all other functions (cebe)
-
Enh:
`yii\rbac\DbManager`
migration now uses database component specified in component settings instead of always using default
`db`
(samdark)
-
Enh:
`yii\rbac\DbManager`
migration now uses database component specified in component settings instead of always using default
`db`
(samdark)
-
Chg #3630:
`yii\db\Command::queryInternal()`
is now protected (samdark)
-
Chg #3630:
`yii\db\Command::queryInternal()`
is now protected (samdark)
...
...
framework/console/controllers/MessageController.php
View file @
4b97abac
...
@@ -8,8 +8,10 @@
...
@@ -8,8 +8,10 @@
namespace
yii\console\controllers
;
namespace
yii\console\controllers
;
use
Yii
;
use
Yii
;
use
yii\base\ErrorException
;
use
yii\console\Controller
;
use
yii\console\Controller
;
use
yii\console\Exception
;
use
yii\console\Exception
;
use
yii\helpers\Console
;
use
yii\helpers\FileHelper
;
use
yii\helpers\FileHelper
;
use
yii\helpers\VarDumper
;
use
yii\helpers\VarDumper
;
use
yii\i18n\GettextPoFile
;
use
yii\i18n\GettextPoFile
;
...
@@ -258,7 +260,17 @@ class MessageController extends Controller
...
@@ -258,7 +260,17 @@ class MessageController extends Controller
for
(
$i
=
0
;
$i
<
$n
;
++
$i
)
{
for
(
$i
=
0
;
$i
<
$n
;
++
$i
)
{
$category
=
substr
(
$matches
[
$i
][
1
],
1
,
-
1
);
$category
=
substr
(
$matches
[
$i
][
1
],
1
,
-
1
);
$message
=
$matches
[
$i
][
2
];
$message
=
$matches
[
$i
][
2
];
try
{
$messages
[
$category
][]
=
eval
(
"return
{
$message
}
;"
);
// use eval to eliminate quote escape
$messages
[
$category
][]
=
eval
(
"return
{
$message
}
;"
);
// use eval to eliminate quote escape
}
catch
(
ErrorException
$e
)
{
$category
=
Console
::
ansiFormat
(
$category
,
[
Console
::
FG_CYAN
]);
$message
=
Console
::
ansiFormat
(
$message
,
[
Console
::
FG_CYAN
]);
$fileName
=
Console
::
ansiFormat
(
$fileName
,
[
Console
::
FG_CYAN
]);
$error
=
Console
::
ansiFormat
(
$e
->
getMessage
(),
[
Console
::
FG_RED
]);
$this
->
stdout
(
"Failed parsing
$fileName
,
$message
in
$category
category:
\n
"
.
$error
.
"
\n
"
);
Yii
::
$app
->
end
(
self
::
EXIT_CODE_ERROR
);
}
}
}
}
}
...
...
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