@@ -15,7 +15,8 @@ trait InteractsWithDockerComposeServices
15
15
protected $ services = [
16
16
'mysql ' ,
17
17
'pgsql ' ,
18
- 'mariadb ' ,
18
+ 'mariadb10 ' ,
19
+ 'mariadb11 ' ,
19
20
'redis ' ,
20
21
'memcached ' ,
21
22
'meilisearch ' ,
@@ -66,7 +67,7 @@ protected function buildDockerCompose(array $services)
66
67
: Yaml::parse (file_get_contents (__DIR__ . '/../../../stubs/docker-compose.stub ' ));
67
68
68
69
// Prepare the installation of the "mariadb-client" package if the MariaDB service is used...
69
- if (in_array ('mariadb ' , $ services )) {
70
+ if (in_array ('mariadb10 ' , $ services ) || in_array ( ' mariadb11 ' , $ services )) {
70
71
$ compose ['services ' ]['laravel.test ' ]['build ' ]['args ' ]['MYSQL_CLIENT ' ] = 'mariadb-client ' ;
71
72
}
72
73
@@ -92,7 +93,7 @@ protected function buildDockerCompose(array $services)
92
93
// Merge volumes...
93
94
collect ($ services )
94
95
->filter (function ($ service ) {
95
- return in_array ($ service , ['mysql ' , 'pgsql ' , 'mariadb ' , 'redis ' , 'meilisearch ' , 'typesense ' , 'minio ' ]);
96
+ return in_array ($ service , ['mysql ' , 'pgsql ' , 'mariadb10 ' , ' mariadb11 ' , 'redis ' , 'meilisearch ' , 'typesense ' , 'minio ' ]);
96
97
})->filter (function ($ service ) use ($ compose ) {
97
98
return ! array_key_exists ($ service , $ compose ['volumes ' ] ?? []);
98
99
})->each (function ($ service ) use (&$ compose ) {
@@ -123,7 +124,8 @@ protected function replaceEnvVariables(array $services)
123
124
$ environment = file_get_contents ($ this ->laravel ->basePath ('.env ' ));
124
125
125
126
if (in_array ('mysql ' , $ services ) ||
126
- in_array ('mariadb ' , $ services ) ||
127
+ in_array ('mariadb10 ' , $ services ) ||
128
+ in_array ('mariadb11 ' , $ services ) ||
127
129
in_array ('pgsql ' , $ services )) {
128
130
$ defaults = [
129
131
'# DB_HOST=127.0.0.1 ' ,
@@ -145,7 +147,7 @@ protected function replaceEnvVariables(array $services)
145
147
$ environment = preg_replace ('/DB_CONNECTION=.*/ ' , 'DB_CONNECTION=pgsql ' , $ environment );
146
148
$ environment = str_replace ('DB_HOST=127.0.0.1 ' , "DB_HOST=pgsql " , $ environment );
147
149
$ environment = str_replace ('DB_PORT=3306 ' , "DB_PORT=5432 " , $ environment );
148
- } elseif (in_array ('mariadb ' , $ services )) {
150
+ } elseif (in_array ('mariadb10 ' , $ services ) || in_array ( ' mariadb11 ' , $ services )) {
149
151
if ($ this ->laravel ->config ->has ('database.connections.mariadb ' )) {
150
152
$ environment = preg_replace ('/DB_CONNECTION=.*/ ' , 'DB_CONNECTION=mariadb ' , $ environment );
151
153
}
0 commit comments