2013-03-27 3 views
2

PHP 스크립트를 명령 줄에서 실행하려고합니다.symfony 2 명령 문제

sudo vim UpdateLatestIssuesCommand.php 

하지만 나에게 다음과 같은 오류를주는 : 파일의 사실이 그것을 찾을 수 없습니다 말했다 때문에이 오류가있는 이유

PHP Fatal error: Class 'Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand' not found in /Applications/MAMP/htdocs/imagine-publishing/src/Imagine/CorporateBundle/Command/UpdateLatestIssuesCommand.php on line 12 

내가 알아낼 질수. Heres는

내 코드 :

<?php 

namespace Imagine\CorporateBundle\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; 

class UpdateLatestIssuesCommand extends ContainerAwareCommand 
{ 

답변

5

당신은 데모,이

php app/console demo:greet Fabien 

같은 명령을 실행해야합니다 : 인사 명령의 이름은, 파비앙 인수

입니다 이유
콘솔 구성 요소가 필요한 리소스를 부트 스트랩해야하므로 이 명령은 명령을 실행합니다.

참고 : Console Component

+0

좋아 덕분에, 내가 어떻게 알 수 있습니까 어떤 명령과 인수의 이름은? – richelliot

+1

@richelliot 당신은'configure' 함수를 사용합니다 -> http://symfony.com/doc/current/cookbook/console/console_command.html – ManseUK