richelliot
richelliot

Reputation: 586

symfony 2 command issue

I am trying to run a php script form the command line.

sudo vim  UpdateLatestIssuesCommand.php 

But its giving me the following error:

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

I cant figure out why I am getting this error because the file its says it cant find is actually there.

Heres my code:

<?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
{

Upvotes: 2

Views: 2889

Answers (1)

Venu
Venu

Reputation: 7289

You have to run the command like this

php app/console demo:greet Fabien

where, demo:greet is the name of the command, Fabien is the argument

Reason
Because, console component has to bootstrap required resources for you before it runs the command.

FYI: Console Component

Upvotes: 5

Related Questions