Skip to content

3.5.4

Choose a tag to compare

@peterujah peterujah released this 11 Apr 11:47
· 45 commits to main since this release

Full Changelog: 3.5.3...3.5.4

New Features

Core Application Class

Introduced support for early application termination and lifecycle hooks:

  • onPreCreate - Invoked before the application and routing system are initialized.
  • terminate - Allows early termination of the application before full initialization.
  • onTerminate - Called before termination to determine whether the application should proceed with termination. Return true to allow or false to cancel.
  • onTerminated - Executed after the application has been terminated.

Request Rate Limiter

Added a lightweight request rate limiter class supporting:

  • Memcached, Redis, FileCache, or any PSR-6 CacheItemPoolInterface and andCacheInterface compatible implementations.
  • Dynamic message formats and retry-after calculation.
  • Custom headers and response formatting.

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 for set_time_limit() that only sets the time limit if the current limit is lower and the function is not disabled.

HTTP Upload File Object

New method added:

  • getMimeFromFile - Detects MIME type from a temporary file path or binary data.

Sitemap Generator Configuration

New configuration option:

  • public int $maxExecutionTime = 300 - Specifies the maximum execution time in seconds. Set to 0 for unlimited execution time.

Optimizations

Sitemap Generator Configuration

  • Added support for global pattern matching using @(pattern) in the ignoreUrls and skipStaticHtml config properties.
  • Improved performance and memory usage.
  • Enhanced skipped-page reporting and better handling of execution time limits.

Bug Fixes

Database ORM Builder

  • Fixed a memory exhaustion issue in the Builder::exec(...) method caused by a recent update.

Deprecated

HTTP Upload File Object

  • getMimeFromTemp - Deprecated. Use getMimeFromFile instead.

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;
}