diff --git a/bin/setup b/bin/setup index cd5a79493d..d6149e5d7a 100755 --- a/bin/setup +++ b/bin/setup @@ -75,4 +75,6 @@ $app->command(new CheckEnvironment('check:system')); $app->command(new Install('system:install')); $app->command(new CrossDomainGenerator()); +$app['phraseanet.setup_mode'] = true; + exit(is_int($app->run()) ? : 1); diff --git a/lib/Alchemy/Phrasea/Command/Setup/Install.php b/lib/Alchemy/Phrasea/Command/Setup/Install.php index b2cca64d52..51557641ef 100644 --- a/lib/Alchemy/Phrasea/Command/Setup/Install.php +++ b/lib/Alchemy/Phrasea/Command/Setup/Install.php @@ -12,13 +12,13 @@ namespace Alchemy\Phrasea\Command\Setup; use Alchemy\Phrasea\Command\Command; -use Symfony\Component\Console\Input\ArrayInput; use Doctrine\DBAL\Driver\Connection; +use Symfony\Component\Console\Helper\DialogHelper; +use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Process\ExecutableFinder; -use Symfony\Component\Console\Helper\DialogHelper; class Install extends Command { @@ -41,7 +41,6 @@ class Install extends Command ->addOption('db-template', null, InputOption::VALUE_OPTIONAL, 'Metadata structure language template (available are fr (french) and en (english))', null) ->addOption('databox', null, InputOption::VALUE_OPTIONAL, 'Database name for the DataBox', null) ->addOption('appbox', null, InputOption::VALUE_OPTIONAL, 'Database name for the ApplicationBox', null) - ->addOption('indexer', null, InputOption::VALUE_OPTIONAL, 'Path to Phraseanet Indexer', 'auto') ->addOption('data-path', null, InputOption::VALUE_OPTIONAL, 'Path to data repository', realpath(__DIR__ . '/../../../../../datas')) ->addOption('server-name', null, InputOption::VALUE_OPTIONAL, 'Server name') ->addOption('indexer', null, InputOption::VALUE_OPTIONAL, 'Path to Phraseanet Indexer', 'auto') @@ -98,7 +97,6 @@ class Install extends Command list($email, $password) = $this->getCredentials($input, $output, $dialog); $dataPath = $this->getDataPath($input, $output, $dialog); $serverName = $this->getServerName($input, $output, $dialog); - $indexer = $this->getindexer($input, $output); if (!$input->getOption('yes')) { $continue = $dialog->askConfirmation($output, "Phraseanet is going to be installed, continue ? (N/y)", false); @@ -110,7 +108,6 @@ class Install extends Command } } - $this->container['phraseanet.installer']->setPhraseaIndexerPath($indexer); $this->container['phraseanet.installer']->install($email, $password, $abConn, $serverName, $dataPath, $dbConn, $template, $this->detectBinaries()); if (null !== $this->getApplication()) { @@ -301,17 +298,6 @@ class Install extends Command return $serverName; } - private function getindexer(InputInterface $input, OutputInterface $output) - { - if ($input->getOption('indexer') == 'auto') { - $indexer = $this->executableFinder->find('phraseanet_indexer'); - } else { - $indexer = $input->getOption('indexer'); - } - - return $indexer; - } - private function detectBinaries() { return [ diff --git a/lib/Alchemy/Phrasea/Core/Provider/TasksServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/TasksServiceProvider.php index b01d9cb755..6972f12875 100644 --- a/lib/Alchemy/Phrasea/Core/Provider/TasksServiceProvider.php +++ b/lib/Alchemy/Phrasea/Core/Provider/TasksServiceProvider.php @@ -22,6 +22,7 @@ use Alchemy\Phrasea\TaskManager\Job\WebhookJob; use Alchemy\Phrasea\TaskManager\Job\WriteMetadataJob; use Alchemy\Phrasea\TaskManager\Job\Factory as JobFactory; use Alchemy\Phrasea\TaskManager\LiveInformation; +use Alchemy\Phrasea\TaskManager\NullNotifier; use Alchemy\Phrasea\TaskManager\TaskManagerStatus; use Alchemy\Phrasea\TaskManager\Log\LogFileFactory; use Alchemy\Phrasea\TaskManager\Notifier; @@ -33,6 +34,10 @@ class TasksServiceProvider implements ServiceProviderInterface public function register(Application $app) { $app['task-manager.notifier'] = $app->share(function (Application $app) { + if (isset($app['phraseanet.setup_mode']) && $app['phraseanet.setup_mode']) { + return new NullNotifier(); + } + return Notifier::create($app['monolog'], $app['task-manager.options']); }); diff --git a/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php b/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php index 5b2a78ffd6..80f1703a43 100644 --- a/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php +++ b/lib/Alchemy/Phrasea/Model/Manipulator/TaskManipulator.php @@ -28,14 +28,14 @@ class TaskManipulator implements ManipulatorInterface /** @var TranslatorInterface */ private $translator; - public function __construct(ObjectManager $om, TranslatorInterface $translator, NotifierInterface $notifier=null) + public function __construct(ObjectManager $om, TranslatorInterface $translator, NotifierInterface $notifier = null) { $this->om = $om; $this->translator = $translator; $this->setNotifier($notifier); } - public function setNotifier(NotifierInterface $notifier=null) + public function setNotifier(NotifierInterface $notifier = null) { $this->notifier = $notifier ?: new NullNotifier(); return $this; diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/IndexerJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/IndexerJob.php index c7f166e2e7..050f851754 100644 --- a/lib/Alchemy/Phrasea/TaskManager/Job/IndexerJob.php +++ b/lib/Alchemy/Phrasea/TaskManager/Job/IndexerJob.php @@ -11,16 +11,7 @@ namespace Alchemy\Phrasea\TaskManager\Job; -use Alchemy\Phrasea\Core\PhraseaTokens; -use Alchemy\Phrasea\SearchEngine\Elastic\Indexer\BulkOperation; -use Alchemy\Phrasea\SearchEngine\Elastic\Fetcher\ScheduledIndexationRecordFetcher; -use Alchemy\Phrasea\SearchEngine\Elastic\RecordHelper; use Alchemy\Phrasea\TaskManager\Editor\IndexerEditor; -use Alchemy\Phrasea\TaskManager\Editor\SubdefsEditor; -use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Platforms\SQLAnywhere11Platform; -use Doctrine\DBAL\SQLParserUtils; -use MediaAlchemyst\Transmuter\Image2Image; class IndexerJob extends AbstractJob {