TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser:
TYPO3\CMS\Core\Localization\Parser\LocalizationParserInterface t3lib_l10n_parser_Llphp

Public Member Functions

 __construct ()
 
 getParsedData ($sourcePath, $languageKey, $charset='')
 

Protected Member Functions

 convertToXLIFF (array $LOCAL_LANG)
 
 createCsConvObject ()
 
 generateCacheFile ($sourcePath, $languageKey)
 
 generateCacheFileName ($sourcePath, $languageKey)
 
 getContentFromCacheFile ()
 
 isWithinWebRoot ($fileName)
 
 setCharsets ($languageKey, $charset)
 
 validateParameters ($sourcePath, $languageKey)
 

Protected Attributes

 $cacheFileName
 
 $csConvObj
 
 $hashSource
 
 $sourceCharset
 
 $targetCharset
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! Parser for PHP locallang array.

Author
Dominique Feyer dfeye.nosp@m.r@re.nosp@m.elpee.nosp@m.k.ne.nosp@m.t
Dmitry Dulepov dmitr.nosp@m.y.du.nosp@m.lepov.nosp@m.@gma.nosp@m.il.co.nosp@m.m

Definition at line 22 of file LocallangArrayParser.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::__construct ( )

Initializes the parser.

Returns
void

Definition at line 54 of file LocallangArrayParser.php.

References TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\createCsConvObject().

Member Function Documentation

◆ convertToXLIFF()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::convertToXLIFF ( array  $LOCAL_LANG)
protected

Converts the LOCAL_LANG array to XLIFF structure.

Parameters
array$LOCAL_LANG
Returns
array

Definition at line 86 of file LocallangArrayParser.php.

References $LOCAL_LANG.

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\getParsedData().

◆ createCsConvObject()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::createCsConvObject ( )
protected

Creates a character conversion object.

Returns
void

Definition at line 105 of file LocallangArrayParser.php.

References $GLOBALS, and TYPO3\CMS\Core\Utility\GeneralUtility\makeInstance().

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\__construct().

◆ generateCacheFile()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::generateCacheFile (   $sourcePath,
  $languageKey 
)
protected

Generates the cache file.

Parameters
string$sourcePath
string$languageKey
Returns
array
Exceptions

Definition at line 123 of file LocallangArrayParser.php.

References $LOCAL_LANG, TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix(), and TYPO3\CMS\Core\Utility\GeneralUtility\writeFileToTypo3tempDir().

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\getParsedData().

◆ generateCacheFileName()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::generateCacheFileName (   $sourcePath,
  $languageKey 
)
protected

Generates the name of the cached file.

Parameters
string$sourcePath
string$languageKey
Returns
void

Definition at line 165 of file LocallangArrayParser.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\shortMD5(), and TYPO3\CMS\Core\Utility\PathUtility\stripPathSitePrefix().

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\getParsedData().

◆ getContentFromCacheFile()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::getContentFromCacheFile ( )
protected

Obtains the content from the cache file.

Returns
array

Definition at line 175 of file LocallangArrayParser.php.

References $LOCAL_LANG.

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\getParsedData().

◆ getParsedData()

◆ isWithinWebRoot()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::isWithinWebRoot (   $fileName)
protected

Checks if the file is within the web root.

Parameters
string$fileName
Returns
boolean

Definition at line 187 of file LocallangArrayParser.php.

References TYPO3\CMS\Core\Utility\GeneralUtility\getFileAbsFileName().

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\validateParameters().

◆ setCharsets()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::setCharsets (   $languageKey,
  $charset 
)
protected

Sets character sets for the language key.

Parameters
string$languageKey
string$charset
Returns
void

Definition at line 198 of file LocallangArrayParser.php.

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\getParsedData().

◆ validateParameters()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::validateParameters (   $sourcePath,
  $languageKey 
)
protected

Validates parameters for the function.

Parameters
string$sourcePath
string$languageKey
Returns
void
Exceptions

Definition at line 215 of file LocallangArrayParser.php.

References TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\isWithinWebRoot().

Referenced by TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\getParsedData().

Member Data Documentation

◆ $cacheFileName

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::$cacheFileName
protected

Definition at line 27 of file LocallangArrayParser.php.

◆ $csConvObj

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::$csConvObj
protected

Definition at line 32 of file LocallangArrayParser.php.

◆ $hashSource

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::$hashSource
protected

Definition at line 37 of file LocallangArrayParser.php.

◆ $sourceCharset

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::$sourceCharset
protected

Definition at line 42 of file LocallangArrayParser.php.

◆ $targetCharset

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::$targetCharset
protected

Definition at line 47 of file LocallangArrayParser.php.