Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
services
t3o sites
extensions.typo3.org
extensions.typo3.org
Commits
9c73da51
Commit
9c73da51
authored
Aug 06, 2020
by
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
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
extensions/ter_fe2/Classes/Utility/FileUtility.php
View file @
9c73da51
...
...
@@ -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
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment