diff --git a/.drone.yml b/.drone.yml index 2a4379dac738c..6de9f732d93ee 100644 --- a/.drone.yml +++ b/.drone.yml @@ -149,7 +149,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cmysql mysqli mysql + - bash tests/System/drone-system-run.sh "$(pwd)" cmysql mysqli mysql 3306 - name: phpmax-system-mysql depends_on: @@ -161,7 +161,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql + - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlmax mysqli mysql 3306 when: event: exclude: @@ -180,7 +180,7 @@ steps: commands: - echo "This test is disabled because php next is not stable yet" - exit 1 - - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlnext mysqli mysql + - bash tests/System/drone-system-run.sh "$(pwd)" cmysqlnext mysqli mysql 3306 when: event: exclude: @@ -196,7 +196,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres + - bash tests/System/drone-system-run.sh "$(pwd)" cpostgres pgsql postgres 5432 when: event: exclude: @@ -212,7 +212,7 @@ steps: environment: JOOMLA_INSTALLATION_DISABLE_LOCALHOST_CHECK: 1 commands: - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres + - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresmax pgsql postgres 5432 - name: phpnext-system-postgres depends_on: @@ -227,7 +227,7 @@ steps: commands: - echo "This test is disabled because php next is not stable yet" - exit 1 - - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresnext pgsql postgres + - bash tests/System/drone-system-run.sh "$(pwd)" cpostgresnext pgsql postgres 5432 when: event: exclude: diff --git a/administrator/components/com_config/forms/application.xml b/administrator/components/com_config/forms/application.xml index 8f48019424b54..fb225afc5a44d 100644 --- a/administrator/components/com_config/forms/application.xml +++ b/administrator/components/com_config/forms/application.xml @@ -186,7 +186,12 @@ required="true" filter="string" /> - + $data['dbtype'], 'host' => $data['host'], + 'port' => $data['db_port'], 'user' => $data['user'], 'password' => $data['password'], 'database' => $data['db'], diff --git a/installation/forms/setup.xml b/installation/forms/setup.xml index 3f9c6ba350309..ee57d14f6b4a7 100644 --- a/installation/forms/setup.xml +++ b/installation/forms/setup.xml @@ -71,6 +71,12 @@ default="localhost" required="true" /> + $driver, 'host' => $host, + 'port' => $port, 'user' => $user, 'password' => $password, 'database' => $database, diff --git a/installation/src/Model/ConfigurationModel.php b/installation/src/Model/ConfigurationModel.php index 24b06d836cdea..8f41d06ad86ed 100644 --- a/installation/src/Model/ConfigurationModel.php +++ b/installation/src/Model/ConfigurationModel.php @@ -65,7 +65,8 @@ public function setup($options) $options->db_name, $options->db_prefix, true, - DatabaseHelper::getEncryptionSettings($options) + DatabaseHelper::getEncryptionSettings($options), + $options->db_port, ); } catch (\RuntimeException $e) { Factory::getApplication()->enqueueMessage(Text::sprintf('INSTL_ERROR_CONNECT_DB', $e->getMessage()), 'error'); @@ -380,6 +381,7 @@ public function createConfiguration($options) // Database settings. $registry->set('dbtype', $options->db_type); $registry->set('host', $options->db_host); + $registry->set('port', $options->db_port); $registry->set('user', $options->db_user); $registry->set('password', $options->db_pass_plain); $registry->set('db', $options->db_name); diff --git a/installation/src/Model/DatabaseModel.php b/installation/src/Model/DatabaseModel.php index d00e69737546a..ebbf4fd695a8f 100644 --- a/installation/src/Model/DatabaseModel.php +++ b/installation/src/Model/DatabaseModel.php @@ -93,7 +93,8 @@ public function initialise(array $options, bool $select = true) $options->db_name, $options->db_prefix, $select, - DatabaseHelper::getEncryptionSettings($options) + DatabaseHelper::getEncryptionSettings($options), + $options->db_port, ); } catch (\RuntimeException $e) { Factory::getApplication()->enqueueMessage(Text::sprintf('INSTL_DATABASE_COULD_NOT_CONNECT', $e->getMessage()), 'error'); diff --git a/installation/src/Model/SetupModel.php b/installation/src/Model/SetupModel.php index 9cb32473d9c7e..64d3be41d6d1c 100644 --- a/installation/src/Model/SetupModel.php +++ b/installation/src/Model/SetupModel.php @@ -261,7 +261,8 @@ public function validateDbConnection(array $options) $options->db_name, $options->db_prefix, false, - DatabaseHelper::getEncryptionSettings($options) + DatabaseHelper::getEncryptionSettings($options), + $options->db_port, ); $db->connect(); diff --git a/installation/tmpl/setup/default.php b/installation/tmpl/setup/default.php index 9b6978d193017..bf28af2fb54c0 100644 --- a/installation/tmpl/setup/default.php +++ b/installation/tmpl/setup/default.php @@ -81,6 +81,9 @@
form->renderField('db_host'); ?>
+
+ form->renderField('db_port'); ?> +
form->renderField('db_user'); ?>
diff --git a/libraries/src/Service/Provider/Database.php b/libraries/src/Service/Provider/Database.php index 76a5d033d1240..9a3a58f7765c3 100644 --- a/libraries/src/Service/Provider/Database.php +++ b/libraries/src/Service/Provider/Database.php @@ -85,6 +85,7 @@ function (Container $container) { $options = [ 'driver' => $dbtype, 'host' => $conf->get('host'), + 'port' => $conf->get('port'), 'user' => $conf->get('user'), 'password' => $conf->get('password'), 'database' => $conf->get('db'), diff --git a/tests/System/drone-system-run.sh b/tests/System/drone-system-run.sh index 7b106355bc879..94beefd8a4365 100644 --- a/tests/System/drone-system-run.sh +++ b/tests/System/drone-system-run.sh @@ -4,6 +4,7 @@ JOOMLA_BASE=$1 TEST_GROUP=$2 DB_ENGINE=$3 DB_HOST=$4 +DB_PORT=$5 echo "[RUNNER] Prepare test environment" @@ -23,4 +24,4 @@ apache2ctl -D FOREGROUND & echo "[RUNNER] Run cypress tests" chmod +rwx /root -npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,db_type=$DB_ENGINE,db_host=$DB_HOST,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=http://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/System/output/screenshots +npx cypress run --browser=firefox --e2e --env cmsPath=/tests/www/$TEST_GROUP,db_type=$DB_ENGINE,db_host=$DB_HOST,db_port=$DB_PORT,db_password=joomla_ut,db_prefix="${TEST_GROUP}_" --config baseUrl=http://localhost/$TEST_GROUP,screenshotsFolder=$JOOMLA_BASE/tests/System/output/screenshots diff --git a/tests/System/integration/install/Installation.cy.js b/tests/System/integration/install/Installation.cy.js index cc00e3b19e61c..9e20371e64541 100644 --- a/tests/System/integration/install/Installation.cy.js +++ b/tests/System/integration/install/Installation.cy.js @@ -12,12 +12,15 @@ describe('Install Joomla', () => { db_password: Cypress.env('db_password'), db_name: Cypress.env('db_name'), db_prefix: Cypress.env('db_prefix'), + db_port: Cypress.env('db_port'), }; // If exists, delete PHP configuration file to force a new installation cy.task('deleteRelativePath', 'configuration.php'); cy.installJoomla(config); + // set the db port + cy.config_setParameter('port', Cypress.env('db_port')); cy.doAdministratorLogin(config.username, config.password, false); cy.cancelTour(); cy.disableStatistics();