I have at least one extra with a plugin that shouldn't run during Setup.
One plugin is connected to OnUserBeforeSave, which as far as I can tell, fires in some upgrades at a point when $modx and $xpdo are not objects. Setup crashes with a "call on a non-object" error on $modx->getOption() later in the script.
As a result, I couldn't find any way to detect Setup using xPDO::OPT_SETUP.
This is the only thing I found that worked and seemed half-way safe:
if (! is_object($modx) || !empty($modx->xpdo->config[xPDO::OPT_SETUP]) ) {
return '';
}
Is there a better way?