国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman有類(lèi)型laravel tinker的工具嗎

hon陳爍臨

webman有類(lèi)型laravel tinker的工具嗎

習(xí)慣使用laravel tinker 調(diào)試代碼,webman有沒(méi)有類(lèi)似方案?

1604 1 0
1個(gè)回答

hon陳爍臨

消滅0回答

使用 psy/psysh 簡(jiǎn)單實(shí)現(xiàn)一個(gè) tinker 命令 ,基本可用。 效果如下:
截圖

命令代碼如下:


namespace app\command;

use Psy\Configuration;
use Psy\Shell;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;

class Tinker extends Command
{
    protected static $defaultName = 'tinker';
    protected static $defaultDescription = 'Interact with your application';

    /**
     * @return void
     */
    protected function configure()
    {
        $this->addArgument('name', InputArgument::OPTIONAL, 'Name description');
    }

    /**
     * @param InputInterface $input
     * @param OutputInterface $output
     * @return int
     */
    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $this->getApplication()->setCatchExceptions(false);

        $config = new Configuration([
            'updateCheck' => 'never',
        ]);

        $shell = new Shell($config);
        // 通過(guò)命令參數(shù)傳入需要 include的文件路徑
        // $shell->setIncludes();

        try {
            $shell->run();
        } finally {
        }
    }
}
  • 暫無(wú)評(píng)論
年代過(guò)于久遠(yuǎn),無(wú)法發(fā)表回答
??