小编Leo*_*rov的帖子

“xxx”命名空间中没有定义命令

我在 symfony3 上有一个大项目。在这个项目中,我有 ProjectFrameworkBundle。

项目/FrameworkBundle/Console/Command.php

abstract class Command extends ContainerAwareCommand
{
    //...

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        // do some regular staff
        $exitCode = $this->executeCommand($input, $output);
        // do some regular staff
    }

    abstract protected function executeCommand(InputInterface $input, OutputInterface $output);

    //...
}
Run Code Online (Sandbox Code Playgroud)

如果我要从 Command 类扩展任何命令,它将正常工作(已测试)。

但是,我还有一个包

项目/FrameworkQueue/控制台/Command.php

use Project\FrameworkBundle\Console\Command as BaseCommand;
abstract class Command extends BaseCommand
{
    // ...
    protected function executeCommand(InputInterface $input, OutputInterface $output)
    {
        // do some regular staff
        $exitCode = $this->executeJob($input, $output);
        // do some regular …
Run Code Online (Sandbox Code Playgroud)

php symfony

6
推荐指数
1
解决办法
8299
查看次数

标签 统计

php ×1

symfony ×1