Skip to content

Commit a815679

Browse files
committed
Require Craft 3.4+ and set the DSN directly
1 parent 8a68101 commit a815679

File tree

3 files changed

+4
-16
lines changed

3 files changed

+4
-16
lines changed

.env.example

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,17 @@ ENVIRONMENT="dev"
44
# The secure key Craft will use for hashing and encrypting data
55
SECURITY_KEY=""
66

7-
# The database driver that will be used ('mysql' or 'pgsql')
8-
DB_DRIVER="mysql"
9-
10-
# The database server name or IP address (usually this is 'localhost' or '127.0.0.1')
11-
DB_SERVER="localhost"
7+
# The Data Source Name (“DSN”) that tells Craft how to connect to the database
8+
DB_DSN=""
129

1310
# The database username to connect with
1411
DB_USER="root"
1512

1613
# The database password to connect with
1714
DB_PASSWORD=""
1815

19-
# The name of the database to select
20-
DB_DATABASE=""
21-
2216
# The database schema that will be used (PostgreSQL only)
2317
DB_SCHEMA="public"
2418

2519
# The prefix that should be added to generated table names (only necessary if multiple things are sharing the same database)
2620
DB_TABLE_PREFIX=""
27-
28-
# The port to connect to the database with. Will default to 5432 for PostgreSQL and 3306 for MySQL.
29-
DB_PORT=""

composer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"rss": "https://craftcms.com/changelog.rss"
2020
},
2121
"require": {
22-
"craftcms/cms": "^3.0.0",
22+
"craftcms/cms": "^3.4.0",
2323
"vlucas/phpdotenv": "^3.4.0"
2424
},
2525
"autoload": {

config/db.php

+1-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
*/
1010

1111
return [
12-
'driver' => getenv('DB_DRIVER'),
13-
'server' => getenv('DB_SERVER'),
12+
'dsn' => getenv('DB_DSN'),
1413
'user' => getenv('DB_USER'),
1514
'password' => getenv('DB_PASSWORD'),
16-
'database' => getenv('DB_DATABASE'),
1715
'schema' => getenv('DB_SCHEMA'),
1816
'tablePrefix' => getenv('DB_TABLE_PREFIX'),
19-
'port' => getenv('DB_PORT')
2017
];

0 commit comments

Comments
 (0)