60 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'lang'][
'format'][
'priority']) && trim(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'lang'][
'format'][
'priority']) !==
'') {
63 $this->supportedExtensions = array(
'xlf',
'xml',
'php');
74 public function hasData($fileReference, $languageKey) {
75 if (isset($this->data[$fileReference][$languageKey]) && is_array($this->data[$fileReference][$languageKey])) {
90 return $this->data[$fileReference];
102 return $this->data[$fileReference][$languageKey];
114 $this->data[$fileReference][$languageKey] =
$data;
125 unset($this->data[$fileReference]);
140 $this->configuration[$fileReference] = array(
141 'fileReference' => $fileReference,
142 'fileExtension' => FALSE,
143 'parserClass' => NULL,
144 'languageKey' => $languageKey,
145 'charset' => $charset
148 foreach ($this->supportedExtensions as $extension) {
149 if (@is_file(($fileWithoutExtension .
'.' . $extension))) {
150 $this->configuration[$fileReference][
'fileReference'] = $fileWithoutExtension .
'.' . $extension;
151 $this->configuration[$fileReference][
'fileExtension'] = $extension;
155 if ($this->configuration[$fileReference][
'fileExtension'] === FALSE) {
156 throw new \TYPO3\CMS\Core\Localization\Exception\FileNotFoundException(sprintf(
'Source localization file (%s) not found', $fileReference), 1306410755);
158 $extension = $this->configuration[$fileReference][
'fileExtension'];
159 if (isset(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'lang'][
'parser'][$extension]) && trim(
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'lang'][
'parser'][$extension]) !==
'') {
160 $this->configuration[$fileReference][
'parserClass'] =
$GLOBALS[
'TYPO3_CONF_VARS'][
'SYS'][
'lang'][
'parser'][$extension];
162 throw new \TYPO3\CMS\Core\Localization\Exception\InvalidParserException(
'TYPO3 Fatal Error: l10n parser for file extension "' . $extension .
'" is not configured! Please check you configuration.', 1301579637);
164 if (!class_exists($this->configuration[$fileReference][
'parserClass']) || trim($this->configuration[$fileReference][
'parserClass']) ===
'') {
165 throw new \TYPO3\CMS\Core\Localization\Exception\InvalidParserException(
'TYPO3 Fatal Error: l10n parser "' . $this->configuration[$fileReference][
'parserClass'] .
'" cannot be found or is an empty parser!', 1270853900);
177 if (!isset($this->configuration[$fileReference][
'fileReferenceWithoutExtension'])) {
178 $this->configuration[$fileReference][
'fileReferenceWithoutExtension'] = preg_replace(
'/\\.[a-z0-9]+$/i',
'', $fileReference);
180 return $this->configuration[$fileReference][
'fileReferenceWithoutExtension'];
191 if (isset($this->configuration[$fileReference][
'parserClass']) && trim($this->configuration[$fileReference][
'parserClass']) !==
'') {
192 return \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance((
string) $this->configuration[$fileReference][
'parserClass']);
194 throw new \TYPO3\CMS\Core\Localization\Exception\InvalidParserException(sprintf(
'Invalid parser configuration for the current file (%s)', $fileReference), 1307293692);
206 if (isset($this->configuration[$fileReference][
'fileReference']) && trim($this->configuration[$fileReference][
'fileReference']) !==
'') {
207 return (
string) $this->configuration[$fileReference][
'fileReference'];
209 throw new \InvalidArgumentException(sprintf(
'Invalid file reference configuration for the current file (%s)', $fileReference), 1307293693);
setData($fileReference, $languageKey, $data)
hasData($fileReference, $languageKey)
setConfiguration($fileReference, $languageKey, $charset)
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
getParserInstance($fileReference)
flushData($fileReference)
getDataByLanguage($fileReference, $languageKey)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]
static getFileAbsFileName($filename, $onlyRelative=TRUE, $relToTYPO3_mainDir=FALSE)
getAbsoluteFileReference($fileReference)
getFileReferenceWithoutExtension($fileReference)