X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FGlobalFunctions.php;h=6f49a141e1822f617d6fe8370f7def1b5ea13937;hb=ade631c612cc9c86c133005f5e898041b9240084;hp=2ad626c0020bb14f7c204934dcf8360bfbf2484c;hpb=ac65f88c211746312fb84e94ea04d5b53efcea9d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 2ad626c002..6f49a141e1 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1446,7 +1446,7 @@ function wfHostname() { * hostname of the server handling the request. * * @param string $nonce Value from OutputPage::getCSPNonce - * @return string + * @return string|WrappedString HTML */ function wfReportTime( $nonce = null ) { global $wgShowHostnames; @@ -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. *