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
255c19f3
Commit
255c19f3
authored
Dec 14, 2013
by
Qiang Xue
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1528 from omnilight/alias-in-message-command
Added support for aliases for config files in console command 'message'
parents
02cf3dde
87d7ffaf
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
MessageController.php
framework/yii/console/controllers/MessageController.php
+4
-2
No files found.
framework/CHANGELOG.md
View file @
255c19f3
...
@@ -15,6 +15,7 @@ Yii Framework 2 Change Log
...
@@ -15,6 +15,7 @@ Yii Framework 2 Change Log
-
Enh #1469: ActiveRecord::find() now works with default conditions (default scope) applied by createQuery (cebe)
-
Enh #1469: ActiveRecord::find() now works with default conditions (default scope) applied by createQuery (cebe)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to defauly application templates (samdark)
-
Enh: Added
`favicon.ico`
and
`robots.txt`
to defauly application templates (samdark)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Added
`Widget::autoIdPrefix`
to support prefixing automatically generated widget IDs (qiangxue)
-
Enh: Support for file aliases in console command 'message' (omnilight)
-
New #1438:
[
MongoDB integration
](
https://github.com/yiisoft/yii2-mongodb
)
ActiveRecord and Query (klimov-paul)
-
New #1438:
[
MongoDB integration
](
https://github.com/yiisoft/yii2-mongodb
)
ActiveRecord and Query (klimov-paul)
2.
0.0 alpha, December 1, 2013
2.
0.0 alpha, December 1, 2013
...
...
framework/yii/console/controllers/MessageController.php
View file @
255c19f3
...
@@ -43,11 +43,12 @@ class MessageController extends Controller
...
@@ -43,11 +43,12 @@ class MessageController extends Controller
* how to customize it to fit for your needs. After customization,
* how to customize it to fit for your needs. After customization,
* you may use this configuration file with the "extract" command.
* you may use this configuration file with the "extract" command.
*
*
* @param string $filePath output file name.
* @param string $filePath output file name
or alias
.
* @throws Exception on failure.
* @throws Exception on failure.
*/
*/
public
function
actionConfig
(
$filePath
)
public
function
actionConfig
(
$filePath
)
{
{
$filePath
=
Yii
::
getAlias
(
$filePath
);
if
(
file_exists
(
$filePath
))
{
if
(
file_exists
(
$filePath
))
{
if
(
!
$this
->
confirm
(
"File '
{
$filePath
}
' already exists. Do you wish to overwrite it?"
))
{
if
(
!
$this
->
confirm
(
"File '
{
$filePath
}
' already exists. Do you wish to overwrite it?"
))
{
return
;
return
;
...
@@ -63,13 +64,14 @@ class MessageController extends Controller
...
@@ -63,13 +64,14 @@ class MessageController extends Controller
* This command will search through source code files and extract
* This command will search through source code files and extract
* messages that need to be translated in different languages.
* messages that need to be translated in different languages.
*
*
* @param string $configFile the path of the configuration file.
* @param string $configFile the path o
r alias o
f the configuration file.
* You may use the "yii message/config" command to generate
* You may use the "yii message/config" command to generate
* this file and then customize it for your needs.
* this file and then customize it for your needs.
* @throws Exception on failure.
* @throws Exception on failure.
*/
*/
public
function
actionExtract
(
$configFile
)
public
function
actionExtract
(
$configFile
)
{
{
$configFile
=
Yii
::
getAlias
(
$configFile
);
if
(
!
is_file
(
$configFile
))
{
if
(
!
is_file
(
$configFile
))
{
throw
new
Exception
(
"The configuration file does not exist:
$configFile
"
);
throw
new
Exception
(
"The configuration file does not exist:
$configFile
"
);
}
}
...
...
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