2

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
{

1 Answer 1

5

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

Sign up to request clarification or add additional context in comments.

2 Comments

Ok thanks, how do I find out what the name of the command and argument?
@richelliot you use the configure function -> symfony.com/doc/current/cookbook/console/console_command.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.