protected function addHostName($no_browser)
    {
        $host = ProjectX::getProjectConfig()
            ->getHost();

        if (!empty($host)) {
            $hostsfile = (new HostsFile())
                ->setLine('127.0.0.1', $host['name']);

            (new HostsFileWriter($hostsfile))->add();

            $this->say(
                sprintf('Added %s to hosts file.', $host['name'])
            );

            if (!$no_browser && $host['open_on_startup'] == 'true') {
                $this->taskOpenBrowser('http://' . $host['name'])
                    ->run();
            }
        }

        return $this;
    }
protected function addHostName($no_browser)
    {
        $host = ProjectX::getProjectConfig()
            ->getHost();

        if (!empty($host)) {
            $hostsfile = (new HostsFile())
                ->setLine('127.0.0.1', $host['name']);

            (new HostsFileWriter($hostsfile))->add();

            $this->say(
                sprintf('Added %s to hosts file.', $host['name'])
            );

            if (!$no_browser && $host['open_on_startup'] == 'true') {
                $this->taskOpenBrowser('http://' . $host['name'])
                    ->run();
            }
        }

        return $this;
    }
protected function addHostName ( $ no_browser ) { $ host = ProjectX :: getProjectConfig ( ) -> getHost ( ) ; if ( ! empty ( $ host ) ) { $ hostsfile = ( new HostsFile ( ) ) -> setLine ( '127.0.0.1' , $ host [ 'name' ] ) ; ( new HostsFileWriter ( $ hostsfile ) ) -> add ( ) ; $ this -> say ( sprintf ( 'Added %s to hosts file.' , $ host [ 'name' ] ) ) ; if ( ! $ no_browser && $ host [ 'open_on_startup' ] == 'true' ) { $ this -> taskOpenBrowser ( 'http://' . $ host [ 'name' ] ) -> run ( ) ; } } return $ this ; }
Add hostname to hosts file.

@param bool $no_browser
Don't open the browser window.

@return self
@throws \Exception
Add hostname to hosts file .