c96bb7bc9f81e68225e3109a81d78105bb91dd57
[atutor.git] / mods / wiki / tools / mkhuge
1 #!/bin/sh
2 #
3 # a shell script, which combines the ewiki.php library and some
4 # default plugins into a huger includeable script file
5 #
6
7
8 HUGE_FILE="monsterwiki.php"
9 CORE_FILE="ewiki.php"
10
11 PLUGINS3="
12         markup_phpwiki.php markup_bbcode.php spellcheck.php
13         page_orphanedpages.php page_aboutplugins.php search_highlight.php
14         mpi/mpi.php downloads.php contrib/page_wikinews.php
15         contrib/aview_imgappend.php contrib/page_phpinfo.php
16         "
17 PLUGINS2="
18         contrib/more_interwiki.php contrib/page_imagegallery.php
19         contrib/page_hitcounter.php title_calendar.php
20         page_wantedpages.php contrib/f_fixhtml.php
21         "
22 PLUGINS1="
23         diff.php page_randompage.php markup_footnotes.php
24         page_wordindex.php calendar.php notify.php
25         "
26 PLUGINS0="
27         ../fragments/strip_wonderful_slashes.php
28         ../fragments/strike_register_globals.php
29         imgresize_gd.php markup_css.php patchsaving.php
30         email_protect.php like_pages.php
31         page_pageindex.php page_powersearch.php
32         "
33
34
35
36 #-- current dir
37 if [ -e "ewiki.php" ] ; then
38         DWP=.
39 else
40         DWP=..
41 fi
42
43
44 #-- help
45 if [ "$1" == "-h" -o "$1" == "--help" ] ; then
46         echo "syntax: mkhuge [3|2|1|0]"
47         echo "combines many of the plugins and the core ewiki.php file into a bigger lib"
48         exit
49 fi
50
51
52 #-- choose size
53 N=$1 
54 if [ -z "$N" ] ; then
55         N=2
56 fi
57 if [ "$N" -ge "3" ] ; then
58         PLUGINS="$PLUGINS3 $PLUGINS"
59 fi
60 if [ "$N" -ge "2" ] ; then
61         PLUGINS="$PLUGINS2 $PLUGINS"
62 fi
63 if [ "$N" -ge "1" ] ; then
64         PLUGINS="$PLUGINS1 $PLUGINS"
65 fi
66 PLUGINS="$PLUGINS0 $PLUGINS"
67
68
69 #-- proceed
70 D="$DWP/$HUGE_FILE"
71 rm -f "$D"
72 touch "$D"
73 echo "combining: "
74 for ADD in $PLUGINS
75 do
76         echo "  +$ADD"
77         for SUB in plugins fragments ; do
78                 if [ -e "$DWP/$SUB/$ADD" ] ; then
79                         ADD=$DWP/$SUB/$ADD
80                 fi
81         done
82         cat $ADD >> $D
83 done
84 echo "  +$CORE_FILE"
85 cat $DWP/$CORE_FILE >> $D
86 echo "into $D"
87
88