Méthode | Description | |
---|---|---|
__construct ( array $config = [] ) : void | Constructor. | |
read ( string $category, string $locale, string $scope ) : array | Reads data. |
Méthode | Description | |
---|---|---|
_init ( ) | Initializer. Checks if the configured path exists. | |
_merge ( array $data, array $item ) : array | Merges an item into given data and removes quotation marks from the beginning and end of message strings. | |
_parsePhp ( string $file ) : array | Parses a PHP file for messages marked as translatable. Recognized as message marking are $t() and $tn() which are implemented in the View class. This is a rather simple and stupid parser but also fast and easy to grasp. It doesn't actively attempt to detect and work around syntax errors in marker functions. | |
_readMessageTemplate ( string $path ) : array | Extracts data from files within configured path recursively. |
public __construct ( array $config = [] ) : void | ||
$config | array | Available configuration options are: - `'path'`: The path to the directory holding the data. - `'scope'`: Scope to use. |
Résultat | void |
protected _readMessageTemplate ( string $path ) : array | ||
$path | string | Base path to start extracting from. |
Résultat | array |
public read ( string $category, string $locale, string $scope ) : array | ||
$category | string | A category. `'messageTemplate'` is the only category supported. |
$locale | string | A locale identifier. |
$scope | string | The scope for the current operation. |
Résultat | array | Returns the message template. If the scope is not equal to the current scope or `$category` is not `'messageTemplate'` null is returned. |