DataSift\Storyplayer\Cli\Feature_LocalhostSupport::initBeforeModulesAvailable PHP Method

initBeforeModulesAvailable() public method

public initBeforeModulesAvailable ( Phix_Project\CliEngine $engine, Phix_Project\CliEngine\CliCommand $command, DataSift\Storyplayer\Injectables $injectables )
$engine Phix_Project\CliEngine
$command Phix_Project\CliEngine\CliCommand
$injectables DataSift\Storyplayer\Injectables
    public function initBeforeModulesAvailable(CliEngine $engine, CliCommand $command, Injectables $injectables)
    {
        // create a definition for localhost
        $host = new BaseObject();
        $host->hostId = "localhost";
        $host->osName = $this->detectOs();
        $host->type = "PhysicalHost";
        $host->ipAddress = "127.0.0.1";
        $host->hostname = "localhost";
        $host->provisioned = true;
        // we need to make sure it's registered in the hosts table
        $runtimeConfigManager = $injectables->getRuntimeConfigManager();
        $runtimeConfig = $injectables->getRuntimeConfig();
        $hostsTable = $runtimeConfigManager->getTable($runtimeConfig, 'hosts');
        $testEnv = $injectables->activeTestEnvironmentName;
        if (!isset($hostsTable->{$testEnv})) {
            $hostsTable->{$testEnv} = new BaseObject();
        }
        $hostsTable->{$testEnv}->localhost = $host;
    }