Luminova Framework

Full Changelog Starting from Version 3.5.6 and Above

NameDescription
Version Code3.6.5
Version NameOsiris
Published2024-06-23 06:56:59
Updated2025-06-23 06:56:59

Luminova 3.6.3+ Update Overview

Version 3.6.3 introduces a major rewrite and optimization of Luminova's Database Management System, including enhancements to the Database Builder and underlying Driver implementations. This update focuses on performance, flexibility, and modern usage patterns for query building and execution.

3.5.6+ Update Overview

Version 3.5.6 introduces significant performance improvements and new features. This update enhances attribute parsing through tokenization when PHP attribute routing is enabled, and introduces an API for implementing CLI console controllers using the novakit command-line interface.


New Features

Introduced in Version 3.6.3

Database Builder Class

  • get()Executes the prepared query and returns the result. Acts as a unified shortcut to trigger execution, similar to calling fetch(), stmt(), or promise().

    Used After:

    • select() — Fetch multiple records
    • find() — Fetch a single record
    • total() — Count total rows
    • sum() — Sum numeric column
    • average() — Average numeric column

Call get() when you want the final result immediately after building the query.

  • union()Supports combining multiple queries using UNION.

  • unionAll()Supports combining multiple queries using UNION ALL.

  • columns()Allows defining specific or mapping columns to use with union() and unionAll().

  • promise()Executes the query and returns a promise object that resolves to the result.

  • distinct()Enables DISTINCT selection, changing SELECT to SELECT DISTINCT.

  • onCompound()Supports compound join conditions, such as ON (column1 = foo OR column2 = bar).

  • freeStmt()Allows manually freeing the statement object after execution using the stmt() method.


Database Drivers

  • connect() MethodNow supports manual connection. A connection is no longer automatically established when a driver instance is created, giving you more control over when to connect.

  • MySQLi new Feature

    • Added support for Emulate Prepares, matching PDO’s behavior when reusing the same named placeholder multiple times.
    • Supports binding by reference, allowing bound values to be modified before execution, for dynamic queries.

Database Constants

  • PARAM_\* ConstantsIntroduced a unified set of parameter type constants (PARAM_INT, PARAM_STR, etc.) for consistent value binding across both PDO and MySQLi drivers.

Input Validation

  • username RuleAdded support for validating usernames with optional constraints. You can enforce lowercase only names and block specific reserved usernames.

    // Allow only lowercase and disallow specific names
    'required|username(false, [system, root, admin])'
    • false: disallows uppercase letters.
    • The array: defines usernames to reject.

Introduced in Version 3.6.2

Database Builder Class

  • escape() MethodAdded support for safely escaping values for SQL queries.Handles strings, numbers, nulls, booleans, arrays (JSON), and raw expressions.

Template View Class

  • setAssetDepth() MethodAllows manual control of how many ../ prefixes are added to asset or URI paths.Overrides the default auto-detection based on URI segments.

Introduced in Version 3.6.1

Database Connection Class

Introduced connection sharding support, enabling database operations to route through specific servers based on user ID, region, or custom logic.

  • Connection::shard(string $key, bool $fallback = false, ...): Manually connect to a specific shard server using a unique key.

Database Configuration Class

Added sharding-related configuration options:

  • static bool $connectionSharding – Globally enable or disable automatic sharding.
  • static bool $shardFallbackOnError – Whether to fallback to backup servers if the selected shard is unreachable.
  • static getShardServerKey(): string – Returns the shard key used to determine the target database server.

cURL HTTP Client

Added support for parallel requests using PHP’s CurlMultiHandle, allowing you to queue and execute multiple HTTP requests concurrently.

  • Uses PHP native curl_multi_* functions.
  • Ideal for executing multiple requests in one network cycle.
  • Non-blocking and efficient for APIs and bulk operations.
use Luminova\Http\Client\Curl;
use Luminova\Http\Method;

$multi = Curl::multi();

$multi->add(Method::GET, 'https://example.com')
    ->add(Method::POST, 'https://example.org')
    ->run();

print_r($multi->getResponses());

Introduced in Version 3.5.6

Command Group Attribute

Added support for the Group attribute, which allows CLI controllers to define a command group at the class level.

Incoming HTTP Request

New methods added to improve request handling:

  • getMethodOverride() – Returns the HTTP method override value, if any.
  • getAnyMethod() – Returns the overridden method if available and the request method is POST, otherwise returns the original request method.

Routing System Interface

The routing system now implements Luminova\Interface\RouterInterface, allowing full replacement with a custom routing implementation.

Application Base Class

New method getRouterInstance() added to retrieve router instance for application routing, making it easier to replace the routing system.

Crypter Utility Class

New methods added for validating cryptographic key types and pairs:

  • isPrivateKey() – Validates whether a given string is a private key.
  • isPublicKey() – Validates whether a given string is a public key.
  • isKeyMatch() – Verifies if a private and public key pair matches.

HTTP Request Methods

A new class Luminova\Http\Method has been added to provide convenient access to HTTP method constants, such as Method::GET, Method::POST, and others.

CLI Controllers Command Limitation

Added support for $users property in CLI controllers extending Luminova\Base\BaseCommand or Luminova\Base\BaseConsole. This property allow restricting command execution to specific system users.

Command Utility Class (Terminal)

The Terminal class now includes new methods for retrieving system details and supporting CLI-based authentication:

  • systemInfo() – Returns structured system and terminal information.
  • getSystemId() – Generates a consistent, unique system identifier suitable for CLI authentication.
  • getTerminalName() – Retrieves the name of the current terminal in use.
  • getSystemModel() – Returns the device or system model (e.g., MacBook Pro, Dell XPS).
  • getPid() – Returns the parent process ID (PPID) for the current CLI session.
  • about() – Displays a formatted table of system and environment information. Also via command php novakit --system-info.
  • whoami() – Returns the current system user executing the CLI script.

Optimizations

Improved in Version 3.6.3

Database Builder Class

Several builder methods have been enhanced to support closures, allowing dynamic values to be evaluated at execution time.

  • copy()Now supports conditional copying from one table to another with support for WHERE clauses, ON DUPLICATE, REPLACE INTO, and optional transaction wrapping.

  • execute()Updated to support RETURN_* return modes and FETCH_* fetch modes. Also adds support for escaping placeholders when needed.

  • escape()Improved to handle resources (e.g., streams) and closures that return dynamic values, making it more flexible for handling binary, large, or delayed content.


Improved in Version 3.6.3

File Uploader Class

File validation has been optimized to provide more detailed and descriptive error messages, making it easier to debug upload issues and identify the exact cause of failure.


Improved in Version 3.6.2

Database Builder Class

Refined return types for better consistency and reliability:

  • average() now returns int|float and defaults to 0 on failure (previously false).
  • sum() now returns int|float and defaults to 0 on failure (previously false).
  • total() now returns int and defaults to 0 on failure (previously false).

Improved in Version 3.6.1

NovaLogger Class

The Luminova logging system has been enhanced to optionally include log context when sending messages to Telegram.You can enable this feature by:

  • Setting the environment variable:logger.telegram.send.context=true

  • Or toggling the static property in your configuration class:App\Config\Logger::$telegramSendContext = true;

Use Case:Helps provide detailed debugging information in Telegram alerts without cluttering logs by default.


Improved in Version 3.5.6

File Uploader Class

Improved file upload handling and error validation:

  • Automatic method switching: When using the upload() or chunk() methods, files smaller than 5MB with a valid temporary path will automatically use move() for better performance.
  • Directory validation: An exception is thrown if the upload path is not a valid directory.
  • Write permission check: Uploads fail with a descriptive error if the upload path is not writable.

Attribute Parser

Replaced reflection-based parsing with PHPToken to enhance performance and reduce overhead.

Route Attributes

Improved error handling by throwing exceptions when invalid middleware is specified.

Routing System

Refined routing behavior to support HTTP method overriding and improve overall routing speed.

Boot Autoload

Updated HTTP method spoofing to rely on X-HTTP-Method-Override and restrict it to POST requests, aligning with RFC 7231.

Response Renderer

Enhanced response rendering for better accuracy and output consistency.

Uploaded File Configuration

Replaced the use of stdClass with a dedicated Luminova\Http\FileConfig configuration object for better structure and clarity.


Corrections

Improved in Version 3.6.2

Documentation

  • Fixed several typos in inline comments and annotations (weatherwhether).

Improved in Version 3.6.1

Luminova Console Command

All NovaKit commands extending BaseConsole have been updated and should be updated for consistency.The command identifier has been moved from the $name property to the protected $group property to align with the BaseCommand structure.

Why this matters:Ensures consistent behavior and cleaner command registration across all CLI components.


Renamed Components

Return Types Changed Since Version 3.6.3

Database Builder

Several methods in Luminova\Database\Builder no longer execute the query directly. Instead, they now return an instance of the Builder class, allowing for further method chaining and manual execution.

To execute the query and retrieve results, you must now explicitly call one of the following methods:

  • get() — to fetch results
  • fetch() — Fetch one row at a time (for while loops or streaming).
  • stmt() — to get the prepared statement object ready to read result.
  • promise() — to defer execution result as a promise

Affected Methods:

  • select() – Prepares selected columns for fetching multiple results.
  • find() – Prepares selected columns for a single result.
  • total() – Prepares a query to count total records.
  • sum() – Prepares a query to compute the sum of a column.
  • average() – Prepares a query to compute the average of a column.

Insert Replace:

  • replace() — to insert result using REPLACE now require calling insert to execute.

Changes in Naming Since Version 3.6.1

Database Configuration Properties

The following properties have been renamed for clarity and consistency:

  • Environment File: database.pdo.enginedatabase.pdo.version
  • Configuration Array Key: pdo_enginepdo_version
  • Connection Servers and Backup: static array $databaseBackupsstatic array $databaseServers

These changes help better reflect their purpose—defining the PDO driver version (e.g., mysql, pgsql, etc.).


Changes in Naming Since Version 3.5.6

  • Luminova\Application\FoundationLuminova\Luminova
  • Luminova\Command\ConsoleLuminova\Command\Novakit
  • Luminova\Command\NovaKit\*Luminova\Command\Consoles\*
  • App\Controllers\Errors\ViewErrorApp\Errors\Controllers\ErrorController
  • /resources/Views/system_errors/*/app/Errors/Defaults/*

Deprecated

Marked as Deprecated in Version 3.5.6

Command Handler (Terminal)

  • explain() – Deprecated. Use parse() instead.

Removed

Legacy Methods Removed in Version 3.5.6

The following deprecated methods have been removed:

  • Luminova\Http\File::getMimeFromTemp() – Use getMimeFromFile() instead.
  • Luminova\Routing\Router::before() – Use guard() instead.
  • Luminova\Security\Crypter::verify() – Use isPassword() instead.
  • Luminova\Sessions\Session::toExport() – Use getResult() instead.
  • Luminova\Sessions\Session::ssid() – Use getToken() instead.
  • Luminova\Sessions\Session::ssDate() – Use getDatetime() instead.
  • Luminova\Command\Terminal::color() – Use Luminova\Command\Utils\Color::apply(...) or Color::style(...) instead.

ToDo

Applies from Version 3.6.3+

With the update in v3.6.3, builder methods like select(), find(), total() no longer auto execute. You must now explicitly call an execution method such as get(), stmt(), fetch(), or promise().


Old Insert Replace Usage:

use Luminova\Database\Builder;

$result = Builder::table(...)
    ->replace(...);

Updated Insert Replace:

use Luminova\Database\Builder;

$result = Builder::table(...)
    ->replace()
    ->insert(...);

Old Usage:

use Luminova\Database\Builder;

$result = Builder::table(...)
    // ->where(...) or other filters
    ->select(); // or ->find();

Updated:

use Luminova\Database\Builder;

$result = Builder::table(...)
    // ->where(...) or other filters
    ->select() // or ->find()
    ->get(); // required to execute

Old Usage (with returns):

use Luminova\Database\Builder;

$result = Builder::table(...)
    // ->conditions()
    ->returns(Builder::RETURN_STATEMENT)
    ->select();

Updated:

use Luminova\Database\Builder;

$result = Builder::table(...)
    // ->conditions()
    ->select()
    ->stmt(); // explicitly execute and return statement

If you're using ->returns(...), you must still call one of: ->get(), ->stmt(), ->fetch(), or ->promise() to run the query.


Included in Version 3.6.1

Update Your Database Configuration

To enable sharding support, update your Database Configuration Class with the following properties and method:

// /app/Config/Database.php

namespace App\Config;

use Luminova\Core\CoreDatabase;

class Database extends CoreDatabase
{
    /**
     * Enable or disable global connection sharding.
     * This setting does not affect direct use of the `shard()` method.
     */
    public static bool $connectionSharding = false;

    /**
     * If enabled, fallback to a backup server when the selected shard fails.
     * This setting does not affect direct use of the `shard()` method.
     */
    public static bool $shardFallbackOnError = false;

    /**
     * Optional list of sharded or backup database servers.
     */
    protected static array $databaseServers = [
        'NG' => [
            //...
            'pdo_version'  => 'mysql', // renamed from pdo_engine
        ],
    ];

    /**
     * Return a shard key used to select a target database server.
     * Typically based on geo-location, user ID, or any custom logic.
     */
    public static function getShardServerKey(): string 
    {
        return ''; // Return a key like 'NG', 'US', etc.
    }
}

Note:Rename pdo_engine to pdo_version in all defined connections.Also rename the property name $databaseBackups to $databaseServers.

Application Logging Configuration

Add a new static boolean property $telegramSendContext to the application logger configuration. This controls whether log context data is sent to Telegram when Telegram logging is enabled.

// /app/Config/Logger.php

namespace App\Config;

class Logger extends BaseConfig
{
    /**
     * Whether to include log context when sending messages to Telegram.
     */
    public static bool $telegramSendContext = false;
}

Purpose:Allows fine-tuned control over the verbosity of logs sent to Telegram.