symfony 사이트에 대한 크론 작업이 필요합니다. 내가 콘솔 명령을 만들 자습서를 발견 http://symfony.com/doc/2.1/cookbook/console/console_command.html콘솔 명령의 symfony2 문서 관리자
내 command.php
네임 스페이스 XXX에서 \ WebBundle 명령 \;
사용 심포니 \ 구성 요소 \ 콘솔 \ 명령 \ 명령; Symfony \ Component \ Console \ Input \ InputArgument; 을 사용하십시오. Symfony \ Component \ Console \ Input \ InputInterface; 을 사용하십시오. Symfony \ Component \ Console \ Input \ InputOption; 을 사용하십시오. Symfony \ Component \ Console \ Output \ OutputInterface; 을 사용하십시오. "\ WebBundle 명령 \ XXXX 정의되지 않은 메서드에
클래스 GreetCommand이 명령을 확장 { 보호 기능 구성() {
} protected function execute(InputInterface $input, OutputInterface $output) { $em = $this->getContainer()->get('doctrine')->getManager(); $em->getRepository('xxxWebBundle:Wishlist')->findAll(); // $output->writeln($text); }
}
나는 오류가 콘솔에서 명령을 호출 전화 \ MyCommand :: getContainer() " 문서 관리자가 실행 기능을 얻으려면 어떻게해야합니까?