X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=bin%2Fsetup.lib.sh;h=e385acfa709b4839f9a846f2746418da6fb6e800;hb=18cb89ba4473950a7a4913c49b088043dc8d195f;hp=d98f2f52e27b1bcb1a9baf6719fb2720f8f16225;hpb=ee9c028679b097f6f7e92f367a6cb8da3fd54037;p=civicrm-core.git diff --git a/bin/setup.lib.sh b/bin/setup.lib.sh index d98f2f52e2..e385acfa70 100644 --- a/bin/setup.lib.sh +++ b/bin/setup.lib.sh @@ -55,3 +55,20 @@ function has_commands() { done return 0 } + +## Execute some PHP within CMS context +## usage: cms_eval '' +function cms_eval() { + case "$GENCODE_CMS" in + Drupal*) + drush ev "$1" + ;; + WordPress*) + wp eval "$1" + ;; + *) + echo "Cannot boot (GENCODE_CMS=$GENCODE_CMS)" > /dev/stderr + exit 1 + ;; + esac +}