Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pushing env file updates live #938

Merged
merged 4 commits into from
Jan 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 6 additions & 10 deletions docs/advanced-usage/env-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ This variable can now be used in your `/system/user/config.php` as illustrated b
Here is an example of what it might look like to manage all your database connection settings, and Base URL in `.env.php`

```
# .env.php
// .env.php

#URLs
// URLs
BASE_URL=http://mysite.test/

# DATABASE SETTINGS
# # # # # # # # # # # #
// DATABASE SETTINGS
DB_HOSTNAME=db
DB_DATABASE=db
DB_USERNAME=db
Expand Down Expand Up @@ -84,18 +83,15 @@ The site short name can be accessed in the code using `$GLOBALS['assign_to_confi
The below example demonstrates this approach, assuming you have 2 MSM sites with short names of `default_site` and `second_site`

```
# .env.php

# SITE-SPECIFIC SETTINGS

// .env.php
// SITE-SPECIFIC SETTINGS
default_site.BASE_PATH=/home/sites/mysite.test/
default_site.BASE_URL=http://mysite.test/

second_site.BASE_PATH=/home/sites/anothersite.test/
second_site.BASE_URL=http://anothersite.test/

# DATABASE SETTINGS
# # # # # # # # # # # #
// DATABASE SETTINGS
DB_HOSTNAME=db
DB_DATABASE=db
DB_USERNAME=db
Expand Down