Kirby\Cli\Command\Plugin::execute PHP Method

execute() protected method

protected execute ( Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output )
$input Symfony\Component\Console\Input\InputInterface
$output Symfony\Component\Console\Output\OutputInterface
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->input = $input;
        $this->output = $output;
        // check for a valid kirby installation
        if (!$this->isInstalled()) {
            throw new RuntimeException('Invalid Kirby installation');
        }
        // load kirby
        $this->bootstrap();
    }

Usage Example

Example #1
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     parent::execute($input, $output);
     // download and extract the plugin
     $this->fetch();
     // check if the plugin exists
     if ($this->pluginExists()) {
         if (!$this->confirm('Do you want to update this plugin?')) {
             $this->cleanUp();
             return;
         }
     } else {
         if (!$this->confirm('The plugin is not installed yet. Do you want to install it?')) {
             $this->cleanUp();
             return;
         }
     }
     try {
         $this->move();
         $this->cleanUp();
     } catch (RuntimeException $e) {
         // make sure to clean up even after errors
         $this->cleanUp();
         throw $e;
     }
 }
All Usage Examples Of Kirby\Cli\Command\Plugin::execute