Releases: luminovang/framework
3.6.7
Full Changelog: 3.6.6...3.6.7
New Features
Core Application Class
Introduced a new static method: onShutdown().
This method acts as a hook that runs when the application terminates due to a fatal error or explicit shutdown. It allows the application to inspect the error and choose to:
- Return
falseto suppress default framework handling. - Return
trueto let the framework handle the error normally.
Example:
// /app/Application.php
namespace App;
use Luminova\Core\CoreApplication;
class Application extends CoreApplication
{
public static function onShutdown(array $error): bool
{
return true;
// Or handle shutdown and return false
}
}This gives developers more control over graceful shutdowns in critical situations.
Optimizations
Global Helper Functions
Improved performance and flexibility of global functions.
import()now supports resolving virtual paths using predefined URI-style schemes. This simplifies file inclusion across common system directories.
Examples:
import('app:Config/settings.php');
import('view:layouts/header.php');
import('package:brick/math/src/BigNumber.php');This update enhances code readability and keeps file paths consistent across modules.
You can still pass a full file path if preferred. The scheme prefix is entirely optional.
3.6.6
This release introduces background task handling, improved CLI tooling, and namespace support for global functions.
View Full Changelog – Complete list of changes in Luminova 3.6.6
New Features
-
Background Task Queue
Built-in task queue system withnovakitCLI support. Run background tasks with commands likephp novakit task:run.
Includes aLuminova\Models\Taskmodel, defaultApp\Tasks\TaskQueuecontroller, and optionalLuminova\Interface\QueueableInterface. -
Webhook Helper
New class for sending and receiving webhook requests with support for signature verification and payload decoding. -
Global Helper Function
object_column- To get column(s), from an object. Similar to PHParray_columnfor designed for object.
Improvements
-
Namespaced Global Functions
All global functions are now underLuminova\Funcs\*.
Example:use function Luminova\Funcs\root; root('/public/', 'robots.txt');
-
Novakit CLI Enhancements
task -hnow shows grouped commands helps.listnow accepts--commandor-cto filter output.
-
Function Optimizations
root()supports appending a file.import()allows control over error and include/require behavior.get_column()now returns objects when used with objects.
Removed
Luminova\Command\Terminal::explain()– useperse()instead.Luminova\Database\Builder->caching()– usecacheable()instead.
Fixes
tableCommand
Fixed blank output when using0as the column value.
Full Changelog: 3.6.4...3.6.6
3.6.5
Full Changelog: 3.6.4...3.6.5
Optimization
Database Drivers
- Improved
getTypemethod in both MySQLi and PDO drivers to accurately detect binary values, especially those containing non-printable characters.
Database Builder Class
Significant optimizations were made to the query builder parsing logic and method signatures:
-
join– Made parameter types less strict, now acceptsnullfor join type argument. -
Improved clause construction in:
onClausematchclauseagainstorderAgainst
-
unionAlias– Improved how aliases are generated for grouped union queries, ensuring consistent and predictable results.
Fixed
Database Drivers
- Updated MySQLi emulate prepares to loosen the binding position requirement. Parameter bindings no longer need to match the order of positional placeholders in the query strictly.
Before Fix (would fail or return incorrect results):
$sql = 'SELECT * FROM users WHERE uid = :uid AND phone = :phone AND email = :email LIMIT 1';
$result = (new Luminova\Database\Connection())
->database()
->prepare($sql)
->bind(':email', 'doe@example.com')
->bind(':uid', 100)
->bind(':phone', '08036750000')
->fetchNext();
// Or Using Builder Class
$result = Luminova\Database\Builder::query($sql)->execute([
'email' => 'doe@example.com',
'uid' => 100,
'phone' => '08036750000',
], RETURN_NEXT);In previous versions, because :uid appears before :phone and :email, but the bindings were not ordered to match, the result would be empty or incorrect.
3.6.4
Full Changelog: 3.6.3...3.6.4
This update includes micro-optimizations and internal fixes to the Database Builder class, focusing on performance improvements, safer state handling, and more consistent transaction behavior.
New
-
safeMode– Enables internal transaction wrapping forinsert,update,delete,truncate,drop, andtempoperations. Use this when you want safe commit and rollback behavior without manually managing transactions. -
release– Internally releases any active transaction. Similar torollback(), but returnsfalseon error instead of throwing an exception.
Optimized
-
Improved query result caching. Cache is now checked before executing any query. This reduces unnecessary query processing and improves performance.
-
Replaced
foreachwithforloops where applicable for faster iteration over numerically indexed arrays.
Fixed
- Resolved minor issues in the Database Builder that affected consistency and state resets during operations.
Changed
- Internal transaction handling has been moved to the new
safeModemethod. - Removed all optional transaction arguments from methods that previously supported inline transaction enabling.
You can now explicitly use:
$builder = Builder::table('foo')
->transaction();
// ...perform operations
$builder->commit();Or simply call:
Builder::table('foo')
->safeMode(true);
// ...perform operationsto auto-wrap safe operations.
Affected Methods:
temp()– Removed transaction argument.truncate()– Removed transaction argument.insert()– Removed automatic transaction when inserting more than one row.
Deprecated
caching()– Deprecated in favor of the clearercacheable()method.
3.6.3
Full Changelog: 3.6.2...3.6.3
Luminova Database Update v3.6.3
Major rewrite of the Database Management System with performance optimizations, enhanced query building, and modern usage patterns.
New Features
Database Builder Class
-
get()
Executes the prepared query and returns the result. Acts as a unified shortcut to trigger execution, similar to callingfetch(),stmt(), orpromise().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 usingUNION. -
unionAll()
Supports combining multiple queries usingUNION ALL. -
columns()
Allows defining specific or mapping columns to use withunion()andunionAll(). -
promise()
Executes the query and returns a promise object that resolves to the result. -
distinct()
EnablesDISTINCTselection, changingSELECTtoSELECT DISTINCT. -
onCompound()
Supports compound join conditions, such asON (column1 = foo OR column2 = bar). -
freeStmt()
Allows manually freeing the statement object after execution using thestmt()method.
Database Drivers
-
connect()Method
Now 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.
Optimizations
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 forWHEREclauses,ON DUPLICATE,REPLACE INTO, and optional transaction wrapping. -
execute()
Updated to supportRETURN_*return modes andFETCH_*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.
Return Types Changes
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 resultsfetch()— 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.
For full changes visit https://luminova.ng/docs/3.5.6/
3.6.2
Full Changelog: 3.6.1...3.6.2
New Features
Database Builder Class
escape()Method
Added support for safely escaping values for SQL queries.
Handles strings, numbers, nulls, booleans, arrays (JSON), and raw expressions.
Template View Class
setAssetDepth()Method
Allows manual control of how many../prefixes are added to asset or URI paths.
Overrides the default auto-detection based on URI segments.
Optimizations
Database Builder Class
Refined return types for better consistency and reliability:
average()now returnsint|floatand defaults to0on failure (previouslyfalse).sum()now returnsint|floatand defaults to0on failure (previouslyfalse).total()now returnsintand defaults to0on failure (previouslyfalse).
3.6.1
Full Changelog: 3.5.9...3.6.1
New Features
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());Optimizations
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.
Renamed
Database Configuration Properties
The following properties have been renamed for clarity and consistency:
- Environment File:
database.pdo.engine→database.pdo.version - Configuration Array Key:
pdo_engine→pdo_version - Connection Servers and Backup:
static array $databaseBackups→static array $databaseServers
These changes help better reflect their purpose—defining the PDO driver version (e.g.,
mysql,pgsql, etc.).
Corrections
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.
ToDo
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:
Renamepdo_enginetopdo_versionin all defined connections.
Also rename the property name$databaseBackupsto$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.
3.5.9
Full Changelog: 3.5.8...3.5.9
New Features
Introduced in Version 3.5.9
Dependency Injection Manager
Added support for custom dependency bindings using the Luminova\Routing\DI class or the bind method in the application instance.
Database Builder Enhancements
Introduced row-level locking support via the new method:
lockFor(...)– Enables row locking with eitherupdate(exclusive) orshared(read-only) modes.
3.5.8
Full Changelog: 3.5.7...3.5.8
Fixed
Fixed error caused by defining a constant in the View trait class.
3.5.7
Full Changelog: 3.5.6...3.5.7