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
cb0d7412
Commit
cb0d7412
authored
May 25, 2013
by
Alexander Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added missing phpdoc
parent
01f74b3c
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
+39
-0
MessageController.php
framework/yii/console/controllers/MessageController.php
+16
-0
HtmlPurifier.php
framework/yii/helpers/base/HtmlPurifier.php
+7
-0
Markdown.php
framework/yii/helpers/base/Markdown.php
+7
-0
GettextMessageSource.php
framework/yii/i18n/GettextMessageSource.php
+9
-0
No files found.
framework/yii/console/controllers/MessageController.php
View file @
cb0d7412
...
@@ -115,6 +115,13 @@ class MessageController extends Controller
...
@@ -115,6 +115,13 @@ class MessageController extends Controller
}
}
}
}
/**
* Extracts messages from a file
*
* @param string $fileName name of the file to extract messages from
* @param string $translator name of the function used to translate messages
* @return array
*/
protected
function
extractMessages
(
$fileName
,
$translator
)
protected
function
extractMessages
(
$fileName
,
$translator
)
{
{
echo
"Extracting messages from
$fileName
...
\n
"
;
echo
"Extracting messages from
$fileName
...
\n
"
;
...
@@ -135,6 +142,15 @@ class MessageController extends Controller
...
@@ -135,6 +142,15 @@ class MessageController extends Controller
return
$messages
;
return
$messages
;
}
}
/**
* Writes messages into file
*
* @param array $messages
* @param string $fileName name of the file to write to
* @param boolean $overwrite if existing file should be overwritten without backup
* @param boolean $removeOld if obsolete translations should be removed
* @param boolean $sort if translations should be sorted
*/
protected
function
generateMessageFile
(
$messages
,
$fileName
,
$overwrite
,
$removeOld
,
$sort
)
protected
function
generateMessageFile
(
$messages
,
$fileName
,
$overwrite
,
$removeOld
,
$sort
)
{
{
echo
"Saving messages to
$fileName
..."
;
echo
"Saving messages to
$fileName
..."
;
...
...
framework/yii/helpers/base/HtmlPurifier.php
View file @
cb0d7412
...
@@ -16,6 +16,13 @@ namespace yii\helpers\base;
...
@@ -16,6 +16,13 @@ namespace yii\helpers\base;
*/
*/
class
HtmlPurifier
class
HtmlPurifier
{
{
/**
* Passes markup through HTMLPurifier making it safe to output to end user
*
* @param string $content
* @param array|null $config
* @return string
*/
public
static
function
process
(
$content
,
$config
=
null
)
public
static
function
process
(
$content
,
$config
=
null
)
{
{
$purifier
=
\HTMLPurifier
::
instance
(
$config
);
$purifier
=
\HTMLPurifier
::
instance
(
$config
);
...
...
framework/yii/helpers/base/Markdown.php
View file @
cb0d7412
...
@@ -37,6 +37,13 @@ class Markdown
...
@@ -37,6 +37,13 @@ class Markdown
*/
*/
protected
static
$markdown
;
protected
static
$markdown
;
/**
* Converts markdown into HTML
*
* @param string $content
* @param array $config
* @return string
*/
public
static
function
process
(
$content
,
$config
=
array
())
public
static
function
process
(
$content
,
$config
=
array
())
{
{
if
(
static
::
$markdown
===
null
)
{
if
(
static
::
$markdown
===
null
)
{
...
...
framework/yii/i18n/GettextMessageSource.php
View file @
cb0d7412
...
@@ -31,6 +31,15 @@ class GettextMessageSource extends MessageSource
...
@@ -31,6 +31,15 @@ class GettextMessageSource extends MessageSource
*/
*/
public
$useBigEndian
=
false
;
public
$useBigEndian
=
false
;
/**
* Loads the message translation for the specified language and category.
* Child classes should override this method to return the message translations of
* the specified language and category.
* @param string $category the message category
* @param string $language the target language
* @return array the loaded messages. The keys are original messages, and the values
* are translated messages.
*/
protected
function
loadMessages
(
$category
,
$language
)
protected
function
loadMessages
(
$category
,
$language
)
{
{
$messageFile
=
Yii
::
getAlias
(
$this
->
basePath
)
.
'/'
.
$language
.
'/'
.
$this
->
catalog
;
$messageFile
=
Yii
::
getAlias
(
$this
->
basePath
)
.
'/'
.
$language
.
'/'
.
$this
->
catalog
;
...
...
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