@@ -16,17 +16,17 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
16
16
/**
17
17
* Mysql default Port.
18
18
*/
19
- const DEFAULT_PORT = 3306 ;
19
+ protected const DEFAULT_PORT = 3306 ;
20
20
21
21
/**
22
22
* MariaDB minimum version.
23
23
*/
24
- const MARIADB_MIN_VERSION = '11.4. ' ;
24
+ protected const MARIADB_MIN_VERSION = '11.4. ' ;
25
25
26
26
/**
27
27
* Name of configuration file.
28
28
*/
29
- const DEFAULTS_EXTRA_FILE_NAME = 'defaults_extra.cnf ' ;
29
+ protected const DEFAULTS_EXTRA_FILE_NAME = 'defaults_extra.cnf ' ;
30
30
31
31
/**
32
32
* MySQL DB dump file
@@ -93,7 +93,7 @@ public function __construct($host, $user, $password, $schema, $varPath, \Magento
93
93
public function cleanup ()
94
94
{
95
95
$ dbCommand = 'mysql ' ;
96
- if ($ this ->isMariaDB ()){
96
+ if ($ this ->isMariaDB ()) {
97
97
$ dbCommand = 'mariadb ' ;
98
98
}
99
99
$ this ->ensureDefaultsExtraFile ();
@@ -139,7 +139,7 @@ public function storeDbDump()
139
139
$ this ->ensureDefaultsExtraFile ();
140
140
$ additionalArguments = [];
141
141
142
- if ($ this ->isMariaDB ()){
142
+ if ($ this ->isMariaDB ()) {
143
143
$ dumpCommand = 'mariadb-dump ' ;
144
144
}
145
145
@@ -185,13 +185,14 @@ public function restoreFromDbDump()
185
185
}
186
186
187
187
$ dbCommand = 'mysql ' ;
188
- if ($ this ->isMariaDB ()){
188
+ if ($ this ->isMariaDB ()) {
189
189
$ dbCommand = 'mariadb ' ;
190
190
}
191
191
192
192
$ this ->_shell ->execute (
193
193
'%s --defaults-file=%s --host=%s --port=%s %s < %s ' ,
194
- [$ dbCommand , $ this ->_defaultsExtraFile , $ this ->_host , $ this ->_port , $ this ->_schema , $ this ->getSetupDbDumpFilename ()]
194
+ [$ dbCommand , $ this ->_defaultsExtraFile , $ this ->_host , $ this ->_port ,
195
+ $ this ->_schema , $ this ->getSetupDbDumpFilename ()]
195
196
);
196
197
}
197
198
@@ -285,9 +286,9 @@ private function isMariaDB(): bool
285
286
286
287
$ this ->isMariaDB = (bool ) preg_match ('/-MariaDB/i ' , $ version );
287
288
288
- if ($ this ->isMariaDB ){
289
+ if ($ this ->isMariaDB ) {
289
290
$ pattern = "/\s*((?:[0-9]+\.?)+)/i " ;
290
- preg_match ($ pattern , $ version ,$ matches );
291
+ preg_match ($ pattern , $ version , $ matches );
291
292
$ currentVersion = $ matches [1 ];
292
293
if (!version_compare ($ currentVersion , self ::MARIADB_MIN_VERSION , '>= ' )) {
293
294
$ this ->isMariaDB = false ;
0 commit comments