Skip to content

Commit

Permalink
Use db_port (#33)
Browse files Browse the repository at this point in the history
This is one puzzle piece for joomla/joomla-cms#43902
  • Loading branch information
muhme authored Aug 30, 2024
1 parent d6d9c0a commit 8533937
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ After the command, the 'Joomla Installer' screen remains open in the session.

:warning: The `/installation` folder is not deleted after the installation.
This allows multiple runs of the command `installJoomla`.
For production sites the `/installation` folder needs to be deleted after installation.
For production sites the `/installation` folder needs to be deleted after installation.

See also [installJoomlaMultilingualSite](#installjoomlamultilingualsite).

Expand All @@ -230,7 +230,9 @@ cy.installJoomla(config)
##### Arguments

- **`config`** *(object)*: Configuration object containing sitename, name, username, password, email,
db_type, db_host, db_user, db_password, db_name and db_prefix.
db_type, db_host, db_port, db_user, db_password, db_name and db_prefix.

:point_right: The use of `db_port` for a non-standard database port currently (August 2024) only works for MariaDB and MySQL.

##### Example

Expand All @@ -243,6 +245,7 @@ const config = {
email: "[email protected]",
db_type: "MySQLi",
db_host: "localhost",
db_port: "3316"
db_user: "joomla",
db_password: "joomla-db-user-password",
db_name: "sample_joomla",
Expand Down Expand Up @@ -273,9 +276,11 @@ cy.installJoomlaMultilingualSite(config, languages)
##### Arguments

- **`config`** *(object)*: Configuration object containing sitename, name, username, password, email,
db_type, db_host, db_user, db_password, db_name and db_prefix.
db_type, db_host, db_port, db_user, db_password, db_name and db_prefix.
- **`languages`** *(string[], optional, default: ["French"])*: Array of additional languages to be installed.

:point_right: The use of `db_port` for a non-standard database port currently (August 2024) only works for MariaDB and MySQL.

##### Example

```javascript
Expand All @@ -287,6 +292,7 @@ const config = {
email: "[email protected]",
db_type: "MySQLi",
db_host: "localhost",
db_port: "3316",
db_user: "joomla",
db_password: "joomla-db-user-password",
db_name: "sample_joomla",
Expand Down
7 changes: 6 additions & 1 deletion src/joomla.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ const joomlaCommands = () => {
cy.get('#step2').click()

// Fill database configuration
let connection = config.db_host
if (config.db_port && config.db_port.trim() !== "") {
// host:port currently (August 2024) only work for MariaDB and MySQL
connection += `:${config.db_port.trim()}`;
}
cy.get('#jform_db_type').select(config.db_type)
cy.get('#jform_db_host').clear().type(config.db_host)
cy.get('#jform_db_host').clear().type(connection)
cy.get('#jform_db_user').type(config.db_user)

if (config.db_password) {
Expand Down

0 comments on commit 8533937

Please sign in to comment.