summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2014-07-26 21:10:44 -0400
committerLuke Shumaker <lukeshu@sbcglobal.net>2014-07-26 21:10:44 -0400
commit68da4046dd3cbe1c3cccf4daa4a862594a01e80e (patch)
tree4a9a77f2e8e3fd7bef051d7db4e2e2624ed41384
parentc2bfd4b6e3ef8436c5963ace9435b4c0555f047f (diff)
Add the FunnyQuestion configuration generator
-rw-r--r--.gitignore1
-rw-r--r--FunnyQuestion.conf.php.sh23
2 files changed, 24 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index ee5a252e..44541365 100644
--- a/.gitignore
+++ b/.gitignore
@@ -31,3 +31,4 @@ images/*.*
images/cache
cache/html/*
.error.log
+FunnyQuestion.conf.php
diff --git a/FunnyQuestion.conf.php.sh b/FunnyQuestion.conf.php.sh
new file mode 100644
index 00000000..66549381
--- /dev/null
+++ b/FunnyQuestion.conf.php.sh
@@ -0,0 +1,23 @@
+#!/usr/bin/env bash
+
+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 ');'
+} > /srv/http/wiki/FunnyQuestion.conf.php
+
+touch /srv/http/wiki/extensions/FunnyQuestion/FunnyQuestion.i18n.php