mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 11:33:17 +00:00
Upgrade console commands
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -77,11 +77,35 @@ class module_console_systemUpgrade extends Command
|
|||||||
|
|
||||||
foreach ($credentials as $key => $value)
|
foreach ($credentials as $key => $value)
|
||||||
{
|
{
|
||||||
$key = $key == 'hostname' ? 'host' : $key;
|
$key = $key == 'hostname' ? 'host' : $key;
|
||||||
$connexions['main_connexion'][$key] = (string) $value;
|
$connexions['main_connexion'][$key] = (string) $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
$Core->getConfiguration()->setConnexions($connexions);
|
$Core->getConfiguration()->setConnexions($connexions);
|
||||||
|
|
||||||
|
|
||||||
|
$configs = $Core->getConfiguration()->getConfigurations();
|
||||||
|
|
||||||
|
$retrieve_old_parameters = function()
|
||||||
|
{
|
||||||
|
require __DIR__ . '/../../../../config/config.inc';
|
||||||
|
|
||||||
|
return array(
|
||||||
|
'servername' => $servername
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
$old_parameters = $retrieve_old_parameters();
|
||||||
|
|
||||||
|
foreach ($configs as $env => $conf)
|
||||||
|
{
|
||||||
|
if (isset($configs[$env]['phraseanet']))
|
||||||
|
{
|
||||||
|
$configs[$env]['phraseanet']['servername'] = $old_parameters['servername'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$Core->getConfiguration()->setConfigurations($configs);
|
||||||
|
|
||||||
$Core->getConfiguration()->setEnvironnement('prod');
|
$Core->getConfiguration()->setEnvironnement('prod');
|
||||||
}
|
}
|
||||||
catch (\Exception $e)
|
catch (\Exception $e)
|
||||||
@@ -111,7 +135,7 @@ class module_console_systemUpgrade extends Command
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
$Core = \bootstrap::getCore();
|
$Core = \bootstrap::getCore();
|
||||||
$output->write('<info>Upgrading...</info>', true);
|
$output->write('<info>Upgrading...</info>', true);
|
||||||
$appbox = appbox::get_instance($Core);
|
$appbox = appbox::get_instance($Core);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user