Support

UNiTE, Remote CLI, eXtract Wizard

#20838 Undocumented dbport element in databaseInfo

Posted in ‘UNiTE and Remote CLI’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Environment Information

PHP version
n/a
Tool
UNiTE
Tool version
n/a

jguice
 Hi, also googled the following (which matches no results):

akeeba "unite" "dbport"

It seems this setting is undocumented. Can you please add it? :)

Originally I was adding the port to the end of the host (like one has to do in the joomla ui).

This works in the validator step but the port is later dropped when creating the restore site configuration which obviously breaks the process.

Adding <dbport>3006</dbport> to the <databaseInfo> section seems to work throughout (which I only discovered by reading the code).

Thanks,
Josh

jguice
Ok, I see why maybe it was undocumented. It doesn't actually work ;)

I've updated engine/step/configupdate.php to append the port to the host entry in the configuration.php file if it's set. Here's the diff:

--- a/engine/step/configupdate.php
+++ b/engine/step/configupdate.php
@@ -77,7 +77,16 @@ class UStepConfigupdate extends UAbstractPart
                        $dbKey = 'site';
                }
 
-               $this->config['host']            = $this->siteDef['databaseInfo'][$dbKey]['dbhost'];
+               # append custom port to host in joomla configuration if set
+               if (array_key_exists('dbport', $this->siteDef['databaseInfo'][$dbKey]))
+               {
+                       $this->config['host']            = $this->siteDef['databaseInfo'][$dbKey]['dbhost'] . ':' . $this->siteDef['databaseInfo'][$dbKey]['dbport'];
+               }
+               else
+               {
+                       $this->config['host']            = $this->siteDef['databaseInfo'][$dbKey]['dbhost'];
+               }
+
                $this->config['user']            = $this->siteDef['databaseInfo'][$dbKey]['dbuser'];
                $this->config['password']        = $this->siteDef['databaseInfo'][$dbKey]['dbpass'];
                $this->config['db']                      = $this->siteDef['databaseInfo'][$dbKey]['dbname'];

nicholas
Akeeba Staff
Manager
You can simply add the port to the dbhost tag. For example:
<dbhost>mysql.example.com:8306</dbhost>

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

jguice
Hi, yeah it wasn't working ;)

"Originally I was adding the port to the end of the host (like one has to do in the joomla ui).

This works in the validator step but the port is later dropped when creating the restore site configuration which obviously breaks the process."

nicholas
Akeeba Staff
Manager
OK, then I'll include your patch :)

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: Typically we work Monday to Friday, 9am to 7pm Cyprus timezone (EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets, but we cannot respond to them, outside of our working hours.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!

Summer vacations: Our support will be closed for replies and new tickets from August 6th to August 21st, 2022 due to summer vacations.