67 public function getParsedData($sourcePath, $languageKey, $charset =
'') {
71 if (!file_exists($this->cacheFileName)) {
87 foreach ($LOCAL_LANG as &$keysLabels) {
88 foreach ($keysLabels as &$label) {
107 $this->csConvObj =
$GLOBALS[
'LANG']->csConvObj;
108 } elseif (is_object(
$GLOBALS[
'TSFE'])) {
109 $this->csConvObj =
$GLOBALS[
'TSFE']->csConvObj;
129 throw new \RuntimeException(
'TYPO3 Fatal Error: "' . $fileName .
'" is no TYPO3 language file!', 1308898491);
133 if (is_array(
$LOCAL_LANG[
'default']) && $this->targetCharset !==
'utf-8') {
135 $labelValue = $this->csConvObj->conv($labelValue,
'utf-8', $this->targetCharset);
139 if ($languageKey !==
'default' && is_array(
$LOCAL_LANG[$languageKey]) && $this->sourceCharset != $this->targetCharset) {
140 foreach (
$LOCAL_LANG[$languageKey] as &$labelValue) {
141 $labelValue = $this->csConvObj->conv($labelValue, $this->sourceCharset, $this->targetCharset);
147 $serContent = array(
'origFile' => $this->hashSource,
'LOCAL_LANG' => array(
'default' =>
$LOCAL_LANG[
'default'], $languageKey =>
$LOCAL_LANG[$languageKey]));
149 $serContent = array(
'origFile' => $this->hashSource,
'LOCAL_LANG' => array(
'default' =>
$LOCAL_LANG[
'default']));
153 throw new \RuntimeException(
'TYPO3 Fatal Error: "' . $res, 1308898501);
176 $serContent = (array) unserialize(file_get_contents($this->cacheFileName));
199 $this->sourceCharset = $this->csConvObj->parse_charset($this->csConvObj->charSetArray[$languageKey] ?:
'utf-8');
201 $this->targetCharset = $this->csConvObj->parse_charset($charset);
203 $this->targetCharset =
'utf-8';
216 if (!$this->
isWithinWebRoot($sourcePath) || !@is_file($sourcePath) || !$languageKey) {
217 throw new \RuntimeException(sprintf(
'Invalid source path (%s) or languageKey (%s)', $sourcePath, $languageKey), 1309245002);
generateCacheFile($sourcePath, $languageKey)
validateParameters($sourcePath, $languageKey)
static writeFileToTypo3tempDir($filepath, $content)
static makeInstance($className)
static shortMD5($input, $len=10)
convertToXLIFF(array $LOCAL_LANG)
getParsedData($sourcePath, $languageKey, $charset='')
getContentFromCacheFile()
isWithinWebRoot($fileName)
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)
static stripPathSitePrefix($path)
generateCacheFileName($sourcePath, $languageKey)
setCharsets($languageKey, $charset)