2021-11-13 15:18:05 +00:00
|
|
|
#!/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
|
|
|
|
|
2021-11-13 15:21:04 +00:00
|
|
|
cat ../classes/plugin-template.php | while IFS=\n read L; do
|
2021-11-13 15:18:05 +00:00
|
|
|
case $L in
|
2021-11-13 15:21:04 +00:00
|
|
|
*PluginTemplate* )
|
|
|
|
echo "$L" | sed 's/PluginTemplate/Plugin/'
|
|
|
|
;;
|
2021-11-13 15:18:05 +00:00
|
|
|
*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
|