This page needs updating.
Plugins are folders saved to the plugins/ directory, resembling the following structure.
└── mysql
├── README.md
├── config.yml
└── plugin.sh
plugin.sh should contain functions; all that are public must be prefixed by the plugin name:
function mysql_on_init() {
ensure_files_local_directories && succeed_because "Updated fetch structure at $(path_unresolve "$APP_ROOT" "$FETCH_FILES_PATH")"
}
Plugins may provide the following functions:
plugin_implements and call_plugin.Plugins may define private functions, but they should begin with an underscore.
function _mysql_get_remote_env() {
case $REMOTE_ENV_ID in
production)
echo 'live' && return 0
;;
staging)
echo 'test' && return 0
;;
esac
exit_with_failure "Cannot determine Pantheon environment using $REMOTE_ENV_ID"
}
fail_because && succeed_becauseexit_with_* methods; those are for the controller.Add tests to your plugin:
./live_dev_porter tests