blob: edf1ed5fe00e5177b21c0c7bcabd3210e394e3f0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
#!/bin/sh
TMPFILE=$(mktemp)
grep 'hook_.*(' ../classes/pluginhost.php | sed -e 's#[\t ]*/[* ]*##' \
-e 's# [*]/$##' \
-e 's# *(byref) *##' \
-e 's#GLOBAL: ##' | while read F; do
cat << EOF >> $TMPFILE
function $F {
user_error("Dummy method invoked.", E_USER_ERROR);
}
EOF
done
cat ../classes/plugin-template.php | while IFS=\n read L; do
case $L in
*PluginTemplate* )
echo "$L" | sed 's/PluginTemplate/Plugin/'
;;
*AUTO_GENERATED_HOOKS_GO_HERE* )
echo "\t/* plugin hook methods (auto-generated) */\n"
cat $TMPFILE
;;
* )
echo "$L"
;;
esac
done > ../classes/plugin.php
rm -f -- $TMPFILE
|