TYPO3 CMS  TYPO3_7-6
TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser:
TYPO3\CMS\Core\Localization\Parser\LocalizationParserInterface

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

Parser for PHP locallang array.

Deprecated:
since TYPO3 CMS 7, this file will be removed in TYPO3 CMS 8. Please use XLF files for translation handling. Also note that the extension "extdeveval" has a converter from PHP and XML to XLF.

Definition at line 27 of file LocallangArrayParser.php.

Constructor & Destructor Documentation

◆ __construct()

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

Initializes the parser.

Deprecated:
since TYPO3 CMS 7, will be removed in TYPO3 CMS 8. Use xlf format for parsing translations

Definition at line 59 of file LocallangArrayParser.php.

References TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser\createCsConvObject(), and TYPO3\CMS\Core\Utility\GeneralUtility\logDeprecatedFunction().

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 94 of file LocallangArrayParser.php.

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 114 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

◆ 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 176 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 187 of file LocallangArrayParser.php.

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

◆ getParsedData()

TYPO3\CMS\Core\Localization\Parser\LocallangArrayParser::getParsedData (   $sourcePath,
  $languageKey,
  $charset = '' 
)

◆ isWithinWebRoot()

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

Checks if the file is within the web root.

Parameters
string$fileName
Returns
bool

Definition at line 200 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 212 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 230 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 32 of file LocallangArrayParser.php.

◆ $csConvObj

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

Definition at line 37 of file LocallangArrayParser.php.

◆ $hashSource

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

◆ $sourceCharset

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

Definition at line 47 of file LocallangArrayParser.php.

◆ $targetCharset

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

Definition at line 52 of file LocallangArrayParser.php.