Merge with 3.7

This commit is contained in:
Romain Neutron
2012-10-10 11:34:21 +02:00
30 changed files with 586 additions and 396 deletions

View File

@@ -15,9 +15,11 @@
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
use Alchemy\Phrasea\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Process\ProcessBuilder;
class module_console_sphinxGenerateSuggestion extends Command
{
@@ -59,15 +61,21 @@ class module_console_sphinxGenerateSuggestion extends Command
return 1;
}
$builder = ProcessBuilder::create(array('/usr/local/bin/indexer'));
$builder->add('metadatas' . $index)
->add('--buildstops')
->add($tmp_file)
->add(1000000)
->add('--buildfreqs');
$builder->getProcess()->run();
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);
try {
$connbas = connection::getPDOConnection($this->container, $sbas_id);
} catch (Exception $e) {