$output->writeln("<comment>Sorry you can't install Chamilo :( Installation files for version $version does not exists: </comment><info>".$sqlFolder);
$output->writeln("<comment>Sorry you can't install that version of Chamilo :( Supported versions:</comment><info>".implode(', ', $this->getAvailableVersions()));
return false;
}
/*if (!$dialog->askConfirmation(
$output,
'<comment>You are about to install Chamilo </comment><info>$version</info><comment>here:</comment>'.$configurationPath.'</info><question>Are you sure?</question>(y/N)',
false
)
) {
return;
}*/
/*
if (file_exists($configurationPath.'configuration.php') || file_exists($configurationPath.'configuration.yml')) {
if (!$dialog->askConfirmation(
$output,
'<question>There is a Chamilo installation located here:</question> '.$configurationPath.' <question>Are you sure you want to continue?</question>(y/N)',
false
)
) {
return;
}
}*/
if (file_exists($configurationPath.'configuration.php') || file_exists($configurationPath.'configuration.yml')) {
if (!$dialog->askConfirmation(
$output,
'<question>There is a Chamilo installation located here:</question> '.$configurationPath.' <question>Are you sure you want to continue?</question>(y/N)',
false
)
) {
return;
}
if (!$dialog->askConfirmation(
$output,
'<comment>This will be a fresh installation. Old databases and config files will be deleted. </comment></info><question>Are you sure?</question>(y/N)',
@ -250,12 +337,21 @@ class InstallCommand extends AbstractCommand
$input = new ArrayInput($arguments);
$command->run($input, $output);
//Getting extra information about the installation
$result = \Database::query("SELECT selected_value FROM ".\Database::get_main_table(TABLE_MAIN_SETTINGS_CURRENT)." WHERE variable = 'chamilo_database_version'");
return \Database::query("CREATE DATABASE IF NOT EXISTS ".mysql_real_escape_string($_configuration['main_database'])." DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci");
}
/**
* In step 3. Tests establishing connection to the database server.
* If it's a single database environment the function checks if the database exist.
* If the database doesn't exist we check the creation permissions.
*
* @return int 1 when there is no problem;
* 0 when a new database is impossible to be created, then the single/multiple database configuration is impossible too
* -1 when there is no connection established.
*/
public function testDatabaseConnection($dbHostForm, $dbUsernameForm, $dbPassForm)
$output->writeln("<comment>Version <info>'$versionItem'</info> does not need a DB migration</comment>");
}
}
}
$output->writeln("<comment>wow! You just finish to migrate. Too check the current status of your platform. Execute:</comment><info>chamilo:status</info>");
@ -261,7 +267,6 @@ class UpgradeCommand extends AbstractCommand
*/
public function startMigration($fromVersion, $toVersion, $dryRun, $output)
{
$output->writeln("<comment>Starting migration from version: </comment><info>$fromVersion</info><comment> to </comment><info>$toVersion ");