When you try to use SiteConfiguration::getConfig() to get other wiki's configurations, the code tries to call out to maintenance/getConfiguration.php via shell. The problem is that Maintenance.php has this check:
if ( isset( $_SERVER ) && isset( $_SERVER['REQUEST_METHOD'] ) ) { $this->error( 'This script must be run from the command line', true ); }
Which fails since the request inherits REQUEST_METHOD from the webserver request via environment. If you do putenv('REQUEST_METHOD'); before the call (which eliminates REQUEST_METHOD from the environment) the call works.