vendor/codeages/plugin-bundle/Command/PluginRemoveCommand.php

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace Codeages\PluginBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Codeages\PluginBundle\System\PluginRegister;

class PluginRemoveCommand extends ContainerAwareCommand
{
    protected function configure()
    {
        $this
            ->setName('plugin:remove')
            ->addArgument('code', InputArgument::REQUIRED, 'Plugin code.')
            ->addOption('with-deleting-database', null, InputOption::VALUE_NONE, 'remove database?')
            ->setDescription('Remove plugin.');
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $biz = $this->getContainer()->get('biz');
        $rootDir = dirname($this->getContainer()->getParameter('kernel.root_dir'));

        $code = $input->getArgument('code');

        $register = new PluginRegister($rootDir, 'plugins', $biz);

        $output->writeln(sprintf('Remove plugin <comment>%s</comment> :', $code));

        $output->write('  - Remove plugin registed info.');
        $metas = $register->removePlugin($code);
        $output->writeln('  <info>[Ok]</info>');

        $output->write('  - Refresh plugin cache.');
        $register->refreshInstalledPluginConfiguration();
        $output->writeln('<info>[Ok]</info>');

        $output->writeln("<info>Finished!</info>\n");
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。