Last active
October 3, 2018 08:47
-
-
Save nyanloutre/5f640d5d7074f3db7e3815d5937eee58 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'' | |
<?php | |
$config = array(); | |
${concatStrings ( | |
mapAttrsToList (name: value: | |
"$config['${name}'] = " + | |
(if isInt value then | |
"${toString value}" | |
else if isString value then | |
"'${value}'" | |
else if isBool value then | |
(a: if a then "true" else "false") value | |
else if isList value then | |
'' | |
array( | |
${foldr (item: prev: "'${item}',\n${prev}") "" value} | |
)'' | |
else | |
"null") | |
+ ";\n" | |
) cfg.config)} | |
'' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment