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

info() protected method

Read the plugin package file and return the info as array
protected info ( )
    protected function info()
    {
        $this->info = data::read($this->tmp . '/package.json');
        // get the extension type
        if (!isset($this->info['type'])) {
            throw new RuntimeException('Invalid Kirby Plugin Type');
        }
        // check for a valid type
        if (!in_array($this->type(), ['plugin', 'field', 'tag'])) {
            throw new RuntimeException('Invalid Kirby Plugin Type: "' . $this->type() . '"');
        }
        if (!isset($this->info['name'])) {
            throw new RuntimeException('Invalid Kirby Plugin Name');
        }
        $this->output->writeln('');
        $this->output->writeln('<comment>Discovered a ' . $this->type() . ' with the name "' . $this->name() . '"</comment>');
        $this->output->writeln('');
        $this->output->writeln('<info>Description: ' . "\t" . $this->description() . '</info>');
        $this->output->writeln('<info>Repository: ' . "\t" . $this->repo() . '</info>');
        $this->output->writeln('<info>Version: ' . "\t" . $this->version() . '</info>');
        $this->output->writeln('<info>Author: ' . "\t" . $this->author() . '</info>');
        $this->output->writeln('<info>License: ' . "\t" . $this->license() . '</info>');
        $this->output->writeln('<info></info>');
    }