0

サービスでコマンドを実行する必要があります

app/console fos:elastica:populate --no-reset --index=profile --type=team

ターミナルではすべて正常に動作しますが、サービスで実行する必要があります

 $application = new \Symfony\Bundle\FrameworkBundle\Console\Application($this->kernel);
        $application->setAutoExit(false);
        //Upload in Elastic
        $options = array('command' => 'fos:elastica:populate', "--no-reset" => true, "--index=profile" => true, "--type=team" => true);
        $upload = $application->run(new \Symfony\Component\Console\Input\ArrayInput($options));

エラーがあります:

[InvalidArgumentException]                    
The "--index=profile" option does not exist.  
4

2 に答える 2

0

解決しました

        $options = array('command' => 'fos:elastica:populate', "--no-reset" => true, "--index" => 'profile', "--type" => 'team');
        $upload = $application->run(new \Symfony\Component\Console\Input\ArrayInput($options));
于 2015-12-24T14:02:42.773 に答える