update docs
This commit is contained in:
+32
-16
@@ -2,28 +2,44 @@
|
||||
|
||||
Plugi is configured through two files:
|
||||
|
||||
- **`.env`** — Environment variables for database connection and application stage.
|
||||
- **`config.php`** — PHP array that controls all framework behavior, modules, themes, and extensions.
|
||||
- **`.env`** — Environment-specific database, stage, admin-login, and mail settings.
|
||||
- **`config.php`** — PHP array that controls framework behavior, modules, themes, and extensions; copy it from `config.dist.php` for a fresh checkout.
|
||||
|
||||
## The `.env` File
|
||||
|
||||
The `.env` file is loaded by `EnvLoader` at boot time. It must exist in the project root. Typical contents:
|
||||
The `.env` file is loaded from the project root by `EnvLoader` at boot time. Start with `.env.dist` and use the exact variable names below:
|
||||
|
||||
```ini
|
||||
DB_HOST=mysql
|
||||
DB_NAME=plugi
|
||||
DB_USER=plugi
|
||||
DB_PASSWORD=plugi
|
||||
STAGE=development
|
||||
STAGE=production
|
||||
BASE_URL=https://example.com
|
||||
DATABASE_DRIVER=mysql
|
||||
DATABASE_HOST=localhost
|
||||
DATABASE_DATABASE=plugi
|
||||
DATABASE_USERNAME=plugi
|
||||
DATABASE_PASSWORD=replace-with-a-unique-password
|
||||
DATABASE_CHARSET=utf8mb4
|
||||
DATABASE_PREFIX=
|
||||
USERNAME=admin
|
||||
PASSWORD=
|
||||
PASSWORD_HASH=
|
||||
MAIL_HOST=
|
||||
MAIL_PORT=587
|
||||
MAIL_ENCRYPTION=tls
|
||||
MAIL_USERNAME=
|
||||
MAIL_PASSWORD=
|
||||
MAIL_FROM_ADDRESS=
|
||||
MAIL_FROM_NAME=
|
||||
MAIL_TIMEOUT=10
|
||||
```
|
||||
|
||||
| Variable | Description | Default |
|
||||
|----------------|----------------------------------------------|------------------|
|
||||
| `DB_HOST` | MySQL host (e.g., `localhost` or `mysql`) | `mysql` |
|
||||
| `DB_NAME` | Database name | `plugi` |
|
||||
| `DB_USER` | Database user | `plugi` |
|
||||
| `DB_PASSWORD` | Database password | `plugi` |
|
||||
| `STAGE` | Application stage (`development` or `production`) | `development` |
|
||||
| Variables | Purpose |
|
||||
|-----------|---------|
|
||||
| `STAGE`, `BASE_URL` | Select the application stage and public URL. Set the stage to `production` for a deployed site. |
|
||||
| `DATABASE_DRIVER`, `DATABASE_HOST`, `DATABASE_DATABASE`, `DATABASE_USERNAME`, `DATABASE_PASSWORD`, `DATABASE_CHARSET`, `DATABASE_PREFIX` | Database connection settings read by `DB`. Use `DATABASE_HOST=mysql` only when connecting to the supplied Compose service. |
|
||||
| `USERNAME`, `PASSWORD_HASH`, `PASSWORD` | Admin login read by the Auth module. Prefer `PASSWORD_HASH`; `PASSWORD` is a legacy plaintext fallback. |
|
||||
| `MAIL_HOST`, `MAIL_PORT`, `MAIL_ENCRYPTION`, `MAIL_USERNAME`, `MAIL_PASSWORD`, `MAIL_FROM_ADDRESS`, `MAIL_FROM_NAME`, `MAIL_TIMEOUT` | SMTP settings mapped from the environment into the existing mail configuration by `config.php` / `config.dist.php`. |
|
||||
|
||||
`MYSQL_ROOT_PASSWORD` is only used by the local Compose database container; it is not the application's database password. Keep `.env` private and never commit it.
|
||||
|
||||
Setting `STAGE=production` disables PHP error display in `index.php`.
|
||||
|
||||
@@ -77,7 +93,7 @@ Copy `config.dist.php` to `config.php` and adjust the settings. The configuratio
|
||||
| `class` | Fully qualified class name implementing `AuthContract`. |
|
||||
| `url` | URL prefix for auth endpoints (login/logout). |
|
||||
|
||||
The default `Auth` class checks credentials stored in the database settings table. Change the admin username and password from the admin panel after first login.
|
||||
The default `Auth` class reads `USERNAME` and either `PASSWORD_HASH` or the legacy `PASSWORD` value from `.env`; credentials are not configured in the PHP `auth` array. Use a password hash for deployments and leave `PASSWORD` empty.
|
||||
|
||||
### Website Manager Settings
|
||||
|
||||
|
||||
Reference in New Issue
Block a user