X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=6f49a141e1822f617d6fe8370f7def1b5ea13937;hb=ade631c612cc9c86c133005f5e898041b9240084;hp=8c7e52a37310a54938ca8143d8a063699d14df44;hpb=481542b6ffb21d5f138cce92057690a1fccde5b0;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 8c7e52a373..6f49a141e1 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2670,6 +2670,28 @@ function wfGetPrecompiledData( $name ) { return false; } +/** + * @since 1.32 + * @param string[] $data Array with string keys/values to export + * @param string $header + * @return string PHP code + */ +function wfMakeStaticArrayFile( array $data, $header = 'Automatically generated' ) { + $format = "\t%s => %s,\n"; + $code = " $value ) { + $code .= sprintf( + $format, + var_export( $key, true ), + var_export( $value, true ) + ); + } + $code .= "];\n"; + return $code; +} + /** * Make a cache key for the local wiki. *