Commit 62cc0d96 authored by Andreas Wolf's avatar Andreas Wolf Committed by Thomas Löffler
Browse files

[CLEANUP] Remove dependency to 4.x EXT:em

Change-Id: I6c60d937b4b96a0d2f4d95bb611cdf329dede9b7
Reviewed-on: https://review.typo3.org/50617

Reviewed-by: Thomas Löffler's avatarThomas Löffler <loeffler@spooner-web.de>
Tested-by: Thomas Löffler's avatarThomas Löffler <loeffler@spooner-web.de>
parent 4956cc4c
......@@ -47,11 +47,6 @@ class Tx_TerFe2_Provider_FileProvider extends Tx_TerFe2_Provider_AbstractProvide
*/
public function initializeProvider()
{
// Check if extension manager is loaded
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('em')) {
throw new Exception('Required system extension "em" is not loaded');
}
// Set extension root path
if (!empty($this->configuration['extensionRootPath'])) {
$this->extensionRootPath = $this->configuration['extensionRootPath'];
......
......@@ -520,10 +520,6 @@ class Tx_TerFe2_Utility_File
*/
public static function createExtEmconfFile($extKey, array $emConfArray)
{
if (!\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('em')) {
throw new Exception('System extension "em" is required to generate ext_emconf.php');
}
$content = '<?php
/**
......@@ -536,13 +532,31 @@ class Tx_TerFe2_Utility_File
* writing. "version" and "dependencies" must not be touched!
*/
$EM_CONF[$_EXTKEY] = ' . tx_em_Tools::arrayToCode($emConfArray, 0) . ';
$EM_CONF[$_EXTKEY] = ' . self::arrayToCode($emConfArray, 0) . ';
';
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) : "'"
. \TYPO3\CMS\Core\Utility\GeneralUtility::slashJS(trim($v), 1) . "'") . ',' . 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