src/VagrantTransient.php
protected function environmentsDown($ignoreCurrentEnvironment=false)
    {
        foreach ($this->getEnvironments() as $environment) {
            if (true == $ignoreCurrentEnvironment 
                && $environment == $this->getCurrentEnvironment()
            ) {
                $this->printLn("Skipping current environment {$environment}");
            } else if (true == file_exists($environment)) {
                chdir($environment);
                $this->printLn("Attempting shutdown down vagrant in {$environment}");
                $output = '';
                $return = '';
                exec('vagrant halt', $output, $return);
                if (false == is_array($output)) {
                    $output = array($output);
                }
                if (0 != $return) {
                    $this->printLn("Error found, logged", 'warning');
                    $this->printLn(implode(', ', $output), 'warning', false);
                } else {
                    $this->printLn(implode(', ', $output), 'notice');
                }
            } else {
                $this->printLn("Dir not found {$environment}");

            }
        }
        chdir($this->pwd);
        return $this;
    }
protected function environmentsDown($ignoreCurrentEnvironment=false)
    {
        foreach ($this->getEnvironments() as $environment) {
            if (true == $ignoreCurrentEnvironment 
                && $environment == $this->getCurrentEnvironment()
            ) {
                $this->printLn("Skipping current environment {$environment}");
            } else if (true == file_exists($environment)) {
                chdir($environment);
                $this->printLn("Attempting shutdown down vagrant in {$environment}");
                $output = '';
                $return = '';
                exec('vagrant halt', $output, $return);
                if (false == is_array($output)) {
                    $output = array($output);
                }
                if (0 != $return) {
                    $this->printLn("Error found, logged", 'warning');
                    $this->printLn(implode(', ', $output), 'warning', false);
                } else {
                    $this->printLn(implode(', ', $output), 'notice');
                }
            } else {
                $this->printLn("Dir not found {$environment}");

            }
        }
        chdir($this->pwd);
        return $this;
    }
protected function environmentsDown ( $ ignoreCurrentEnvironment = false ) { foreach ( $ this -> getEnvironments ( ) as $ environment ) { if ( true == $ ignoreCurrentEnvironment && $ environment == $ this -> getCurrentEnvironment ( ) ) { $ this -> printLn ( "Skipping current environment {$environment}" ) ; } else if ( true == file_exists ( $ environment ) ) { chdir ( $ environment ) ; $ this -> printLn ( "Attempting shutdown down vagrant in {$environment}" ) ; $ output = '' ; $ return = '' ; exec ( 'vagrant halt' , $ output , $ return ) ; if ( false == is_array ( $ output ) ) { $ output = array ( $ output ) ; } if ( 0 != $ return ) { $ this -> printLn ( "Error found, logged" , 'warning' ) ; $ this -> printLn ( implode ( ', ' , $ output ) , 'warning' , false ) ; } else { $ this -> printLn ( implode ( ', ' , $ output ) , 'notice' ) ; } } else { $ this -> printLn ( "Dir not found {$environment}" ) ; } } chdir ( $ this -> pwd ) ; return $ this ; }
This method halts every Vagrant environment.
This is the only method which executes a command.

@param bool $ignoreCurrentEnvironment tells the method to ignore the
current environment and not call halt on it.

@return $this;
This method halts every Vagrant environment . This is the only method which executes a command .