‪TYPO3CMS  ‪main
TYPO3\CMS\Core\Localization\LanguageStore Class Reference
Inheritance diagram for TYPO3\CMS\Core\Localization\LanguageStore:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 initialize ()
 
bool hasData ($fileReference, $languageKey)
 
TYPO3 CMS Core Localization LanguageStore setData ($fileReference, $languageKey, $data)
 
TYPO3 CMS Core Localization LanguageStore flushData ($fileReference)
 
TYPO3 CMS Core Localization LanguageStore setConfiguration ($fileReference, $languageKey)
 
string getFileReferenceWithoutExtension ($fileReference)
 
TYPO3 CMS Core Localization Parser LocalizationParserInterface getParserInstance ($fileReference)
 
string getAbsoluteFileReference ($fileReference)
 
 getLocalizedLabelsPathPattern (string $fileReference)
 
array getSupportedExtensions ()
 

Public Attributes

array< string, function getData( $fileReference) { return $this-> data [$fileReference]
 
array< string, function getDataByLanguage( $fileReference, $languageKey) { return $this-> data [$fileReference][$languageKey][]
 

Protected Attributes

array $supportedExtensions
 
array $configuration
 
array< string, $data;private PackageManager $packageManager;public function __construct(PackageManager $packageManager) { $this-> packageManager = $packageManager
 

Detailed Description

This class is not part of the TYPO3 Core API.

Definition at line 30 of file LanguageStore.php.

Member Function Documentation

◆ flushData()

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LanguageStore::flushData (   $fileReference)

Flushes data.

Parameters
string$fileReference
Returns
‪\TYPO3\CMS\Core\Localization\LanguageStore This instance to allow method chaining

Definition at line 140 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\data.

◆ getAbsoluteFileReference()

string TYPO3\CMS\Core\Localization\LanguageStore::getAbsoluteFileReference (   $fileReference)

Gets the absolute file path.

Parameters
string$fileReference
Returns
‪string
Exceptions

Definition at line 234 of file LanguageStore.php.

◆ getFileReferenceWithoutExtension()

string TYPO3\CMS\Core\Localization\LanguageStore::getFileReferenceWithoutExtension (   $fileReference)

Get the fileReference without the extension

Parameters
string$fileReference‪File reference
Returns
‪string

Definition at line 204 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\setConfiguration().

◆ getLocalizedLabelsPathPattern()

TYPO3\CMS\Core\Localization\LanguageStore::getLocalizedLabelsPathPattern ( string  $fileReference)

Gets the relative labels file pattern.

Exceptions

Definition at line 247 of file LanguageStore.php.

◆ getParserInstance()

TYPO3 CMS Core Localization Parser LocalizationParserInterface TYPO3\CMS\Core\Localization\LanguageStore::getParserInstance (   $fileReference)

Returns the correct parser for a specific file reference.

Parameters
string$fileReference‪File reference
Returns
‪\TYPO3\CMS\Core\Localization\Parser\LocalizationParserInterface
Exceptions

Definition at line 219 of file LanguageStore.php.

◆ getSupportedExtensions()

array TYPO3\CMS\Core\Localization\LanguageStore::getSupportedExtensions ( )

Get supported extensions

Returns
‪array

Definition at line 261 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\$supportedExtensions.

◆ hasData()

bool TYPO3\CMS\Core\Localization\LanguageStore::hasData (   $fileReference,
  $languageKey 
)

Checks if the store contains parsed data.

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
Returns
‪bool

Definition at line 83 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\data.

◆ initialize()

TYPO3\CMS\Core\Localization\LanguageStore::initialize ( )

Initializes the current class.

Definition at line 67 of file LanguageStore.php.

References $GLOBALS.

◆ setConfiguration()

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LanguageStore::setConfiguration (   $fileReference,
  $languageKey 
)

Checks file reference configuration (charset, extension, ...).

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
Returns
‪\TYPO3\CMS\Core\Localization\LanguageStore This instance to allow method chaining
Exceptions

Definition at line 155 of file LanguageStore.php.

References $GLOBALS, TYPO3\CMS\Core\Localization\LanguageStore\getFileReferenceWithoutExtension(), TYPO3\CMS\Core\Utility\PathUtility\isExtensionPath(), and TYPO3\CMS\Core\Localization\LanguageStore\packageManager.

◆ setData()

TYPO3 CMS Core Localization LanguageStore TYPO3\CMS\Core\Localization\LanguageStore::setData (   $fileReference,
  $languageKey,
  $data 
)

Sets data for a specific file reference and a language.

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
array$data
Returns
‪\TYPO3\CMS\Core\Localization\LanguageStore This instance to allow method chaining

Definition at line 128 of file LanguageStore.php.

References TYPO3\CMS\Core\Localization\LanguageStore\data.

Member Data Documentation

◆ $configuration

array TYPO3\CMS\Core\Localization\LanguageStore::$configuration
protected

Information about parsed file

If data come from the cache, this array does not contain any information about this file

Definition at line 45 of file LanguageStore.php.

◆ $supportedExtensions

array TYPO3\CMS\Core\Localization\LanguageStore::$supportedExtensions
protected

File extension supported by the localization parser

Definition at line 36 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\getSupportedExtensions().

◆ data [1/2]

array<string, function getData($fileReference) { return $this-> TYPO3\CMS\Core\Localization\LanguageStore::data[ $fileReference]

Retrieves data from the store.

This method returns all parsed languages for the current file reference.

Parameters
string$fileReference‪File reference
Returns
‪array<string, array<string, array<int, array<string, string>>>>

Definition at line 102 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\flushData(), TYPO3\CMS\Core\Localization\LanguageStore\hasData(), and TYPO3\CMS\Core\Localization\LanguageStore\setData().

◆ data [2/2]

array<string, function getDataByLanguage($fileReference, $languageKey) { return $this-> TYPO3\CMS\Core\Localization\LanguageStore::data[ $fileReference][ $languageKey][]

Retrieves data from the store for a language.

Parameters
string$fileReference‪File reference
string$languageKey‪Valid language key
Returns
‪array<string, array<int, array<string, string>>>
See also
‪self::getData()

Definition at line 117 of file LanguageStore.php.

◆ packageManager

array<string, $data; private PackageManager $packageManager; public function __construct(PackageManager $packageManager) { $this-> TYPO3\CMS\Core\Localization\LanguageStore::packageManager = $packageManager
protected

Parsed localization file

array<string, array<string, array<int, array<string, string>>>>>

Definition at line 60 of file LanguageStore.php.

Referenced by TYPO3\CMS\Core\Localization\LanguageStore\setConfiguration().