php应用程序/控制台停止工作
在对我的单位稍作修改后,我想用一个简单的php应用程序/控制台停止工作,php,symfony,web,terminal,mamp,Php,Symfony,Web,Terminal,Mamp,在对我的单位稍作修改后,我想用一个简单的php应用程序/控制台原则进行更新:update--force。但是没有执行任何操作,而且没有响应。然后我做了一个php应用程序/check.php,这意味着我没有问题(您的系统已经准备好运行Symfony2项目了)。我不明白,它没有提供错误。以下是我所做的: Command: ********: ***** ProjetSymphony $ php app / console*** Answer (none): ******* **** $ Projet
php应用程序/控制台原则进行更新:update--force
。但是没有执行任何操作,而且没有响应。然后我做了一个php应用程序/check.php
,这意味着我没有问题(您的系统已经准备好运行Symfony2项目了
)。我不明白,它没有提供错误。以下是我所做的:
Command: ********: ***** ProjetSymphony $ php app / console***
Answer (none): ******* **** $ ProjetSymphony***
如果有人有主意
屏幕:
试试:
php应用程序/控制台原则:模式:更新--force
也许这只是一个语法错误。我终于发现了我的错误。我有一个命令文件阻止执行我的命令(CreateUserCommand.php) 如果有人想向我解释为什么cosait文件在执行我的订单时出错。。。 文件如下:
<?php
namespace FP\UserBundle\Command;
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use FOS\UserBundle\Model\User;
use FOS\UserBundle\Command\CreateUserCommand as BaseCommand;
class CreateUserCommand extends BaseCommand
{
/**
* @see Command
*/
protected function configure()
{
exit;
echo "tes";
parent::configure();
$this
->setName('fp:user:create')
->getDefinition()->addArguments(array(
new InputArgument('age', InputArgument::REQUIRED, 'The age')
))
;
}
/**
* @see Command
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
exit;
echo "tes";
$username = $input->getArgument('username');
$email = $input->getArgument('email');
$password = $input->getArgument('password');
$age = $input->getArgument('age');
$inactive = $input->getOption('inactive');
$superadmin = $input->getOption('super-admin');
$manipulator = $this->getContainer()->get('fos_user.util.user_manipulator');
$manipulator->setAge($age);
$manipulator->create($username, $password, $email, !$inactive, $superadmin);
$output->writeln(sprintf('Created user <comment>%s</comment>', $username));
}
/**
* @see Command
*/
protected function interact(InputInterface $input, OutputInterface $output)
{
exit;
echo "tes";
parent::interact($input, $output);
if (!$input->getArgument('age')) {
$age = $this->getHelper('dialog')->askAndValidate(
$output,
'Please choose a age:',
function($age) {
if (empty($age)) {
throw new \Exception('Lastname can not be empty');
}
return $age;
}
);
$input->setArgument('age', $age);
}
}
}
此外,如果有人试图在较新的symfony版本(例如symfony 3.0)中运行php应用程序/控制台
,您将收到一个错误:找不到文件,因为该文件已移动到“bin”文件夹。现在要从控制台运行,您必须使用phpbin/console
。以防这一变化让开始学习symfony并升级到3.0的人感到困惑 请在您运行该命令时发布终端的屏幕截图她向我介绍了任何信息…您的控制台正在运行到您的symfony应用程序路径中?假设您的symfony项目位于:“C:\user\user1\symofony\project”中,您需要在相同路径中启动控制台。我使用为我的订单制作的我的mac终端应用程序。但是,不使用Terminal pyisque命令的错误总是适用于其他项目……您的AppKernel.php中是否有new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
?是的,我的AppKernel.php中有一个Doctrine Bundle