app/Commands/KickstartCommand.php
/**
     * Execute the console command.
     *
     * @return mixed
     */
Execute the console command.
@return mixed
Execute the console command . @return mixed
public function handle()
    {
        $this->line('');
        $this->line("    <options=bold,reverse;fg=magenta> Akeeba Kickstart </>");
        $this->line('');
        $installedKickstart = false;
        $latestVersion      = null;
        $currentDirectory = $this->getCurrentDirectory();
        if (!$this->checkKickstartOnDirectory($currentDirectory)) {
            $this->task("    Checking for latest version ", function () use (&$latestVersion) {
                $latestVersion = $this->getLatestVersion();
                return isset($latestVersion);
            });
            if (isset($latestVersion)) {
                $this->line("    Current Latest Version on Akeeba.com : '{$latestVersion}'");
                $this->line('');
            }
            $cacheExist = false;
            if (isset($latestVersion)) {
                $this->task("    Checking for version '{$latestVersion}' on cache ", function () use (&$cacheExist, $latestVersion) {
                    $cacheExist = $this->checkZipOnSystem($latestVersion);
                    return $cacheExist;
                });
            }
            if ($cacheExist) {
                $this->line("    Found '{$latestVersion} on cache'");
                $this->line('');
            }
            if (isset($latestVersion) && !$cacheExist) {
                $this->task("    Dowloading {$latestVersion}' ", function () use (&$cacheExist, $latestVersion) {
                    $this->downloadZipToSystem($latestVersion);
                    $cacheExist = $this->checkZipOnSystem($latestVersion);
                    return $cacheExist;
                });
            }
            if (isset($latestVersion) && $cacheExist) {
                $this->task("    Installing `{$latestVersion}` to `{$currentDirectory}` ", function ()
                     use (&$installedKickstart, $latestVersion, $currentDirectory) {
                        $this->extractVersionToDirectory($latestVersion, $currentDirectory);
                        $installedKickstart = $this->checkKickstartOnDirectory($currentDirectory);
                        return $installedKickstart;
                    });
            }
            if ($installedKickstart) {
                $this->line('');
                $this->task("    Verifying `kickstart.php` on `{$currentDirectory}` ", function () {
                    return true;
                });
            }
            $this->line('');
            $this->line('    <fg=magenta;options=bold>Check All Releases:</> ');
            $this->line('    https://www.akeeba.com/download/akeeba-kickstart.html');
            $this->line('');
        } else {
            $this->error("    Error : `kickstart.php` file already exist on `{$currentDirectory}` ");
            $this->line('');
        }
    }
public function handle ( ) { $ this -> line ( '' ) ; $ this -> line ( "     <options=bold,reverse;fg=magenta> Akeeba Kickstart </> " ) ; $ this -> line ( '' ) ; $ installedKickstart = false ; $ latestVersion = null ; $ currentDirectory = $ this -> getCurrentDirectory ( ) ; if ( ! $ this -> checkKickstartOnDirectory ( $ currentDirectory ) ) { $ this -> task ( "     Checking for latest version  " , function ( ) use ( & $ latestVersion ) { $ latestVersion = $ this -> getLatestVersion ( ) ; return isset ( $ latestVersion ) ; } ) ; if ( isset ( $ latestVersion ) ) { $ this -> line ( "     Current Latest Version on Akeeba.com : ' { $ latestVersion } ' " ) ; $ this -> line ( '' ) ; } $ cacheExist = false ; if ( isset ( $ latestVersion ) ) { $ this -> task ( "     Checking for version ' { $ latestVersion } ' on cache  " , function ( ) use ( & $ cacheExist , $ latestVersion ) { $ cacheExist = $ this -> checkZipOnSystem ( $ latestVersion ) ; return $ cacheExist ; } ) ; } if ( $ cacheExist ) { $ this -> line ( "     Found ' { $ latestVersion }  on cache' " ) ; $ this -> line ( '' ) ; } if ( isset ( $ latestVersion ) && ! $ cacheExist ) { $ this -> task ( "     Dowloading  { $ latestVersion } '  " , function ( ) use ( & $ cacheExist , $ latestVersion ) { $ this -> downloadZipToSystem ( $ latestVersion ) ; $ cacheExist = $ this -> checkZipOnSystem ( $ latestVersion ) ; return $ cacheExist ; } ) ; } if ( isset ( $ latestVersion ) && $ cacheExist ) { $ this -> task ( "     Installing ` { $ latestVersion } ` to ` { $ currentDirectory } `  " , function ( ) use ( & $ installedKickstart , $ latestVersion , $ currentDirectory ) { $ this -> extractVersionToDirectory ( $ latestVersion , $ currentDirectory ) ; $ installedKickstart = $ this -> checkKickstartOnDirectory ( $ currentDirectory ) ; return $ installedKickstart ; } ) ; } if ( $ installedKickstart ) { $ this -> line ( '' ) ; $ this -> task ( "     Verifying `kickstart.php` on ` { $ currentDirectory } `  " , function ( ) { return true ; } ) ; } $ this -> line ( '' ) ; $ this -> line ( '    <fg=magenta;options=bold>Check All Releases:</> ' ) ; $ this -> line ( '    https://www.akeeba.com/download/akeeba-kickstart.html' ) ; $ this -> line ( '' ) ; } else { $ this -> error ( "     Error : `kickstart.php` file already exist on ` { $ currentDirectory } `  " ) ; $ this -> line ( '' ) ; } }
Execute the console command.
Execute the console command .