add check for binary

This commit is contained in:
Nicolas Le Goff
2012-03-13 14:58:08 +01:00
parent d2e2b6d35c
commit aace1a0847

View File

@@ -61,6 +61,18 @@ class module_console_sphinxGenerateSuggestion extends Command
$output->writeln("process Databox " . $databox->get_viewname() . " / $index\n");
if(!is_executable("/usr/local/bin/indexer"))
{
$output->writeln("<error>'/usr/local/bin/indexer' is not executable</error>");
return 1;
}
if(!file_exists($tmp_file))
{
$output->writeln("<error> file '".$tmp_file."' does not exist</error>");
return 1;
}
$cmd = '/usr/local/bin/indexer metadatas' . $index . ' --buildstops ' . $tmp_file . ' 1000000 --buildfreqs';
exec($cmd);