Kirby\Cli\Command::install PHP Method

install() protected method

protected install ( $params = [] )
    protected function install($params = [])
    {
        $options = array_merge(['repo' => 'getkirby/starterkit', 'branch' => 'master', 'path' => null, 'output' => null, 'success' => 'Done!'], $params);
        // check for a valid path
        $this->checkPath($options['path']);
        // create the file name for the temporary zip file
        $zip = $this->tmp('kirby-' . str_replace('/', '-', $options['repo']) . '-' . uniqid() . '.zip');
        // download the file
        $this->download(['repo' => $options['repo'], 'branch' => $options['branch'], 'zip' => $zip, 'output' => $options['output']]);
        // unzip the file
        $this->unzip($zip, $options['path']);
        // yay, everything is setup
        if ($options['output'] && $options['success']) {
            $options['output']->writeln('');
            $options['output']->writeln('<comment>' . $options['success'] . '</comment>');
            $options['output']->writeln('');
        }
    }