Skip to content

Commit 6be9255

Browse files
authored
N°7071 - Remove CMDBSource::MYSQL_DEFAULT_PORT
1 parent edbe497 commit 6be9255

File tree

3 files changed

+6
-11
lines changed

3 files changed

+6
-11
lines changed

core/cmdbsource.class.inc.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ class CMDBSource
4242
const ENUM_DB_VENDOR_MARIADB = 'MariaDB';
4343
const ENUM_DB_VENDOR_PERCONA = 'Percona';
4444

45-
/**
46-
* @since 2.7.10 3.0.4 3.1.2 3.0.2 N°6889 constant creation
47-
* @internal will be removed in a future version
48-
*/
49-
const MYSQL_DEFAULT_PORT = 3306;
5045

5146
/**
5247
* Error: 1205 SQLSTATE: HY000 (ER_LOCK_WAIT_TIMEOUT)
@@ -220,7 +215,7 @@ public static function GetMysqliInstance(
220215
* @param string $sServer server variable to update
221216
* @param int|null $iPort port variable to update, will return null if nothing is specified in $sDbHost
222217
*
223-
* @since 2.7.10 3.0.4 3.1.2 3.2.0 N°6889 will return null in $iPort if port isn't present in $sDbHost. Use {@see MYSQL_DEFAULT_PORT} if needed
218+
* @since 2.7.10 3.0.4 3.1.2 3.2.0 N°6889 will return null in $iPort if port isn't present in $sDbHost.
224219
*
225220
* @link http://php.net/manual/en/mysqli.persistconns.php documentation for the "p:" prefix (persistent connexion)
226221
*/

setup/backup.class.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ private static function GetMysqlCliPortAndTransportOptions(string $sHost, ?int $
617617
}
618618

619619
if (is_null($iPort)) {
620-
$iPort = CMDBSource::MYSQL_DEFAULT_PORT;
620+
return '';
621621
}
622622
$sPortOption = self::GetMysqliCliSingleOption('port', $iPort);
623623

tests/php-unit-tests/unitary-tests/setup/DBBackupTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,16 +130,16 @@ public function GetMysqlCliPortAndTransportOptionsProvider()
130130
'Localhost with port' => ['localhost', $iTestPort, $iTestPort, ' --protocol=tcp'],
131131

132132
// we want both port and protocol for 127.0.0.1, because it is an ip address so using tcp/ip stack !
133-
'127.0.0.1 no port' => ['127.0.0.1', null, $iDefaultPort, ''],
133+
'127.0.0.1 no port' => ['127.0.0.1', null, null, ''],
134134
'127.0.0.1 with port' => ['127.0.0.1', $iTestPort, $iTestPort, ''],
135135

136-
'IP no port' => ['192.168.1.15', null, $iDefaultPort, ''],
136+
'IP no port' => ['192.168.1.15', null, null, ''],
137137
'IP with port' => ['192.168.1.15', $iTestPort, $iTestPort, ''],
138138

139-
'DNS no port' => ['dbserver.mycompany.com', null, $iDefaultPort, ''],
139+
'DNS no port' => ['dbserver.mycompany.com', null, null, ''],
140140
'DNS with port' => ['dbserver.mycompany.com', $iTestPort, $iTestPort, ''],
141141

142-
'Windows name no port' => ['dbserver', null, $iDefaultPort, ''],
142+
'Windows name no port' => ['dbserver', null, null, ''],
143143
'Windows name with port' => ['dbserver', $iTestPort, $iTestPort, ''],
144144
];
145145
}

0 commit comments

Comments
 (0)