Skip to content

Commit 9abf3be

Browse files
committed
2 parents 1a6f676 + 2291bc8 commit 9abf3be

File tree

9 files changed

+17
-29
lines changed

9 files changed

+17
-29
lines changed

.env.example

Lines changed: 2 additions & 11 deletions
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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"issues": "https://github.com/chasegiunta/craft-vue-tailwind/issues"
2121
},
2222
"require": {
23-
"craftcms/cms": "^3.0.0",
24-
"vlucas/phpdotenv": "^2.4.0",
23+
"craftcms/cms": "^3.4.0",
24+
"vlucas/phpdotenv": "^3.4.0",
2525
"nystudio107/craft-twigpack": "^1.1"
2626
},
2727
"autoload": {

composer.json.default

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"require": {
3-
"craftcms/cms": "^3.0.0",
4-
"vlucas/phpdotenv": "^2.4.0"
3+
"craftcms/cms": "^3.4.0",
4+
"vlucas/phpdotenv": "^3.4.0"
55
},
66
"autoload": {
77
"psr-4": {

config/db.php

Lines changed: 1 addition & 4 deletions
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
];

craft

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ require_once CRAFT_VENDOR_PATH.'/autoload.php';
1313

1414
// Load dotenv?
1515
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) {
16-
(new Dotenv\Dotenv(CRAFT_BASE_PATH))->load();
16+
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
1717
}
1818

1919
// Load and run Craft

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"vue": "^2.6.0"
1414
},
1515
"devDependencies": {
16-
"@vue/cli-plugin-babel": "^3.8.0",
17-
"@vue/cli-service": "^3.8.0",
16+
"@vue/cli-plugin-babel": "^4.0.0",
17+
"@vue/cli-service": "^4.0.0",
1818
"filemanager-webpack-plugin": "^2.0.5",
1919
"glob-all": "^3.1.0",
2020
"purgecss-webpack-plugin": "^1.5.0",
2121
"purgecss-whitelister": "^2.1.0",
2222
"vue-template-compiler": "^2.6.0",
23-
"webpack-manifest-plugin": "^2.0.4"
23+
"webpack-manifest-plugin": "^2.1.4"
2424
},
2525
"postcss": {
2626
"plugins": {

src/components/HelloWorld.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
<span class="text-green-400">{{ info.environment }}</span> (passed in as
2424
prop)<br />
2525

26-
<span class="text-white">DB Name: </span>
26+
<span class="text-white">DSN Settings: </span>
2727
<span class="text-green-400"><slot></slot></span> (passed in through
2828
slot)
2929
</code>
@@ -37,9 +37,9 @@ export default {
3737
props: ["info"],
3838
data() {
3939
return {
40-
msg: "Hello World"
40+
msg: "Hello World",
4141
};
42-
}
42+
},
4343
};
4444
</script>
4545

@@ -52,4 +52,4 @@ h1,
5252
h2 {
5353
font-weight: normal;
5454
}
55-
</style>
55+
</style>

templates/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
} %}
1919

2020
<hello-world :info="{{ info|json_encode }}">
21-
{{ getenv('DB_DATABASE') }}
21+
{{ getenv('DB_DSN') }}
2222
</hello-world>
2323
</div>
2424

web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// Load dotenv?
1414
if (class_exists('Dotenv\Dotenv') && file_exists(CRAFT_BASE_PATH.'/.env')) {
15-
(new Dotenv\Dotenv(CRAFT_BASE_PATH))->load();
15+
Dotenv\Dotenv::create(CRAFT_BASE_PATH)->load();
1616
}
1717

1818
// Load and run Craft

0 commit comments

Comments
 (0)