Change deprecated $app->getCfg() to $app->get().
Closes #3812