MDL-11082 Improved groups upgrade performance 1.8x -> 1.9; thanks Eloy for telling...
[moodle-pu.git] / mod / wiki / ewiki / fragments / mkhuge
blob4a5fe5ad7c86294dcd157ff0ae8b7215e1e67078
1 #!/bin/sh
3 # a shell script, which combines the ewiki.php library and some
4 # default plugins into a huger include library
8 HUGE_FILE="huge-ewiki.php"
9 CORE_FILE="ewiki.php"
12 #-- current dir
13 if [ -e "ewiki.php" ] ; then
14 DWP=.
15 else
16 DWP=..
20 #-- help
21 if [ "$1" == "-h" -o "$1" == "--help" ] ; then
22 echo "syntax: mkhuge"
23 echo "combines many of the plugins and the core ewiki.php file into a bigger lib."
24 exit
28 #-- choose size
29 N=$1
30 if [ -z "$N" ] ; then
31 N=0
33 if [ "$1" -ge "3" ] ; then
34 PLUGINS="markup_phpwiki.php markup_bbcode.php spellcheck.php $PLUGINS"
36 if [ "$1" -ge "2" ] ; then
37 PLUGINS="more_interwiki.php page_imagegallery.php $PLUGINS"
39 if [ "$1" -ge "1" ] ; then
40 PLUGINS="diff.php page_randompage.php markup_footnotes.php page_wordindex.php $PLUGINS"
42 PLUGINS="strip_wonderful_slashes.php calendar.php email_protect.php like_pages.php page_pageindex.php page_powersearch.php $PLUGINS"
45 #-- proceed
46 echo -n "writing: $CORE_FILE"
47 cat $DWP/$CORE_FILE > $DWP/$HUGE_FILE
48 for ADD in $PLUGINS
50 echo -n "+$ADD"
51 for SUB in plugins fragments ; do
52 if [ -e "$DWP/$SUB/$ADD" ] ; then
53 ADD=$DWP/$SUB/$ADD
55 done
56 cat $ADD >> $DWP/$HUGE_FILE
57 done
58 echo " > $DWP/$HUGE_FILE"
59 echo "done."