Configuration
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.
The .env File
The .env file is loaded by EnvLoader at boot time. It must exist in the project root. Typical contents:
| 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 |
Setting STAGE=production disables PHP error display in index.php.
The config.php File
Copy config.dist.php to config.php and adjust the settings. The configuration is a PHP array with the following sections:
General Settings
| Key |
Description |
language |
Default language code (e.g., en, de, fr). Theme and extension translations are loaded for this language. |
assets_url |
Public URL path to the Plugi core assets (JS, CSS, images). |
uploads_url |
Public URL path to the uploads directory. |
Storage Settings
| Key |
Description |
use_database |
Set to true to use MySQL for storing pages, settings, and uploads metadata. |
uploads_folder |
Absolute filesystem path where uploaded files are stored. |
Auth Settings
| Key |
Description |
use_login |
Enable or disable the built-in authentication module. |
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.
Website Manager Settings
| Key |
Description |
use_website_manager |
Enable or disable the admin dashboard. |
class |
Class implementing WebsiteManagerContract. |
url |
URL prefix for the admin panel. |
Page Builder Settings
| Key |
Description |
class |
Class implementing PageBuilderContract (GrapesJS-based by default). |
url |
URL prefix for the page builder. |
actions |
Named action URLs, e.g., back returns to the admin panel. |
Page Settings
| Key |
Description |
class |
Class implementing PageContract. |
table |
Database table name for pages. |
translation.class |
Class implementing PageTranslationContract. |
translation.table |
Database table name for page translations (multilingual support). |
translation.foreign_key |
Foreign key column linking translations to pages. |
Cache Settings
| Key |
Description |
enabled |
Enable page caching. Cached pages skip block parsing on subsequent requests. |
folder |
Filesystem path for cache files. |
class |
Class implementing CacheContract. |
A page is cached unless it contains a block with caching disabled. The cache is automatically cleared when a page is saved in the page builder. You can also force a cache refresh by appending ?refresh_cache to the URL.
Theme Settings
| Key |
Description |
class |
Class implementing ThemeContract. |
folder |
Filesystem path to the themes directory. |
folder_url |
Public URL path to the themes directory. |
active_theme |
Slug of the active theme (matches a folder name in themes/). |
Router Settings
| Key |
Description |
class |
Class implementing RouterContract that resolves URLs to pages. |
Class Replacements
Map a core class namespace to an alternative implementation. This allows overriding specific classes while extending the originals. Example:
Important: When overriding a class, always extend the original class.