Luminova Framework

PHP Luminova: Environment Variable Management and Formatting

Last updated: 2026-01-17 18:16:37

The `.env` file centralizes configuration for Luminova, including default variables, formatting rules, and best practices for managing application behavior across environments.

The .env file controls how your application behaves. It is used by both core Luminova modules and your application.

This file stores key settings that allow the app to run differently in development, staging, or production environments without changing the code.

  • Core variables use lowercase names with dot notation (e.g., app.name) and cannot be renamed.
  • You can define custom variables in any case or format, as long as core variable names remain unchanged.

Note:

The .env file must be placed in the project root (/.env), not in the public document root (e.g., /public/.env).If the file is missing, the framework will fail to boot.


Managing Environment Variables

Luminova provides simple methods to read, set, and persist environment variables in the .env file.


Setting Variables

Set a variable temporarily (runtime only):

This sets the value only for the current script execution. It does not change the .env file.

setenv('MY_FOO', 'foo value', persist: false);

Set a variable permanently:

Pass true as the $persist argument to update or create the variable in the .env file.

setenv('MY_FOO', 'foo value', persist: true);

Reading Variables

Get a value from the environment

echo env('foo.bar');

Get a value with a fallback

If the key is missing, the second argument is returned:

echo env('my.bar', 'default value');

Using NovaKit Commands

NovaKit provides CLI commands to efficiently manage environment variables.

Add or update a variable

php novakit env:add --key=MY_FOO --value="foo value"

Remove a variable

php novakit env:remove --key=MY_FOO

Set variables by context

php novakit env:setup --target=telegram

Using Novakit ensures that environment variables are safely updated without manually editing the .env file.


Variables Formatting

Environment variables can store different kinds of values. Luminova reads these values and converts them into the right PHP types when you call env() or while parsing.


Boolean Values

The boolean value can be either true sames as enable or false same as disable.Use boolean values when you want to turn a feature on or off.

Examples:

In environment file:

# /.env

FEATURE_X=true # Same as enable

FEATURE_Y=disable # Same as false

Accessing Value

$featureX = env('FEATURE_X');   // true
$featureY = env('FEATURE_Y');   // false

Null Values

Use null when the key should exist but have no value.

Example:

In environment file:

# /.env

OPTIONAL_VALUE = null

Accessing Value

$value = env('OPTIONAL_VALUE');   // null

Note: Specifying default value will return default instead of NULL.


Blank Values

Use blank or an empty string '' when the key needs to be present but return an empty string.

Example:

In environment file

# /.env

EMPTY_FIELD=blank

Accessing Value

$value = env('EMPTY_FIELD');    // ''

Array Values

Use array format when you want to store multiple values under one environment key.

Example:

In the environment file:

# /.env

MY_LIST=['foo','bar','baz']
NUMBERS=[1,2,3]

Accessing the Values:

$list = env('MY_LIST');   // ['foo', 'bar', 'baz']
$nums = env('NUMBERS');   // [1, 2, 3]

Notes:

  • Use this only for simple list arrays.
  • Associative arrays are not supported.
  • This keeps parsing fast and memory usage low.
  • For complex structures, use JSON files or config files instead.

Variable Interpolation

Luminova env supports variable interpolation.This allows you to reference the value of another environment variable using ${}.

In the environment file

# /.env
app.name = Example
app.version = 1.2
app.description = This is my ${app.name} app using version ${app.version}

Result

echo env('app.description');
// "This is my Example app using version 1.2"
  • This helps avoid duplicated values and keeps env config DRY.
  • Change one value, fix everything.

Default Environment Variables

Application Name

app.name (string)Specifies the name of your application. Used for identification, display, and internal reference.

Example:

# /.env

app.name = Example App

Application Hostname

app.hostname (string)Defines the hostname where your application is served. Required for network-related configuration such as generating URLs.

Example:

# /.env

app.hostname=example.com

Application Timezone

app.timezone (string)Sets the timezone used by the application. This affects timestamps, logs, scheduled tasks, and all date/time functions.

Example:

# /.env

app.timezone=Asia/Kuala_Lumpur

Application Locale

app.locale (string)Specifies the default locale. Controls language settings, formatting rules, numbers, dates, and other locale-driven output.

Example:

# /.env

app.locale=en

HTML Output Charset

app.charset (string)Defines the output charset for HTML templates, HTTP headers and other output layers. Important for correct text rendering.

Example:

# /.env

app.charset=utf-8

HTML Charset

app.mb.encoding (string)

Set the internal encoding for multibyte string functions (mb_*) like mb_strlen(), mb_substr(), mb_strpos(), etc., ensuring PHP uses the correct encoding instead of guessing.

Example:

# /.env

app.mb.encoding=UTF-8

Application Version

app.version (string)Indicates the current version of the application. Used internally when generating static page caches and other internal reference.

Example:

# /.env

app.version=1.0.0

Useful for debugging, updates, asset tagging, and compatibility tracking.


Application File Version

app.file.version (string)Specifies the version for static files (e.g, assets). Often used for cache-busting assets without changing the main application version.

Example:

# /.env

app.file.version=1.0.0

Application Encryption Key

app.key (string)The main encryption key used by the framework for hashing, encryption, and securing sensitive data. Must be a strong, random string.

Example:

# /.env

app.key=your-secret-key

Note:The application encryption key is created automatically when Luminova is installed for the first time.You can change this key at any time by running php novakit generate:key or by setting the key manually.


Application Environment Mode

app.environment.mood (string)Specifies the current runtime environment of the application. Determines how the application behaves, such as error reporting, caching, and debugging. Supported values:

  • production – Application is live and serving users.
  • development – Application is in development mode, usually on localhost.
  • staging – Application in pre-production mode (used for testing changes before going live)

Example:

# /.env
app.environment.mood=development

API Prefix

app.api.prefix (string) (default: api)

Defines the URI prefix for all application API endpoints.

Luminova uses this prefix to identify and validate API requests.Methods like Luminova\Luminova::isApiPrefix() check this value to distinguish between API calls and normal HTTP requests.

Example:

For an API endpoint like https://example.com/api/user/{id}, the prefix is api.

# /.env

app.api.prefix = api

Treat AJAX Requests as API

app.validate.ajax.asapi (bool)

Define if AJAX request should be treated as API request.

  • When set to true, AJAX (XMLHttpRequest) requests are treated as API endpoints.
  • When set to false – AJAX requests are treated like normal web requests unless explicitly marked as API.

Example:

# /.env

app.validate.ajax.asapi = false

This affects the behavior of Luminova\Luminova::isApiPrefix() and related routing or response logic.


CLI

CLI Mode

cli.environment.mood (string)Defines the mood of the CLI environment, which affects how commands are executed and logged based on the environment. Typical values are production, development, or testing.

Example:

# /.env

cli.environment.mood=development

CLI Exception Debugging

throw.cli.exceptions (bool)Allows CLI commands to throw exceptions.

When disabled, uncaught exceptions are converted into a simple CLI-friendly error message.

  • true – raw exceptions are thrown in CLI, useful during debugging
  • false – exceptions are caught and replaced with a custom CLI error message

Example:

# /.env

throw.cli.exceptions=true

Page Caching

default.cache.control (string)Configures cache control directives for HTTP headers. This determines how browsers and intermediate caches handle your content. Example values:

Example:

# /.env

default.cache.control=no-store, max-age=0, no-cache
  • no-store - do not cache
  • max-age=0 - cached content expires immediately
  • no-store, max-age=0, no-cache - combination of directives for strict caching control

Template View Cacheable

page.caching (bool)Enables or disables static page caching. When enabled, rendered pages are stored and served directly, improving performance by reducing repeated processing and database queries.

Example:

# /.env

page.caching=true

Static Cache Expiration

page.cache.expiry (int)Sets the default expiration time for static page caches.

Specifies how long cached pages remain valid, in seconds. For example, 3600 means pages are cached for one hour before they are refreshed or invalidated.

Example:

# /.env

page.cache.expiry=3600

Note:

Cache expiration can also be overridden before rendering a template in controllers ($this->tpl->cache(...)) or globally via the application’s $this->view->cache(...) class using the Luminova\Template\View->cache(expiration: ...) method.


Static Cache Types

page.caching.statics (string)Specifies the template content types that should be served as cached static pages. Multiple types are separated by a pipe (|).

Example:

Setting: html|json ensures that static caching applies to both .html and .json contents.

Make sure there are no spaces around the pipe symbol.

# /.env
page.caching.statics=html|json

By setting this, URLs like http://example.com/blog can also be accessed as http://example.com/blog.html, ensuring faster responses compared to non-static URLs. This works because, with the extension appended to the view URI, Luminova checks the cache early in the boot process and serves the content directly, skipping routing and other modules.

Regular caching is passed through controllers, then handled by the Luminova\Template\View class, giving you control over when and how cached content is served.


Cache Immutable

page.caching.immutable (bool)Determines whether the cached page content is immutable.

  • true - cached content will not change and can be safely reused.
  • false - content may update dynamically.

Examples:

# /.env

page.caching.immutable=true

Note:

The immutable cache option can be overridden before rendering a template in controllers ($this->tpl->cache()) for a specific template, or globally via the application’s $this->view->cache() class using the Luminova\Template\View->cache(immutable: ...) method.


Last Cached App Versions

page.cache.app.versions (array)An array of previous application versions considered when retrieving cached content.

Luminova’s static page cache stores cached pages in directories based on the current application version (env(app.version)). When the app version changes, the cache directory name changes accordingly. To allow Luminova to serve content from past versions, list all previous versions in this array.

Example:

# /.env

page.cache.app.versions=[1.0.2,3.2.6]

Note:

The cache system always checks the current version first, then env(page.cache.latest.content), and finally past versions.This approach is suitable only when URLs change between versions (e.g., versioned documentation where content is tied to a specific release).


Cache Latest URIs Prexies

page.cache.latest.content (array)An array of URI patterns or prefixes that should always use the latest cached content for the current application version.

Before caching, Luminova checks if the content already exists. If past versions are listed in env(page.cache.app.versions), the cache might exist for an older version but not the in latest yet. By defining URI patterns here, you ensure that critical pages always serve the latest content instead of older cached versions.

Example:

When a URI matches one of these patterns, caches from older versions are ignored. This ensures that frequently updated or critical pages—like landing pages or dashboards—always display fresh content.

# /.env

page.cache.latest.content=[/,users]

Cache URI Queries

page.cache.query.params (bool)

Enable or disable, including the request's URI query string when generating cache keys.

  • true - different query strings produce different cache entries (useful if responses vary by query params).
  • false - query parameters are ignored to increase cache hit rate when params don't affect response.

Example:

# /.env

page.caching.uri.query=true

Recommended false:Unless your responses change based on query parameters (e.g., pagination, filters).


Memcached

Memcached Persistent ID

memcached.persistent.id (string|null)Specifies the persistent connection ID for the Memcached server.

  • If set to null, a default ID is used.
  • Persistent IDs allow reusing the same connection across multiple requests, improving performance.

Example:

# /.env

memcached.persistent.id=my_app_memcache

Memcached Key Prefix

memcached.key.prefix (string|null)An optional prefix added to all cache keys.

  • Helps avoid key collisions between different applications or environments.
  • If set to null, no prefix is applied.

Example:

# /.env

memcached.key.prefix=myapp_

Memcached Hostname

memcached.host (string)The hostname or IP address of the Memcached server.

  • Default: localhost (server running on the same machine).

Example:

# /.env

memcached.host=127.0.0.1

Memcached Port

memcached.port (int)The port number on which the Memcached server listens.

  • Default: 11211, the standard Memcached port.

Example:

# /.env

memcached.port=11211

Memcached Server

memcached.server.weight (int)Defines the weight of the Memcached server, affecting how cache requests are distributed among multiple servers.

  • Higher weight → server handles more requests.
  • Default: 0 (weight not explicitly set).

Example:

# /.env

memcached.server.weight=1

Optimization

Template Content Minification

page.minification (bool)Enables or disables global HTML page content minification, including inline CSS and JavaScript. Minification reduces file size, improving page load times and overall performance.

Example:

# /.env

page.minification=true

Note:HTML content minification can also be configured before rendering a template in controllers ($this->tpl->minify()) for a specific template, or globally via the application’s $this->view->minify() class using the Luminova\Template\View->minify(...) method.


Script Execution Limit

script.execution.limit (int)Specifies the maximum execution time for scripts in seconds. This prevents scripts from running indefinitely and affecting server performance.

Example:

# /.env

script.execution.limit=30

Script Abort Connection

script.ignore.abort (bool)Determines whether a script continues running even if the client disconnects or aborts the request. Useful for long-running processes where the task should finish regardless of the user connection.

Example:

# /.env

script.ignore.abort=true

Output Compression Handler

script.output.handler (string|null)Defines a custom output compression handler for script output.

  • Example: ob_gzhandler compresses data sent to clients.
  • Set to null to disable compression.

Example:

# /.env

script.output.handler=ob_gzhandler

Content Output Encoding

enable.encoding (bool)Enables or disables content encoding and compression for views. When enabled, output is compressed to reduce data size and improve transmission efficiency.

Example:

# /.env

enable.encoding=true

Output Compression Handler

compression.encoding (string|bool)Specifies the compression method for output, such as gzip or deflate. Setting it to false disables compression entirely. Adjusts how content is compressed for optimized delivery.

Example:

# /.env

compression.encoding=gzip

Output Compression Level

compression.level (int)Sets the compression level, usually from 1 (lowest) to 9 (highest). Higher levels compress content more but may increase CPU usage and processing time.

Example:

# /.env

compression.level=5

Login Session

Strict Login IP

session.strict.ip (bool)Enforces strict session login handling based on the user's IP address.If the user's IP changes during a login session, the session is invalidated, and the user must log in again. This improves security by binding sessions to a specific IP.

Example:

# /.env

session.strict.ip=true

Debugging

Maintenance Mode

app.maintenance.mood (bool)Enables or disables maintenance mode. When enabled, users may see a maintenance page while internal tasks continue running.

Example:

# /.env

app.maintenance.mood=true

Maintenance Page:To customize the default maintenance page, edit the file at /app/Errors/Defaults/maintenance.php.


Maintenance Retry Seconds

app.maintenance.retry (int)Number of seconds a client should wait before retrying access during maintenance. Default: 3600.

Example:

# /.env

app.maintenance.retry=3600

Show Debug Tracing

debug.show.tracer (bool)Controls whether a debug trace is displayed. A debug trace shows detailed information about the execution flow, which helps track down issues.

Example:

# /.env

debug.show.tracer=true

Note:On production exception tracing arguments are ignored by default.


Debug Performance Tips

debug.alert.performance.tips (bool)Enables production log warnings when critical performance features are missing or not enabled.

Example:

# /.env

debug.alert.performance.tips=true

Note:Enabling this may produce large log entries. If these warnings are no longer needed in production, you can disable this setting.


Error Display Handler

debug.display.errors (bool)Enables or disables the display of error messages on the screen.

  • true - Errors are visible, useful for development.
  • false - Errors are hidden, recommended for production.

Example:

# /.env

debug.display.errors=true

Performance Monitoring

debug.show.performance.profiling (bool)Displays performance profiling information at the bottom of each page or after CLI routable command is execution. Includes execution time, memory usage, and files loaded. Only visible in development mode to help identify performance bottlenecks.

Example:

# /.env

debug.show.performance.profiling=true

API Performance Profiling

debug.api.performance.profiling (bool)Enables performance profiling for API requests. Works together with debug.show.performance.profiling. When enabled, the performance metrics of the last API request are logged in /writeable/logs/metrics.json for analysis.

Example:

# /.env

debug.api.performance.profiling=true

Inline Error Detection

debug.catch.inline.errors (bool)Enables detection and handling of hidden errors in view content.When true, hidden errors trigger exceptions to ensure all errors are properly handled.

Example:

# /.env

debug.catch.inline.errors=true

Depreciated:This feature has been depreciated, it no longer serve the intended need.


Logging System

Log Message Template Format

logger.log.format (string)

This allows you to fully control how log entries are written using a log message template.The template uses placeholders wrapped in {} which are replaced at runtime.

Example:

# /.env

logger.log.format = '[{time:Y-m-d H:i:s.uP}] {level} {name} {message} {context}'

Available Placeholders:

PlaceholderDescription
{level}Log level name (INFO, ERROR, DEBUG, etc.).
{name}Logger channel name.
{time}Current timestamp. Supports date format: {time:Y-m-d H:i:s}
{message}Log message text.
{context}Context array rendered as string or JSON.
{ipaddress}Client IP address (HTTP only).
{referer}HTTP referer header if available.
{useragent}Client user agent string.

Example Output:

[2026-01-17 23:41:18.382+08:00] ERROR AppLogger Database connection failed {"host":"127.0.0.1"}

Log Backup

logger.create.backup (bool)Determines whether a backup of the log file should be created when the logger.max.size limit is reached.

  • true - automatically create a backup and clear the current log file
  • false - clear the log file without creating a backup

Example:

# /.env

logger.create.backup=true

Maximum Log Size

logger.max.size (int)Specifies the maximum size (in bytes) for each log level. Example: 10485760 = 10 MB.

  • When this limit is reached:

    • If logger.create.backup is true, a backup is created.
    • If false, the log file is cleared.

Example:

# /.env

logger.max.size=10485760

Remote Logging

logger.remote.logs (string|null)Defines the endpoint URL for sending POST requests with error logs to a remote server in production.

  • Set to a URL to enable remote logging.
  • Leave null or unset to disable remote logging.

Example:

# /.env

logger.remote.logs=https://example.com/log-endpoint

Email Logging

logger.mail.logs (string|null)Specifies an email address for sending error logs.

  • When set, the logger will email errors automatically.
  • Leave null or unset to disable email logging.

Example:

# /.env

[email protected]

Telegram Bot Logging Token

logger.telegram.bot.token (string|null)The Telegram bot token used for API authentication.

  • Obtain from BotFather.
  • Required for sending Telegram notifications.
  • Leave null or unset to disable Telegram features.

Example:

# /.env

logger.telegram.bot.token=123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

Telegram Bot Chat-ID

logger.telegram.bot.chat.id (string|int|null)Specifies the Telegram chat ID for sending notifications.

  • Can be a user ID, group ID, or channel ID.
  • Leave null or unset to disable messaging.

Example:

# /.env

logger.telegram.bot.chat.id=987654321

Dispatch Log Levels

logger.dispatch.levels (string[])

Define which log levels are allowed to be sent to remote services such as HTTP, Email, or Telegram.This acts as a strict whitelist.

Example:

Override the default remote log levels (alert, exception, emergency, critical):

# /.env

logger.dispatch.levels = [critical, emergency, alert, exception]

How it works

Only the levels listed above will be dispatched when:

  • Luminova\Logger\Logger::dispatch() is called
  • Or a fatal / critical error triggers automatic remote logging
  • If a level is not listed, it will never be sent remotely.
  • If remote logging is not configured, nothing is sent, even for critical levels.
use Luminova\Logger\Logger;
use Luminova\Logger\LogLevel;

Logger::dispatch(LogLevel::ERROR, 'Query failed');        // ❌ Not dispatched
Logger::dispatch(LogLevel::CRITICAL, 'DB is down');       // ✅ Sent to remote
Logger::dispatch(LogLevel::EXCEPTION, 'Throws an error'); // ✅ Sent to remote

// Use default remote config and CRITICAL level
Logger::dispatch(to: null, 'Fatal error');               // ✅ Sent to remote if configured

This keeps bots quiet, inboxes clean, and your sanity intact.


Email SMTP

SMTP Authenticatable

smtp.use.credentials (bool)Specifies whether SMTP authentication requires credentials.

  • true - SMTP username and password are required to send emails.
  • false - credentials are not used.

Example:

# /.env

smtp.use.credentials=true

SMTP Password

smtp.use.password (bool)Indicates whether a password is required for SMTP authentication.

  • true - a password must be provided if credentials are used.

Example:

# /.env

smtp.use.password=true

SMTP Debuggable

smtp.debug (bool)Enables or disables debugging information for SMTP communication.

  • Useful for troubleshooting email sending issues, as it provides detailed logs.

Example:

# /.env

smtp.debug=true

SMTP Hostname

smtp.host (string)The hostname or IP address of the SMTP server that handles outgoing emails.

Example:

# /.env

smtp.host=smtp.example.com

Accessing Value

$host = env('smtp.host'); // 'smtp.example.com'

SMTP Port

smtp.port (int)The port number used for SMTP communication.

  • Common ports: 25, 465, 587
  • Depends on the SMTP server and encryption method.

Example:

# /.env

smtp.port=587

SMTP Username

smtp.username (string)The username for SMTP authentication.

  • Required if smtp.use.credentials is enabled.

Example:

# /.env

smtp.username=your_username

SMTP Password

smtp.password (string)The password for SMTP authentication.

  • Required if smtp.use.credentials is enabled.

Example:

# /.env

smtp.password=your_password

SMTP Sender Email

smtp.email.sender (string)The email address that appears as the sender ("From") in outgoing emails.

Example:

# /.env

[email protected]

SMTP Encryption Type

smtp.encryption (string)Specifies the encryption method for SMTP communication.

  • Common values: tls or ssl
  • Secures the connection between the email client and server.

Example:

# /.env

smtp.encryption=tls

SMTP Encoding

smtp.charset (string)Defines the character set used for encoding email content.

  • Common value: UTF-8
  • Ensures proper display of international characters.

Example:

# /.env

smtp.charset=UTF-8

Database Connection Variables

These variables configure the default database connection in Luminova.

You can define separate settings for production and development environments, so you don’t have to manually change connection details when switching environments.

Any variable containing development in its name applies only to development.This keeps production and development configurations fully isolated.


Development-Only Variables

These variables are used specifically for development. Other database variables are shared across environments.

  • database.development.username (string): The database username for development.
  • database.development.password (string): The database password for development.
  • database.development.name (string): The name of the development database.
  • database.development.commands (string[]): SQL commands executed on every development connection.
  • database.development.sqlite.path (string): Path to the SQLite file for development when using the PDO SQLite driver.

Hostname

database.hostname (string)The hostname of your database server.

Example:

# /.env

database.hostname=localhost

DB Port

database.port (int)The port number for your database connection.

Example:

# /.env

database.port=3306

DB Encoding

database.charset (string)The character set used for the database connection.

Example:

# /.env

database.charset=utf8mb4

Database Pool

database.connection.pool (bool)Enables or disables connection pooling.

  • Connection pooling reuses existing database connections instead of creating a new one for each request.
  • Improves performance and reduces overhead.

Example:

# /.env

database.connection.pool=true

Database Maximum Connections

database.max.connections (int)Specifies the maximum number of simultaneous database connections.

  • Helps manage resource usage and prevent overloading the database server.

Example:

# /.env

database.max.connections=20

Database Trying Attempts

database.connection.retry (int)The number of retry attempts for database connections if the initial attempt fails.

  • Useful for handling transient issues like network glitches or temporary server unavailability.

Example:

# /.env

database.connection.retry = 3

Database Persistent Connection

database.persistent.connection (bool)

Enable or disable persistent database connections.When enabled, Luminova keeps database connections open between requests instead of reconnecting every time.

Example:

# /.env

database.persistent.connection = false

Implementation depends on the driver:

DriverHow it works
MySQLiPrefixes the host with p: (e.g. p:localhost)
PDOSets PDO::ATTR_PERSISTENT = true

Notes

Persistent connections reduce connection overhead and improve performance on busy systems, but they come with sharp edges:

Pros

  • Faster request startup
  • Lower connection cost under load

Cons

  • Stale connections
  • Leaked transactions
  • Hard-to-debug “ghost bugs”

MySQL Buffered Queries

database.mysql.buffered.query (bool)

Enable or disable buffered queries for MySQL connections.

  • When enabled (true), MySQL will fetch the entire result set into memory before you start reading it.
  • When disabled (false), rows are streamed one by one from the server.

Example:

# /.env

database.mysql.buffered.query = false

Why this matters

ModeBehaviorWhen to use
trueFaster for small queries, higher memory usageDashboards, admin panels, small datasets
falseLow memory usage, safer for big tablesImports, exports, reports, long-running jobs

Database Parameter Prepares

database.emulate.prepares (bool)Enables or disables emulation of prepared statements.

  • true - allows using the same named parameter multiple times in a query (useful for MySQLi, which doesn’t natively support repeated named parameters).
  • false - uses native prepared statement behavior; each placeholder must be unique.

Example:

# /.env

database.emulate.prepares=true

Database Cache Driver

database.caching.driver (string)Specifies the cache driver for the database Luminova\Database\Builder class.

  • Available drivers: memcached or filesystem

Example:

# /.env

database.caching.driver = memcached

Database Driver

database.connection (string)The database connection driver to use.

  • Available drivers: MYSQLI or PDO

Example:

# /.env

database.connection=PDO

Database PDO Driver Version

database.pdo.version (string)

When using PDO driver, specify the PDO DBMS type (default: mysql).

  • Available types: mysql, sqlite, sqlsrv, pgsql, cubrid, dblib, or oci

Example:

# /.env

database.pdo.version=mysql

Database Socket Connection

database.mysql.socket (bool)Use a Unix socket for MySQL or MySQLi connections.

  • true - forces socket connection instead of TCP/IP, improving performance for local servers.
  • By default, Luminova may already use sockets for CLI connections; enabling ensures consistency across connection types.

Example:

# /.env

database.mysql.socket = true

Database Socket Path

database.mysql.socket.path (string)Path to the Unix socket file for MySQL/MySQLi connections.

  • Required if database.mysql.socket is true.
  • Example paths: /var/run/mysqld/mysqld.sock or /tmp/mysql.sock

Example:

# /.env

database.mysql.socket.path=/var/run/mysqld/mysqld.sock

Database Initialization Commands

database.commands (string[])

Define SQL commands that are executed immediately after a database connection is created.

Examples:

These commands run once per connection and are used to prepare the session environment.

# /.env

database.commands = ["SET time_zone = 'UTC'", "SET NAMES utf8mb4", "SET sql_mode = 'STRICT_ALL_TABLES'"]

# For development set
database.development.commands = [...]

Database Username

database.username (string)The username used to connect to the database.

Example:

# /.env

database.username=prod_user

# For development set
database.development.username = dev_user

Database Name

database.name (string)The name of the database name.

Examples:

# /.env

database.name = prod_database

# For development set
database.development.name = dev_database

Database Password

database.password (string)The password used to authenticate the database user.

Examples:

# /.env

database.password = prod_secret

# For development set
database.development.password = dev_secret

Sqlite Database Path

database.sqlite.path (string)The file path to the SQLite database.

  • Store the file inside the /writeable/database/ directory.
  • You may choose any filename you prefer.

Example:

# /.env

database.sqlite.path = /writeable/database/production.sqlite

# For development set
database.development.sqlite.path = /writeable/database/development.sqlite

Note:

Ensure that both production or development sqlite database file is stored in the /writeable/database/ directory.While there is no strict naming convention for the database file, it should be named according to your preference.


Optional Luminova Features

These are Luminova features that are disabled by default.They can be enabled when needed to reduce unnecessary overhead and improve performance by only loading what your application uses.


Route Attributes

feature.route.attributes (bool)Enable defining routes using PHP attributes inside controller methods instead of manual registration.

Example:

# /.env

feature.route.attributes = true

Route Attribute Cache

feature.route.cache.attributes (bool)Enable caching of parsed route attributes to avoid re-parsing on every request.

Example:

Recommended in production for faster route handling.

# /.env

feature.route.cache.attributes=true

Note:

When route attribute caching is enabled, any changes made to controller attributes in production will not take effect until the cached files are manually deleted from:

/writeable/caches/routes/*

The cache has no expiration and remains on the filesystem indefinitely until removed.


Application Class Aliases

feature.app.class.alias (bool)Allows registering custom class aliases for your application, letting you reference classes using shorter or more meaningful names.

Example:

# /.env

feature.app.class.alias=true

Application Services Loader

feature.app.services (bool)Enables automatic loading and management of your application's services.

Example:

# /.env

feature.app.services=true

PSR-4 Autoloading

feature.app.autoload.psr4 (bool)Activates PSR-4 autoloading, allowing classes to be automatically loaded based on their namespaces and directory structure.

Example:

# /.env

feature.app.autoload.psr4=true

Developer Functions Loader

feature.app.dev.functions (bool)Loads procedural utility functions from app/Utils/Global.php.Useful for making global helper functions available across the app.

Example:

# /.env

feature.app.dev.functions=true

Route Dependency Injection

feature.route.dependency.injection (bool)Enables type-hint-based dependency injection for routable controller methods, allowing cleaner and more testable code.

Example:

# /.env

feature.route.dependency.injection=true

HMVC Architecture

feature.app.hmvc (bool)Enable support for HMVC architecture to organize nested modules.

  • enable → activate HMVC
  • disable → revert to standard MVC

Example:

# /.env

feature.app.hmvc=enable

Application Start URL (Development Only)

dev.app.start.url (string)Specifies the starting URL of your project's front controller. This URL is used when generating sitemaps.Ensure it points directly to your front controller (e.g., http://localhost/public/, http://localhost/my-project/public/, or http://localhost:port/).

Example:

# /.env

dev.app.start.url=https://localhost/your-project-path/public/

Note:This can also be set in app/Config/Sitemap.php or using --url option in command


On this page