diff --git a/bin/console b/bin/console index a87bc8d732..b1e49cb105 100755 --- a/bin/console +++ b/bin/console @@ -45,16 +45,18 @@ try { under certain conditions; type `about:license' for details.\n\n" . ' KONSOLE KOMMANDER', Version::getName() . ' ' . Version::getNumber()); - if (!$app['phraseanet.configuration']->isInstalled()) { + if (!$app['phraseanet.configuration-tester']->isInstalled()) { throw new \RuntimeException('Phraseanet is not installed, use setup command instead'); } + if (!$app['phraseanet.configuration-tester']->isUpToDate()) { + throw new \RuntimeException('Phraseanet is not up-to-date, use setup command instead'); + } $app->command(new \module_console_aboutAuthors('about:authors')); $app->command(new \module_console_aboutLicense('about:license')); $app->command(new \module_console_checkExtension('check:extension')); - $app->command(new \module_console_systemUpgrade('system:upgrade')); $app->command(new UpgradeDBDatas('system:upgrade-datas')); $app->command(new \module_console_sphinxGenerateSuggestion('sphinx:generate-suggestions')); diff --git a/bin/setup b/bin/setup index e60040b890..501e45d386 100755 --- a/bin/setup +++ b/bin/setup @@ -48,14 +48,18 @@ try { under certain conditions; type `about:license' for details.\n\n" . ' SETUP', Version::getName() . ' ' . Version::getNumber()); - $tester = new \Alchemy\Phrasea\Setup\ConfigurationTester($app); - - $app->command(new \module_console_aboutAuthors('about:authors')); $app->command(new \module_console_aboutLicense('about:license')); - if ($tester->isInstalled()) { + if( + $app['phraseanet.configuration-tester']->isMigrable() + || $app['phraseanet.configuration-tester']->isUpgradable() + || $app['phraseanet.configuration-tester']->isInstalled() + ) { $app->command(new \module_console_systemUpgrade('system:upgrade')); + } + + if ($app['phraseanet.configuration-tester']->isInstalled()) { $app->command(new UpgradeDBDatas('system:upgrade-datas')); }