PHP 클래스 Cake\Shell\Task\ExtractTask

상속: extends Cake\Console\Shell
파일 보기 프로젝트 열기: cakephp/cakephp 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_exclude array An array of directories to exclude.
$_extractCore boolean Holds whether this call should extract the CakePHP Lib messages
$_file string Current file being processed
$_files array Files from where to extract
$_merge boolean Merge all domain strings into the default.pot file
$_output string Destination path
$_paths array Paths to use when looking for strings
$_storage array Contains all content waiting to be write
$_tokens array Extracted tokens
$_translations array Extracted strings indexed by domain.
$_validationDomain boolean Holds the validation string domain to use for validation messages when extracting

공개 메소드들

메소드 설명
getOptionParser ( ) : Cake\Console\ConsoleOptionParser Gets the option parser instance and configures it.
main ( ) : void Execution method always used for tasks

보호된 메소드들

메소드 설명
_addTranslation ( string $domain, string $msgid, array $details = [] ) : void Add a translation to the internal translations property
_buildFiles ( ) : void Build the translate template file contents out of obtained strings
_extract ( ) : void Extract text
_extractTokens ( ) : void Extract tokens out of all files to be processed
_formatString ( string $string ) : string Format a string to be added as a translatable string
_getPaths ( ) : void Method to interact with the User and get path selections.
_getStrings ( integer &$position, integer $target ) : array Get the strings from the position forward
_isExtractingApp ( ) : boolean Returns whether this execution is meant to extract string only from directories in folder represented by the APP constant, i.e. this task is extracting strings from same application.
_isPathUsable ( string $path ) : boolean Checks whether or not a given path is usable for writing.
_markerError ( string $file, integer $line, string $marker, integer $count ) : void Indicate an invalid marker on a processed file
_parse ( string $functionName, array $map ) : void Parse tokens
_searchFiles ( ) : void Search files that may contain translatable strings
_store ( string $domain, string $header, string $sentence ) : void Prepare a file to be stored
_welcome ( ) : void No welcome message.
_writeFiles ( ) : void Write the files that need to be stored
_writeHeader ( ) : string Build the translation template header

메소드 상세

_addTranslation() 보호된 메소드

Takes care of duplicate translations
protected _addTranslation ( string $domain, string $msgid, array $details = [] ) : void
$domain string The domain
$msgid string The message string
$details array Context and plural form if any, file and line references
리턴 void

_buildFiles() 보호된 메소드

Build the translate template file contents out of obtained strings
protected _buildFiles ( ) : void
리턴 void

_extract() 보호된 메소드

Extract text
protected _extract ( ) : void
리턴 void

_extractTokens() 보호된 메소드

Extract tokens out of all files to be processed
protected _extractTokens ( ) : void
리턴 void

_formatString() 보호된 메소드

Format a string to be added as a translatable string
protected _formatString ( string $string ) : string
$string string String to format
리턴 string Formatted string

_getPaths() 보호된 메소드

Method to interact with the User and get path selections.
protected _getPaths ( ) : void
리턴 void

_getStrings() 보호된 메소드

Get the strings from the position forward
protected _getStrings ( integer &$position, integer $target ) : array
$position integer Actual position on tokens array
$target integer Number of strings to extract
리턴 array Strings extracted

_isExtractingApp() 보호된 메소드

Returns whether this execution is meant to extract string only from directories in folder represented by the APP constant, i.e. this task is extracting strings from same application.
protected _isExtractingApp ( ) : boolean
리턴 boolean

_isPathUsable() 보호된 메소드

Checks whether or not a given path is usable for writing.
protected _isPathUsable ( string $path ) : boolean
$path string Path to folder
리턴 boolean true if it exists and is writable, false otherwise

_markerError() 보호된 메소드

Indicate an invalid marker on a processed file
protected _markerError ( string $file, integer $line, string $marker, integer $count ) : void
$file string File where invalid marker resides
$line integer Line number
$marker string Marker found
$count integer Count
리턴 void

_parse() 보호된 메소드

Parse tokens
protected _parse ( string $functionName, array $map ) : void
$functionName string Function name that indicates translatable string (e.g: '__')
$map array Array containing what variables it will find (e.g: domain, singular, plural)
리턴 void

_searchFiles() 보호된 메소드

Search files that may contain translatable strings
protected _searchFiles ( ) : void
리턴 void

_store() 보호된 메소드

Prepare a file to be stored
protected _store ( string $domain, string $header, string $sentence ) : void
$domain string The domain
$header string The header content.
$sentence string The sentence to store.
리턴 void

_welcome() 보호된 메소드

No welcome message.
protected _welcome ( ) : void
리턴 void

_writeFiles() 보호된 메소드

Write the files that need to be stored
protected _writeFiles ( ) : void
리턴 void

_writeHeader() 보호된 메소드

Build the translation template header
protected _writeHeader ( ) : string
리턴 string Translation template header

getOptionParser() 공개 메소드

Gets the option parser instance and configures it.
public getOptionParser ( ) : Cake\Console\ConsoleOptionParser
리턴 Cake\Console\ConsoleOptionParser

main() 공개 메소드

Execution method always used for tasks
public main ( ) : void
리턴 void

프로퍼티 상세

$_exclude 보호되어 있는 프로퍼티

An array of directories to exclude.
protected array $_exclude
리턴 array

$_extractCore 보호되어 있는 프로퍼티

Holds whether this call should extract the CakePHP Lib messages
protected bool $_extractCore
리턴 boolean

$_file 보호되어 있는 프로퍼티

Current file being processed
protected string $_file
리턴 string

$_files 보호되어 있는 프로퍼티

Files from where to extract
protected array $_files
리턴 array

$_merge 보호되어 있는 프로퍼티

Merge all domain strings into the default.pot file
protected bool $_merge
리턴 boolean

$_output 보호되어 있는 프로퍼티

Destination path
protected string $_output
리턴 string

$_paths 보호되어 있는 프로퍼티

Paths to use when looking for strings
protected array $_paths
리턴 array

$_storage 보호되어 있는 프로퍼티

Contains all content waiting to be write
protected array $_storage
리턴 array

$_tokens 보호되어 있는 프로퍼티

Extracted tokens
protected array $_tokens
리턴 array

$_translations 보호되어 있는 프로퍼티

Extracted strings indexed by domain.
protected array $_translations
리턴 array

$_validationDomain 보호되어 있는 프로퍼티

Holds the validation string domain to use for validation messages when extracting
protected bool $_validationDomain
리턴 boolean