Commit 9c73da51 authored by Thomas Löffler's avatar Thomas Löffler
Browse files

Use var_export to create content of ext_emconf.php file

parent c6816027
Pipeline #9396 passed with stages
in 8 minutes and 18 seconds
......@@ -503,31 +503,13 @@ class FileUtility
* writing. "version" and "dependencies" must not be touched!
*/
$EM_CONF[$_EXTKEY] = ' . self::arrayToCode($emConfArray, 0) . ';
$EM_CONF[$_EXTKEY] = ' . var_export($emConfArray, true) . ';
';
return str_replace(CR, '', $content);
}
private static function arrayToCode($array, $level = 0)
{
$lines = 'array(' . LF;
$level++;
foreach ($array as $k => $v) {
if (strlen($k) && is_array($v)) {
$lines .= str_repeat(TAB, $level) . "'" . $k . "' => " . self::arrayToCode($v, $level);
} elseif (strlen($k)) {
$lines .= str_repeat(TAB, $level) . "'" . $k . "' => "
. (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($v) ? intval($v) : "'"
. str_replace('\\', '\\\\', trim($v))) . ',' . LF;
}
}
$lines .= str_repeat(TAB, $level - 1) . ')' . ($level - 1 == 0 ? '' : ',' . LF);
return $lines;
}
/**
* Returns information about uploaded file
*
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment