Releases: luminovang/luminova
2.3.7
Full Changelog: 2.3.2...2.3.7
Fixes
Fixed incorrect mixing of PHP 8.1 standards with PHP 8.0, which caused runtime errors.
New Features
PHP Layout Composition
Improved the PHP layout composition class and introduced new helper features.
The layout object is now automatically available inside PHP template files when App\Config\Template->enableDefaultTemplateLayout is enabled.
Dynamic Template Placeholders
Placeholders defined within a layout section are now resolved automatically when extending or rendering the layout with options:
<?php $this->layout->begin('title'); ?>
<h1>{{ placeholder }}</h1>
<?php $this->layout->end('title'); ?>Smarty Template Extension
Improved the Smarty extension to provide simpler access to functions and classes, giving it behavior in Luminova closer to Twig.
Object Method Access
You can now call object methods directly without assigning the object to a Smarty variable first:
{{ $self.app->doFoo()->getBar() }}Smarty & Twig Template Extension
Improved both extensions with a single configuration point for managing custom extensions and modifiers.
Template caching is now handled by Luminova for consistent behavior and integration with the static URL cache system.
Routing System
Optimized the routing system. All HTTP method helpers are now static.
Dependency Injection in routing has been improved to honor default parameter values when a dependency cannot be resolved.
Added the Router::isPrefix(...) helper for checking URI prefixes.
Static HTTP Helpers:
get— HTTP GETpost— HTTP POSTput— HTTP PUTpatch— HTTP PATCHdelete— HTTP DELETEhead— HTTP HEADoptions— HTTP OPTIONSany— Any valid HTTP methodmiddleware— Before-middleware handlerafter— After-middleware handlerguard— CLI middleware handlercapture— Custom HTTP methodscommand— CLI commandgroup— CLI command groupingbind— HTTP URI group bindingonError— HTTP error handler
HTTP Message Stream
Optimized the message stream class, added a new buffer method, and moved the class namespace from
Luminova\Utility\Storage\Stream to Luminova\Http\Message\Stream.
Global Import Function
The global import() function now supports promise resolving:
use function \Luminova\Funcs\import;
import('view:template', promise: true)
->then(fn(string $html) => print($html))
->catch(fn(Throwable $e) => echo $e->getMessage());2.3.6
Full Changelog: 2.3.2...2.3.6
Version 3.6.8 brings a major cleanup across Luminova’s core. Many parts were renamed, optimized, or fixed, and several new helper classes were added, including Password, String, and the improved error-handling system. The template view engine and the core exception layer also received substantial tuning.
Default HTTP error templates now support grouped pages using 4xx.php and 5xx.php, replacing the old 404.php and 500.php pattern.
Fixes
Routing System
Fixed an issue where routes defined with HTTP HEAD method were incorrectly returning 404 errors.
New Features
HTTP Controller Methods
HTTP controller routable methods can now return Psr\Http\Message\ResponseInterface, Luminova\Interface\ViewResponseInterface, or the traditional int.
Example
Using Luminova\Template\Response class.
use Luminova\Attributes\Route;
use Luminova\Http\Message\Response;
use Psr\Http\Message\ResponseInterface;
#[Route('/api/hello', methods: ['GET'])]
public function hello(): ViewResponseInterface
{
return new Response('Hello world', 200);
}Routing System
Added a new pattern method to define and manage custom URI segment placeholders.
This allows you to create reusable patterns for route parameters, improving maintainability and reducing repetition of patterns.
// In App\Application::onCreate()
Router::pattern('slug', '[a-z0-9-]+');
// In App\Controllers
#[Luminova\Attributes\Route('/blog/(:slug)', methods: ['GET'])]
public function blog(string $slug): int
{
// Handle blog route using the slug value
}Note:
Once defined, theslugpattern can be reused across multiple routes, ensuring consistent validation.
Password Helper
A new Password helper has been added to handle all password-related operations in one place.
Now:
use Luminova\Security\Password;
$hash = Password::hash('pass');
Password::verify('pass', $hash);
// Additional utilities:
Password::rehash('pass', $hash);
Password::strength('pass');
Password::isCompromised('pass');
// and more...Before:
Crypter::password('pass');
Crypter::isPassword('pass', 'hash');Proxy Helper
A dedicated Proxy helper is now available for checking and validating HTTP/SOCKS proxies.
Now:
use Luminova\Utility\Proxy;
$proxy = '';
Proxy::validate($proxy);
Proxy::ping($proxy);
// and more...String Helper
A new Str helper provides object-based string manipulation features.
Now:
use Luminova\Utility\String\Str;
$str = Str::of('peter');
echo $str->length(); // 5
echo $str->toUpperCase()
->trim(); // PETER
// and more...Backend Session Class
The Session class now supports role-based access control, with methods for finer-grained permission management:
-
roles(array $roles)
Assign user roles to the session. -
getRoles(): array
Retrieve all roles currently stored in the session. -
guard(array $roles, int $mode = Session::GUARD_ANY, ?callable $onDenied = null): bool
Validate roles against access rules. Returnstrueif access is denied (fail-fast pattern),falseif access is granted. -
toSessionId(string $id, string $algo = 'sha256')
Convert a string into a valid PHP session ID.Example:
Convert a system identifier into a valid PHP session ID for persistent CLI logins.
use Luminova\Command\Terminal; use Luminova\Sessions\Session; $sid = Session::toSessionId(Terminal::getSystemId());
Supported Guard Modes:
Session::GUARD_ANY(default): Access granted if at least one role matches.Session::GUARD_ALL: Access granted only if all roles match.Session::GUARD_EXACT: Access granted only if all and only the specified roles match.Session::GUARD_NONE: Access granted only if none of the roles are present.
Example:
if ($session->guard(['admin', 'moderator'], Session::GUARD_ALL)) {
throw new AccessDenied('Insufficient privileges.');
}PHP Route Attribute
A new $aliases property has been added to the Route attribute to define multiple alternative URI patterns for the same controller method.
Before (using multiple attributes)
Previously, to map several URIs to the same method, you had to repeat the Route attribute:
// /app/Controllers/Http/ExampleController.php
use Luminova\Attributes\Route;
#[Route('/', methods: ['GET'])]
#[Route('/home', methods: ['GET'])]
#[Route('/default', methods: ['GET'])]
#[Route('/dashboard', methods: ['GET'])]
public function home(): int
{
return $this->view('index');
}Now (using aliases)
You can achieve the same result with a single attribute, improving readability and reducing duplication:
// /app/Controllers/Http/ExampleController.php
use Luminova\Attributes\Route;
#[Route('/', methods: ['GET'], aliases: [
'/home',
'/default'
'/dashboard'
])]
public function home(): int
{
return $this->view('index');
}PHP Prefix Attribute
The Prefix attribute now supports a new $exclude property that allows you to specify URI prefixes to exclude from controller matching. This removes the need for complex negative-lookahead patterns.
Before (manual regex exclusions)
// /app/Controllers/Http/MainController.php
use Luminova\Attributes\Prefix;
#[Prefix(pattern: '/(?!api(?:/|$)|admin(?:/|$)).*')]
class MainController extends Controller
{
}Now (using the built-in exclude list)
// /app/Controllers/Http/MainController.php
use Luminova\Attributes\Prefix;
#[Prefix(pattern: '/(:base)', exclude: [
'api',
'admin'
])]
class MainController extends Controller
{
}Full Changes documentation.
2.3.5
Full Changelog: 2.3.2...2.3.5
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.
2.3.4
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_columnis designed for objects.
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: 2.3.2...2.3.4
2.3.3
Full Changelog: 2.3.2...2.3.3
Added
- Add new database management constants.
Changes
- Applied changes to configuration classes.
- Rename database connection env key
database.emulate.preparsetodatabase.emulate.prepares
2.3.2
Full Changelog: 2.3.1...2.3.2
New Features
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.
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.).
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.
2.3.1
Full Changelog: 2.3.0...2.3.1
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.
2.3.0
Full Changelog: 2.2.8...2.3.0
New Features
Demos
Added HMVC and Console command demo.
Command Group Attribute
Added support for the Group attribute, which allows CLI controllers to define a command group at the class level.
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.
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 commandphp novakit --system-info.whoami()– Returns the current system user executing the CLI script.
Optimizations
Attribute Parser
Replaced reflection-based parsing with PHPToken to enhance performance and reduce overhead.
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.
Renamed Components
Luminova\Application\Foundation→Luminova\LuminovaLuminova\Command\Console→Luminova\Command\NovakitLuminova\Command\NovaKit\*→Luminova\Command\Consoles\*App\Controllers\Errors\ViewError→App\Errors\Controllers\ErrorController/resources/Views/server_errors/*→/app/Errors/Defaults/*
Deprecated
Command Handler (Terminal)
explain()– Deprecated. Useparse()instead.
Removed
The following deprecated methods have been removed:
Luminova\Http\File::getMimeFromTemp()– UsegetMimeFromFile()instead.Luminova\Routing\Router::before()– Useguard()instead.Luminova\Security\Crypter::verify()– UseisPassword()instead.Luminova\Sessions\Session::toExport()– UsegetResult()instead.Luminova\Sessions\Session::ssid()– UsegetToken()instead.Luminova\Sessions\Session::ssDate()– UsegetDatetime()instead.Luminova\Command\Terminal::color()– UseLuminova\Command\Utils\Color::apply(...)orColor::style(...)instead.
2.2.8
Full Changelog: 2.2.7...2.2.8
New Features
Global Helper Functions
New helper functions introduced:
set_function- Safely invokes a native PHP function only if it's not disabled.set_max_execution_time- A custom wrapper forset_time_limit()that only sets the time limit if the current limit is lower and the function is not disabled.
Sitemap Generator Configuration
New configuration option:
public int $maxExecutionTime = 300- Specifies the maximum execution time in seconds. Set to0for unlimited execution time.
Optimizations
Sitemap Generator Configuration
- Added support for global pattern matching using
@(pattern)in theignoreUrlsandskipStaticHtmlconfig properties. - Improved performance and memory usage.
- Enhanced skipped-page reporting and better handling of execution time limits.
Deprecated
HTTP Upload File Object
getMimeFromTemp- Deprecated. UsegetMimeFromFileinstead.
To-Do List
Update sitemap generator configuration class to include property $maxExecutionTime:
// /app/Config/Sitemap.php
namespace App\Config;
use Luminova\Base\BaseConfig;
final class Sitemap extends BaseConfig
{
/**
* @var int $maxExecutionTime
*/
public int $maxExecutionTime = 300;
}2.2.7
Full Changelog: 2.2.6...2.2.7