PHP Luminova: Migration Guides to 3.9.5
Upgrade steps to Luminova 3.9.5 for application and controller classes, custom extensions, task scheduling, and changed APIs.
Start with the version of luminovang/framework installed in your project. This guide covers the changes between 3.9.4 and 3.9.5. If your project is on an earlier version, apply the migration instructions for the intervening versions before following these steps.
Start with your application and controllers, then check the sections for the features you use. The 3.9.5 changelog lists the deprecated compatibility classes and removed APIs.
Before You Start
Back up your project files and database. Keep your current composer.json and composer.lock so you can restore the dependencies you were running before the upgrade. Make the changes in a development or staging environment first.
Check the installed framework version and the versions available to Composer.
composer show luminovang/framework
composer show luminovang/framework --allWhen 3.9.5 is available from your Composer repository and your project constraint allows it, run the targeted update from your project directory.
composer update luminovang/framework:3.9.5
composer show luminovang/frameworkIf your project pins 3.9.4 exactly, update the requirement in composer.json first. Review the resulting lock file and run composer check-platform-reqs in the target environment before deploying. See System Requirements.
Update Your Application and Controllers
Update the parent classes in app/Application.php, app/Kernel.php, and your controllers. Update imports and type declarations in your own services, route callbacks, and router implementations that accept the framework application class.
| In 3.9.4 | In 3.9.5 |
|---|---|
Luminova\Foundation\Core\Application | Luminova\Foundation\Core\AbstractApplication |
Luminova\Foundation\Core\ServiceKernel | Luminova\Foundation\Core\AbstractKernel |
Luminova\Base\Controller | Luminova\Base\Http\AbstractController |
Luminova\Base\Command | Luminova\Base\Cli\AbstractController |
Luminova\Base\Console | Luminova\Base\Cli\AbstractConsole |
For example, in app/Application.php, import AbstractApplication and keep your existing lifecycle methods in the application class.
namespace App;
use Luminova\Foundation\Core\AbstractApplication;
class Application extends AbstractApplication
{
protected function onCreate(): void
{
// Keep your existing application initialization here.
}
}The previous classes in this table remain available as deprecated compatibility classes. Change the parent of your HTTP and CLI controllers in place. Keep their application namespaces and route definitions. Use the CLI controller base for commands handled by the application router and the console base for custom Novakit commands. Routable CLI controllers still implement help(array $helps): int.
See the application class, service kernel, HTTP controllers, routable CLI controllers, and Novakit console controllers for the current class definitions.
Service kernel
In app/Kernel.php, replace the ServiceKernel import and parent with AbstractKernel. Keep your custom service registrations and matching logic in get(), has(), and shouldShareService(). This example delegates all three methods to the framework defaults.
namespace App;
use Luminova\Foundation\Core\AbstractKernel;
final class Kernel extends AbstractKernel
{
public function shouldShareService(string $service): bool
{
return parent::shouldShareDefaultService($service);
}
public function get(string $service, mixed ...$arguments): object|string|null
{
return parent::getDefaultService($service, ...$arguments);
}
public function has(string $service): bool
{
return parent::isDefaultService($service);
}
}HTTP controller
Replace Luminova\Base\Controller with Luminova\Base\Http\AbstractController. Keep the existing controller namespace and route attributes.
namespace App\Controllers\Http;
use Luminova\Attributes\Route;
use Luminova\Base\Http\AbstractController;
final class HealthController extends AbstractController
{
#[Route('/health', methods: ['GET'])]
public function show(): int
{
return $this->view('health');
}
}The example expects an existing health view. Use your own view name when migrating a controller. HTTP Controllers
Routable CLI controller
Replace Luminova\Base\Command with Luminova\Base\Cli\AbstractController. Keep the command group, route attributes, and existing help method.
namespace App\Controllers\Cli;
use Luminova\Attributes\Command;
use Luminova\Attributes\Group;
use Luminova\Base\Cli\AbstractController;
use Luminova\Command\Terminal;
#[Group('reports')]
final class ReportController extends AbstractController
{
#[Command('status')]
public function status(): int
{
Terminal::writeln('Reports are available.');
return STATUS_SUCCESS;
}
public function help(array $helps): int
{
return STATUS_ERROR;
}
}Custom Novakit console controller
Replace Luminova\Base\Console with Luminova\Base\Cli\AbstractConsole. Keep your existing command registration. The console class implements run(?array $params = null): int and help(array $helps): int.
namespace App\Controllers\Cli;
use Luminova\Base\Cli\AbstractConsole;
use Luminova\Command\Terminal;
final class ReportConsole extends AbstractConsole
{
protected string $name = 'report';
public function run(?array $params = null): int
{
Terminal::writeln('Reports are available.');
return STATUS_SUCCESS;
}
public function help(array $helps): int
{
return STATUS_ERROR;
}
}See Novakit Console Controllers.
Update Custom Framework Extensions
If your project provides custom implementations or type declarations using any of these classes and interfaces, update them to the corresponding 3.9.5 names.
| In 3.9.4 | In 3.9.5 |
|---|---|
Luminova\Base\AIAgent | Luminova\Base\AbstractAiAgent |
Luminova\Base\Cache | Luminova\Base\AbstractCache |
Luminova\Base\Cookie | Luminova\Base\AbstractCookie |
Luminova\Base\Mailer | Luminova\Base\AbstractEmailTemplate |
Luminova\Base\Model | Luminova\Base\Database\AbstractModel |
Luminova\Base\Queue | Luminova\Base\AbstractTaskQueue |
Luminova\Base\SessionHandler | Luminova\Base\AbstractSessionHandler |
Luminova\Config\Configuration | Luminova\Base\AbstractConfig |
Luminova\Config\DatabaseConfig | Luminova\Base\Database\AbstractConfig |
Luminova\Database\Driver\Helpers\AbstractBaseDriver | Luminova\Database\Driver\Helpers\AbstractDatabaseDriver |
Luminova\Interface\Arrayable | Luminova\Interface\ArrayableInterface |
Luminova\Interface\Awaitable | Luminova\Interface\AwaitableInterface |
The application and database configuration base classes share the short name AbstractConfig. Import the appropriate one for each configuration class. If you use both in the same file, import one with an alias, such as use Luminova\Base\Database\AbstractConfig as DatabaseConfig;.
Application configuration
Replace the Luminova\Config\Configuration import and parent in your application config classes with Luminova\Base\AbstractConfig. Keep your declared settings and defaults.
namespace App\Config;
use Luminova\Base\AbstractConfig;
final class Reports extends AbstractConfig
{
public int $retentionDays = 30;
}See Application Configuration Base Class.
Database configuration
In app/Config/Database.php, replace Luminova\Config\DatabaseConfig with Luminova\Base\Database\AbstractConfig. Retain your connection settings and any backup server or shard definitions. This example shows the base class change with sharding disabled.
namespace App\Config;
use Luminova\Base\Database\AbstractConfig;
class Database extends AbstractConfig
{
public static bool $connectionSharding = false;
public static bool $shardFallbackOnError = false;
}See Database Configuration Base Class and Database Connection.
Database task queue
In app/Tasks/TaskQueue.php, replace Luminova\Base\Queue with Luminova\Base\AbstractTaskQueue. Retain your queue table, task groups, and configuration. Implement tasks(): ?array to provide task definitions. Return null if the subclass has no predefined tasks and jobs are enqueued elsewhere in your application.
namespace App\Tasks;
use Luminova\Base\AbstractTaskQueue;
class TaskQueue extends AbstractTaskQueue
{
protected function tasks(): ?array
{
return [
['handler' => 'App\Tasks\Jobs\ReportJob@run', 'arguments' => []],
];
}
}Replace ReportJob@run with your existing job class and method. The example registers one predefined job using a class and instance method.
Replace imports of Luminova\Base\Helper\QueueTables with Luminova\Base\Helper\TaskQueueTables if you maintain custom queue table definitions. The section below covers filesystem scheduled tasks. Database Task Queue Base Class · Database Task Queue Execution
Migrate Filesystem Scheduled Tasks
Move the definitions from the configuration that extended Luminova\Config\CronTaskConfig into App\Tasks\TaskScheduler in app/Tasks/TaskScheduler.php. Extend Luminova\Base\AbstractTaskScheduler and keep your definitions in schedule(): void.
Pass the handler class and method separately to service(). For instance, a task registered in 3.9.4 with service(ReportCommand::class . '::generate') now uses service(ReportCommand::class, 'generate'). Use expression() for cron expressions previously passed to cronTime(). Scheduled handlers must be public methods on a routable CLI controller or a Novakit console controller.
After migrating the definitions, regenerate the schedule and verify that the worker runs a task in your test environment.
php novakit cron:create --force
php novakit cron:runRun cron:create --force once during migration. It rebuilds the lock file and resets task execution state, including last-run times and completion, failure, and retry counts. Keep --force out of recurring crontab entries. Filesystem Task Scheduling · Filesystem Task Queue
Update Template Response Calls
Review code that uses Luminova\Template\Response or implements Luminova\Interface\ContentResponseInterface.
| In 3.9.4 | In 3.9.5 |
|---|---|
compress() | enableCompression() |
minify() | enableHtmlMinifier() |
header() | setHeader() |
headers() | setHeaders() |
content($body, $headers) | Call setHeaders($headers) before setContent($body). Setting content captures the current headers in the result. |
failed() | asFailed() to set the flag and isFailed() to read it |
redirect($uri, $method) | redirect($uri, $useRefresh). Pass true for a Refresh header or omit the second argument to use Luminova’s automatic selection. It normally sends Location and uses Refresh on Microsoft IIS. |
Also update code that consumes return values. clearRedirects() returns void, and getResult() returns an array with exit, status, headers, and contents. Remove calls to the former public getProtocolVersion() method on the template response. Call asFailed() before setContent() if the result should carry an error exit code.
The namespaced redirect() and back() helpers also take the boolean useRefresh option. Set the HTTP status with their third argument, status. Namespaced Helper Functions
See Template Response Handling.
Review Other Changed APIs
Check these calls if your application uses the corresponding framework features.
| Application code | What to change |
|---|---|
| Custom route dependency resolution | Replace Luminova\Routing\DI with Luminova\Routing\DependencyResolver. Controller Dependency Injection |
| Value formatting and identifier helpers | Replace Luminova\Utility\Util with Formatter for formatting and sanitization. Use Random::identifier() and Validator::isIdentifier() for deterministic identifiers. Both default to sha256. Value Formatting · Random · Value Validation |
| Awaitable tasks | Update custom future types to AwaitableInterface. For an awaitable, a Fiber, or a callable, use Async::await(). Async and Fibers |
| Custom task queue table definitions | Replace Luminova\Base\Helper\QueueTables with Luminova\Base\Helper\TaskQueueTables where you instantiate the helper. Database Task Queues |
| Database table definitions | Replace getCreateQuery() with getQueryDefinition() when retrieving the generated SQL. Table Schema Definition |
| IP address lookups | IP::info() returns an associative array. Check $result['success'], then read details on success or error on failure. Update object property access and null checks accordingly. Client IP Address |
| Cron interval calculations | Pass the timezone as the named timezone argument to CronInterval::convert(). The second positional argument now accepts a reference time as a DateTimeImmutable. The method returns an interval string and throws DateTimeException for an invalid expression. |
| Anonymous object deserialization | Serializer::unserialize() now returns ?object. If your code expects to call the result as a closure, check that it is a Closure first. Anonymous Object Serialization |
| Exception formatting | Replace Error::sanitizeExceptionMessage() with Error::sanitize(). For code using Error::getApiErrorResponse(), review the fields returned by Error::toArray($exception, true) and map the ones your API exposes. Exception Handling |
| Custom retry responses | Luminova::terminate() accepts an integer or string for $retry. Existing integer delays still work. |
Verify the Upgrade
- Open a web route and run a CLI route to verify that your controllers load.
- Exercise custom kernel services and any configuration, cache, queue, or session extensions you updated.
- Check redirects and response headers where your application sets them explicitly.
- Run a scheduled task in your test environment if your project uses filesystem scheduling.
If a failure only shows an HTTP 500 response, check the application and PHP error logs. In a local environment, enable debug.display.errors in .env to diagnose framework errors. For a failure before the framework starts, temporarily enable PHP error reporting after the declare statement in public/index.php.
error_reporting(E_ALL);
ini_set('display_errors', '1');Restore your error display settings and remove any temporary debugging lines before deploying.