PHP Class TranslationsShell, Platform-Crud-Plugin

Copyright 2010-2012, Nodes ApS. (http://www.nodesagency.com/) Licensed under The MIT License Redistributions of files must retain the above copyright notice.
Inheritance: extends AppShell
Afficher le fichier Open project: nodesagency/Platform-Crud-Plugin

Protected Properties

Свойство Type Description
$_messages array The array of all messages used by the crud component
$_path string The path to write the output file to
$_strings array The array of raw stings to be written to the output file

Méthodes publiques

Méthode Description
generate ( ) : void Create or update the file containing the translation strings for CRUD component usage
getOptionParser ( ) : ConsoleOptionParser Gets the option parser instance and configures it.
path ( mixed $path = null ) : string path

Méthodes protégées

Méthode Description
_addDocBlock ( string $message ) : boolean _addDocBlock
_generateTranslations ( mixed $modelName ) : void _generateTranslations
_getModels ( ) : array _getModels
_initializeMessages ( ) : void _initializeMessages
_writeFile ( ) : string _writeFile

Method Details

_addDocBlock() protected méthode

Add a doc block to the _strings property with the passed message appropriately formatted If the doc block already exists - return false
protected _addDocBlock ( string $message ) : boolean
$message string
Résultat boolean success

_generateTranslations() protected méthode

For the given model name, generate translation strings and add them to the _strings property If the model name is false - the common messages are processed
protected _generateTranslations ( mixed $modelName ) : void
$modelName mixed name of a model or false for the general messages
Résultat void

_getModels() protected méthode

If no arguments are passed to the cli call, return all App models Otherwise, assume the arguments are a list of file paths to plugin model dirs or an individual plugin model
protected _getModels ( ) : array
Résultat array

_initializeMessages() protected méthode

Extract all the messages used by the crud componentn, and write to the _messages property
protected _initializeMessages ( ) : void
Résultat void

_writeFile() protected méthode

Take the _strings property, populated by the generate method - and write it out to the output file path
protected _writeFile ( ) : string
Résultat string the file path written to

generate() public méthode

Create or update the file containing the translation strings for CRUD component usage
public generate ( ) : void
Résultat void

getOptionParser() public méthode

By overriding this method you can configure the ConsoleOptionParser before returning it.
public getOptionParser ( ) : ConsoleOptionParser
Résultat ConsoleOptionParser

path() public méthode

Set or retrieve the path to write the output file to Defaults to APP/Config/i18n_crud.php
public path ( mixed $path = null ) : string
$path mixed
Résultat string

Property Details

$_messages protected_oe property

The array of all messages used by the crud component
protected array $_messages
Résultat array

$_path protected_oe property

The path to write the output file to
protected string $_path
Résultat string

$_strings protected_oe property

The array of raw stings to be written to the output file
protected array $_strings
Résultat array