File tree 7 files changed +79
-8
lines changed
examples/symfony-mariadb-mysql
7 files changed +79
-8
lines changed Original file line number Diff line number Diff line change 20
20
- examples/symfony-import
21
21
- examples/symfony-init
22
22
- examples/symfony-mariadb
23
+ - examples/symfony-mariadb-mysql
23
24
- examples/symfony-mysql8
24
25
- examples/symfony-nginx
25
26
lando-version :
Original file line number Diff line number Diff line change 1
1
## {{ UNRELEASED_VERSION }} - [ {{ UNRELEASED_DATE }}] ({{ UNRELEASED_LINK }})
2
2
3
- * Updated mariadb plugin [ #51 ] ( https://github.com/lando/mariadb/issues/51 )
4
- * Cleaned up test comments
3
+ * Use mysql command for MariaDB 10.3.x and below [ #52 ] ( https://github.com/lando/symfony/issues/52 )
5
4
6
5
## v1.5.0 - [ March 8, 2024] ( https://github.com/lando/symfony/releases/tag/v1.5.0 )
7
6
Original file line number Diff line number Diff line change @@ -133,15 +133,19 @@ const toolingDefaults = {
133
133
*/
134
134
const getDbTooling = database => {
135
135
// Make sure we strip out any version number
136
- database = database . split ( ':' ) [ 0 ] ;
136
+ const db = database . split ( ':' ) [ 0 ] ;
137
+ const ver = database . split ( ':' ) [ 1 ] ;
137
138
// Choose wisely
138
- if ( database === 'mysql' ) {
139
+ if ( db === 'mysql' ) {
139
140
return { mysql : mysqlCli } ;
140
- } else if ( database === 'mariadb' ) {
141
+ } else if ( db === 'mariadb' && ver < 10.4 ) {
142
+ // mariadb command not available in 10.3.x and below
143
+ return { mysql : mysqlCli } ;
144
+ } else if ( db === 'mariadb' ) {
141
145
return { mariadb : mariadbCli } ;
142
- } else if ( database === 'postgres' ) {
146
+ } else if ( db === 'postgres' ) {
143
147
return { psql : postgresCli } ;
144
- } else if ( database === 'mongo' ) {
148
+ } else if ( db === 'mongo' ) {
145
149
return { mongo : {
146
150
service : 'database' ,
147
151
description : 'Drop into the mongo shell' ,
@@ -225,7 +229,6 @@ const getConfigDefaults = options => {
225
229
*/
226
230
const getTooling = options => _ . merge ( { } , toolingDefaults , getDbTooling ( options . database ) ) ;
227
231
228
-
229
232
/*
230
233
* Build Symfony
231
234
*/
Original file line number Diff line number Diff line change
1
+ name : symfony-mariadb-mysql
2
+ recipe : symfony
3
+ config :
4
+ webroot : web
5
+ php : 8.3
6
+ database : mariadb:10.3
7
+
8
+ # do not remove this
9
+ plugins :
10
+ " @lando/symfony " : ../..
Original file line number Diff line number Diff line change
1
+ # Symfony MariaDB/MySQL Example
2
+
3
+ This example exists primarily to test the following documentation:
4
+
5
+ * [ Symfony Recipe] ( https://docs.lando.dev/symfony/config.html )
6
+
7
+ Versions of MariaDB 10.3.x and lower do not have the mariadb command and must use the mysql executable.
8
+
9
+ Start up tests
10
+ --------------
11
+
12
+ Run the following commands to get up and running with this example.
13
+
14
+ ``` bash
15
+ # Should start up successfully
16
+ lando poweroff
17
+ lando start
18
+ ```
19
+
20
+ Verification commands
21
+ ---------------------
22
+
23
+ Run the following commands to validate things are rolling as they should.
24
+
25
+ ``` bash
26
+ # Should serve from web folder
27
+ lando ssh -s appserver -c " curl -L localhost" | grep " MySQL"
28
+
29
+ # Should be running apache 2.4 by default
30
+ lando ssh -s appserver -c " apachectl -V | grep 2.4"
31
+ lando ssh -s appserver -c " curl -IL localhost" | grep Server | grep 2.4
32
+
33
+ # Should use php 8.3 if specified by user
34
+ lando php -v | grep " PHP 8.3."
35
+
36
+ # Should be running mariadb 10.3.x if specified by user
37
+ lando mysql -V | grep " MariaDB" | grep " 10.3."
38
+
39
+ # Should be able to connect to the database with the default creds
40
+ lando mysql symfony -e quit
41
+
42
+ # Should use the default mariadb config file
43
+ lando ssh -s database -c " cat /opt/bitnami/mariadb/conf/my_custom.cnf" | grep " innodb_lock_wait_timeout = 121"
44
+ lando mysql -u root -e " show variables;" | grep innodb_lock_wait_timeout | grep 121
45
+ ```
46
+
47
+ Destroy tests
48
+ -------------
49
+
50
+ Run the following commands to trash this app like nothing ever happened.
51
+
52
+ ``` bash
53
+ # Should be destroyed with success
54
+ lando destroy -y
55
+ lando poweroff
56
+ ```
Original file line number Diff line number Diff line change
1
+ MySQL
Original file line number Diff line number Diff line change
1
+ <?php phpinfo (); ?>
You can’t perform that action at this time.
0 commit comments