app/Console/Commands/CMSMigrationTool.php
protected function getInputAndOutputDisk()
    {
        $validInputPath = FALSE;
        $validOutputPath = FALSE;

        //runs as long as user enters valid input root path
        while(!$validInputPath){
            $goBack = FALSE;
            $rootInput = $this->choice('Which input disk?', array_keys(config('filesystems.disks.cms.migrations')), 0);
            if ($rootInput == 'custom_input') {
                while(!$validInputPath && !$goBack){
                    $rootInput = $this->ask('Please enter root-Path for Input-CMS');
                    if ($rootInput === 'x'){
                        $goBack = TRUE;
                    }
                    if(!file_exists($rootInput)){
                        $this->info('Invalid Path! Please enter valid Root-Path');
                        $this->info("\n" . '[x] -> Go back');
                    }
                    else {
                        $validInputPath = TRUE;
                    }
                }
            } else{
                //default-input-path
                $validInputPath = TRUE;
            }
        }
        //runs as long as user enters valid output root path
        while(!$validOutputPath){
            $goBack = FALSE;
            $rootOutput = $this->choice('Which output disk?', array_keys(config('filesystems.disks.cms.migrations')), 1);
            if ($rootOutput == 'custom_output') {
                while(!$validOutputPath && !$goBack){
                    $rootOutput = $this->ask('Please enter root-Path for Output-CMS');
                    if ($rootOutput === 'x'){
                        $goBack = TRUE;
                    }
                    if(!file_exists($rootOutput)){
                        $this->info('Invalid Path! Please enter valid Root-Path');
                        $this->info("\n" . '[x] -> Go back');
                    }
                    else {
                        $validOutputPath = TRUE;
                    }
                }
            } else{
                //default-output-path
                $validOutputPath = TRUE;
            }
        }
        return array($rootInput, $rootOutput);
    }
protected function getInputAndOutputDisk()
    {
        $validInputPath = FALSE;
        $validOutputPath = FALSE;

        //runs as long as user enters valid input root path
        while(!$validInputPath){
            $goBack = FALSE;
            $rootInput = $this->choice('Which input disk?', array_keys(config('filesystems.disks.cms.migrations')), 0);
            if ($rootInput == 'custom_input') {
                while(!$validInputPath && !$goBack){
                    $rootInput = $this->ask('Please enter root-Path for Input-CMS');
                    if ($rootInput === 'x'){
                        $goBack = TRUE;
                    }
                    if(!file_exists($rootInput)){
                        $this->info('Invalid Path! Please enter valid Root-Path');
                        $this->info("\n" . '[x] -> Go back');
                    }
                    else {
                        $validInputPath = TRUE;
                    }
                }
            } else{
                //default-input-path
                $validInputPath = TRUE;
            }
        }
        //runs as long as user enters valid output root path
        while(!$validOutputPath){
            $goBack = FALSE;
            $rootOutput = $this->choice('Which output disk?', array_keys(config('filesystems.disks.cms.migrations')), 1);
            if ($rootOutput == 'custom_output') {
                while(!$validOutputPath && !$goBack){
                    $rootOutput = $this->ask('Please enter root-Path for Output-CMS');
                    if ($rootOutput === 'x'){
                        $goBack = TRUE;
                    }
                    if(!file_exists($rootOutput)){
                        $this->info('Invalid Path! Please enter valid Root-Path');
                        $this->info("\n" . '[x] -> Go back');
                    }
                    else {
                        $validOutputPath = TRUE;
                    }
                }
            } else{
                //default-output-path
                $validOutputPath = TRUE;
            }
        }
        return array($rootInput, $rootOutput);
    }
protected function getInputAndOutputDisk ( ) { $ validInputPath = FALSE ; $ validOutputPath = FALSE ; //runs as long as user enters valid input root path while ( ! $ validInputPath ) { $ goBack = FALSE ; $ rootInput = $ this -> choice ( 'Which input disk?' , array_keys ( config ( 'filesystems.disks.cms.migrations' ) ) , 0 ) ; if ( $ rootInput == 'custom_input' ) { while ( ! $ validInputPath && ! $ goBack ) { $ rootInput = $ this -> ask ( 'Please enter root-Path for Input-CMS' ) ; if ( $ rootInput === 'x' ) { $ goBack = TRUE ; } if ( ! file_exists ( $ rootInput ) ) { $ this -> info ( 'Invalid Path! Please enter valid Root-Path' ) ; $ this -> info ( "\n" . '[x] -> Go back' ) ; } else { $ validInputPath = TRUE ; } } } else { //default-input-path $ validInputPath = TRUE ; } } //runs as long as user enters valid output root path while ( ! $ validOutputPath ) { $ goBack = FALSE ; $ rootOutput = $ this -> choice ( 'Which output disk?' , array_keys ( config ( 'filesystems.disks.cms.migrations' ) ) , 1 ) ; if ( $ rootOutput == 'custom_output' ) { while ( ! $ validOutputPath && ! $ goBack ) { $ rootOutput = $ this -> ask ( 'Please enter root-Path for Output-CMS' ) ; if ( $ rootOutput === 'x' ) { $ goBack = TRUE ; } if ( ! file_exists ( $ rootOutput ) ) { $ this -> info ( 'Invalid Path! Please enter valid Root-Path' ) ; $ this -> info ( "\n" . '[x] -> Go back' ) ; } else { $ validOutputPath = TRUE ; } } } else { //default-output-path $ validOutputPath = TRUE ; } } return array ( $ rootInput , $ rootOutput ) ; }
Asks User to enter Root-Path of Input and Output CMS
@return array with the two strings
Asks User to enter Root - Path of Input and Output CMS