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
a3af271e
Commit
a3af271e
authored
Dec 04, 2014
by
Paul Klimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Color output added to `yii\console\MessageController` and `yii\console\AssetController`
parent
86328823
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
AssetController.php
framework/console/controllers/AssetController.php
+3
-2
MessageController.php
framework/console/controllers/MessageController.php
+5
-6
No files found.
framework/console/controllers/AssetController.php
View file @
a3af271e
...
@@ -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\Console
;
use
yii\helpers\VarDumper
;
use
yii\helpers\VarDumper
;
/**
/**
...
@@ -423,7 +424,7 @@ EOD;
...
@@ -423,7 +424,7 @@ EOD;
if
(
!
file_put_contents
(
$bundleFile
,
$bundleFileContent
))
{
if
(
!
file_put_contents
(
$bundleFile
,
$bundleFileContent
))
{
throw
new
Exception
(
"Unable to write output bundle configuration at '
{
$bundleFile
}
'."
);
throw
new
Exception
(
"Unable to write output bundle configuration at '
{
$bundleFile
}
'."
);
}
}
$this
->
stdout
(
"Output bundle configuration created at '
{
$bundleFile
}
'.
\n
"
);
$this
->
stdout
(
"Output bundle configuration created at '
{
$bundleFile
}
'.
\n
"
,
Console
::
FG_GREEN
);
}
}
/**
/**
...
@@ -656,7 +657,7 @@ EOD;
...
@@ -656,7 +657,7 @@ EOD;
if
(
!
file_put_contents
(
$configFile
,
$template
))
{
if
(
!
file_put_contents
(
$configFile
,
$template
))
{
throw
new
Exception
(
"Unable to write template file '
{
$configFile
}
'."
);
throw
new
Exception
(
"Unable to write template file '
{
$configFile
}
'."
);
}
else
{
}
else
{
$this
->
stdout
(
"Configuration file template created at '
{
$configFile
}
'.
\n\n
"
);
$this
->
stdout
(
"Configuration file template created at '
{
$configFile
}
'.
\n\n
"
,
Console
::
FG_GREEN
);
return
self
::
EXIT_CODE_NORMAL
;
return
self
::
EXIT_CODE_NORMAL
;
}
}
}
}
...
...
framework/console/controllers/MessageController.php
View file @
a3af271e
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
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\Console
;
...
@@ -64,7 +63,7 @@ class MessageController extends Controller
...
@@ -64,7 +63,7 @@ class MessageController extends Controller
}
}
}
}
copy
(
Yii
::
getAlias
(
'@yii/views/messageConfig.php'
),
$filePath
);
copy
(
Yii
::
getAlias
(
'@yii/views/messageConfig.php'
),
$filePath
);
$this
->
stdout
(
"Configuration file template created at '
{
$filePath
}
'.
\n\n
"
);
$this
->
stdout
(
"Configuration file template created at '
{
$filePath
}
'.
\n\n
"
,
Console
::
FG_GREEN
);
return
self
::
EXIT_CODE_NORMAL
;
return
self
::
EXIT_CODE_NORMAL
;
}
}
...
@@ -382,7 +381,7 @@ class MessageController extends Controller
...
@@ -382,7 +381,7 @@ class MessageController extends Controller
sort
(
$messages
);
sort
(
$messages
);
ksort
(
$existingMessages
);
ksort
(
$existingMessages
);
if
(
array_keys
(
$existingMessages
)
==
$messages
)
{
if
(
array_keys
(
$existingMessages
)
==
$messages
)
{
$this
->
stdout
(
"Nothing new in
\"
$category
\"
category... Nothing to save.
\n\n
"
);
$this
->
stdout
(
"Nothing new in
\"
$category
\"
category... Nothing to save.
\n\n
"
,
Console
::
FG_GREEN
);
return
;
return
;
}
}
$merged
=
[];
$merged
=
[];
...
@@ -452,7 +451,7 @@ return $array;
...
@@ -452,7 +451,7 @@ return $array;
EOD;
EOD;
file_put_contents
(
$fileName
,
$content
);
file_put_contents
(
$fileName
,
$content
);
$this
->
stdout
(
"
Saved.
\n\n
"
);
$this
->
stdout
(
"
Translation saved.
\n\n
"
,
Console
::
FG_GREEN
);
}
}
/**
/**
...
@@ -545,9 +544,9 @@ EOD;
...
@@ -545,9 +544,9 @@ EOD;
}
}
if
(
$hasSomethingToWrite
)
{
if
(
$hasSomethingToWrite
)
{
$poFile
->
save
(
$file
,
$merged
);
$poFile
->
save
(
$file
,
$merged
);
$this
->
stdout
(
"
Saved.
\n
"
);
$this
->
stdout
(
"
Translation saved.
\n
"
,
Console
::
FG_GREEN
);
}
else
{
}
else
{
$this
->
stdout
(
"Nothing to save.
\n
"
);
$this
->
stdout
(
"Nothing to save.
\n
"
,
Console
::
FG_GREEN
);
}
}
}
}
}
}
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