私はsymfony3に関する大きなプロジェクトを持っていました。このプロジェクトで私はProjectFrameworkBundleを持っています。"xxx"名前空間に定義されたコマンドがありません
プロジェクト/ FrameworkBundle /コンソール/ 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);
//...
}
私は任意のコマンドを作ってあげる場合は、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 staff
}
abstract protected function executeJob(InputInterface $input, OutputInterface $output);
// ...
}
、私はextends Project\FrameworkBundle\Console\Command
からextends Project\QueueBundle\Console\Command
に花子のコマンドを変更すると、それは、コマンドの一覧から隠しています。 executeCommand
からQueueBundle
に全員を削除しようとしましたが、それは私を助けませんでした。しかし、私はこのコマンドでPHPコードで何か間違いを犯すと、私は例外を参照してください。
何が間違っていますか?私の間違いはどこか、これはバグです。どこで使用可能なコマンドを収集しチェックするsymfonyコードが見つかりましたか?
ありがとうございます!
P.S.問題はファイル名やクラス名に問題がありません。何度もチェックしました。もちろん、私は親クラスを変更するとき、私は関数名を変更します。
質問にお答えしてくれてありがとうございましたが、理由を見つけました。私は以下で書きます。 –
Ahh、ok。ようこそ! – Rinat