Skip to content

3.5.5

Choose a tag to compare

@peterujah peterujah released this 22 Apr 18:21
· 41 commits to main since this release

Full Changelog: 3.5.4...3.5.5

New Features

Core Framework Initialization

  • Added support for caching .env variables in production. This improves performance by loading environment variables only once.

  • Introduced a CLI helper to generate or refresh the environment cache:

    php novakit env:cache --ignore "app.name,foo,bar"

Database Query Builder

  • bind — Added support for binding placeholders to values when using table joins and on method.

Logger Class

  • Enhanced logging with automatic inclusion of specific field values and headers in the context, improving debugging in production.
  • Added support for minified log messages in production environments, while retaining human-readable format in development. This makes logs easier to parse using tools like ELK, Fluentd, or standard CLI tools like cat and tail.

Request Rate Limiter

New methods introduced:

  • throttle() — Delays the response when the request limit is exceeded.
  • getTimestamps() — Retrieves an array of request timestamps, with optional filtering of active (non-expired) timestamps.

Terminal Commands Class

New method:

  • readInput() — Reads multi-line input from a pipe or redirected stream.
    Example:

    echo "Foo from Pipe" | php index.php create-foo

Optimizations

HTTP Request Object

  • getQuery() — Optimized method with added support for retrieving a query parameter by name. Introduced $name and $default arguments to simplify value access with fallback.

Fiber Async

  • await() — Improved performance and flexibility by introducing optional $delay and $maxWait arguments for fine-grained control over async execution.

Private File Delivery Handler

  • Enhanced file delivery logic for improved browser caching and more efficient handling of large files.

File Uploader Class

  • Optimized handling of blob (raw binary) content when uploading via the Luminova\Http\File object.
  • Added user-friendly feedback messages based on upload status and error codes for better developer experience.

Bug Fixes

System Routing Class

Fixed an issue caused by getFirst() where accessing a document-root URI like https://example.com/public in production incorrectly triggers an error. It now correctly returns a 404 Not Found.

Here’s a polished and clearer version of your To-Do List section for better readability and professional tone:


To-Do List

Update the Logger Configuration Class to support automatic context enrichment by adding the following properties:

  • $contextHeaderName — The name of the HTTP request header to automatically include in the log context.
  • $contextFieldName — The name of the request body field to automatically include in the log context (Any HTTP method is supported).

These properties allow you to globally configure which values should be captured from requests and included in log entries, improving traceability and debugging—especially in production environments.

// /app/Config/Logger.php

namespace App\Config;

use Luminova\Base\BaseConfig;

final class Logger extends BaseConfig
{
    /**
	 * Header name to extract and include in log context.
	 * 
     * @var string|null
     */
    public static ?string $contextHeaderName = null;

    /**
	 * Field name from request body to include in log context.
	 * 
     * @var string|null
     */
    public static ?string $contextFieldName = null;
}