summaryrefslogtreecommitdiff
path: root/FunnyQuestion.conf.php.sh
diff options
context:
space:
mode:
Diffstat (limited to 'FunnyQuestion.conf.php.sh')
-rwxr-xr-xFunnyQuestion.conf.php.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/FunnyQuestion.conf.php.sh b/FunnyQuestion.conf.php.sh
new file mode 100755
index 00000000..1ca39d1a
--- /dev/null
+++ b/FunnyQuestion.conf.php.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+IP=$(realpath "$(dirname "$0")")
+
+cmd="date -u +%V\`uname\`|sha256sum|sed 's/\W//g'"
+answer="$(eval "$cmd")"
+
+declare -A prompts
+prompts[en]='What is the output of the command <tt>%s</tt>?'
+
+{
+ echo '<?php'
+ echo -n '$wgFunnyQuestions = array('
+
+ nl='\n'
+ for lang in "${!prompts[@]}"; do
+ printf "${nl}\t\"${lang}\" => array(\"${prompts[$lang]}\" => \"%s\")" "$cmd" "$answer"
+ nl=',\n'
+ done
+
+ echo
+ echo ');'
+} > "$IP/FunnyQuestion.conf.php"
+
+touch "$IP/extensions/FunnyQuestion/FunnyQuestion.i18n.php"