Skip to content

Releases: spiral/framework

3.17.2

Choose a tag to compare

@roxblnfk roxblnfk released this 05 Aug 12:02
3.17.2
849cdba

What's Changed

  • Bug Fixes
    • [Stempler] Encode on* attribute output as a JavaScript literal by @roxblnfk in #1299

Full Changelog: 3.17.1...3.17.2

3.17.1

Choose a tag to compare

@roxblnfk roxblnfk released this 13 Jul 08:19
3.17.1
02afa6e

What's Changed

Fixes

  • Fix session id validation and file handler path containment by @roxblnfk in #1291

Code quality

Full Changelog: 3.17.0...3.17.1

3.13.1

Choose a tag to compare

@roxblnfk roxblnfk released this 13 Jul 09:16
3.13.1
12eb8ed

What was changed

  • [spiral/session] Fix session id validation and file handler path containment (#1291)

Full Changelog: 3.13.0...3.13.1

3.17.0

Choose a tag to compare

@roxblnfk roxblnfk released this 03 Jun 10:15
3.17.0
015b3da

New features

1. Added command aliases support to #[AsCommand]

The #[AsCommand] attribute now accepts an aliases parameter, allowing a console command to be registered and invoked under several names. The scaffolder was also updated to generate commands with aliases out of the box.

Example Usage:

use Spiral\Console\Attribute\AsCommand;

#[AsCommand(name: 'app:user:create', aliases: ['user:new', 'user:add'])]
final class CreateUserCommand extends Command
{
    // ...
}

by @gam6itko in #1252

Other

  • [spiral/csrf] Fixed CsrfMiddleware cookie missing the Path attribute by adding a configurable path option (default /) by @roxblnfk in #1257
  • [spiral/framework] Fixed route:list command crash on LINK/UNLINK verbs by @gam6itko in #1254
  • [spiral/pagination] Hardened Paginator limit handling and documented the component by @gam6itko in #1255

Full Changelog: 3.16.2...3.17.0

3.16.2

Choose a tag to compare

@roxblnfk roxblnfk released this 09 Apr 18:44
3.16.2
287accb

What's Changed

  • Bug Fixes
    • [spiral/boot] Fix Bootloader::init methods sorting by @gam6itko in #1251
    • [spiral/boot] Update return type hint for Kernel::defineAppBootloaders method by @gam6itko in #1249

Full Changelog: 3.16.1...3.16.2

3.16.1

Choose a tag to compare

@roxblnfk roxblnfk released this 23 Feb 11:43
3.16.1
6320cb0

What's Changed

Full Changelog: 3.16.0...3.16.1

3.16.0

Choose a tag to compare

@butschster butschster released this 14 Dec 11:36
3.16.0
997f93a

Highlights

PHP Attributes for Bootloader Methods

The most significant addition in this release is comprehensive support for PHP attributes in bootloaders, providing a modern, type-safe approach to application bootstrapping. You can now use attributes like #[SingletonMethod], #[BindMethod], #[BindScope], and priority-based lifecycle methods for cleaner and more expressive bootloader configuration.

Container Optimization

Major performance improvements to the container's dependency resolution with iterative scope resolution, eliminating recursive overhead and reducing exception handling for faster dependency injection.

Modern PHP Tooling

Full support for PHP 8.4, Psalm v6, Symfony Console 8, and migration to PHPUnit attributes for a modern development experience.


Features

PHP Attributes for Bootloader Methods

This major feature adds PHP attributes for configuring bootloaders, providing a more expressive and type-safe approach to application bootstrapping.

Available Attributes:

  • #[BindMethod] - Container bindings that create new instances
  • #[SingletonMethod] - Container bindings that create shared instances
  • #[InjectorMethod] - Custom injector methods
  • #[BindAlias] - Multiple aliases for bindings
  • #[BindScope] - Scoped bindings
  • #[InitMethod] - Initialization phase methods with priority control
  • #[BootMethod] - Boot phase methods with priority control

Example:

class DatabaseBootloader extends Bootloader
{
    #[SingletonMethod]
    #[BindScope('http')]
    public function createConnection(): ConnectionInterface
    {
        return new Connection(...);
    }
    
    #[InitMethod(priority: 100)]
    public function registerCoreServices(Container $container): void
    {
        // Register core services first
    }
}

Benefits:

  • Type-safety leveraging PHP's type system
  • Clearer intent with attributes vs. method names
  • Fine-grained control over execution order
  • Modern PHP 8+ attribute syntax

PR #1190 | Author: @butschster

HTTP LINK and UNLINK Methods Support

Extends HTTP method support to include LINK and UNLINK verbs as specified in RFC 2068 and RFC 5988, allowing applications to handle specialized HTTP verbs for managing relationships between resources.

PR #1230 | Author: @gam6itko

Mailer: Reply-To Header Support

Adds support for the Reply-To email header in the SendIt mailer component. Email messages can now properly set and handle Reply-To headers, allowing recipients to reply to a different address than the sender.

PR #1232 | Author: @burn1ngbear

Mailer: Pre and Post Render Events

Adds event hooks to the email rendering process for better extensibility:

  • Pre-render event: Triggered before email template rendering
  • Post-render event: Triggered after email template rendering

This allows modification of email content before rendering and enables logging, validation, or transformation after rendering.

PR #1233 | Author: @burn1ngbear

Reactor: Constant Type Management

Adds missing methods to the Reactor component for working with constant types, improving the code generation capabilities when managing constant type information in generated PHP code.

PR #1220 | Author: @butschster


Performance

Container Optimization

Major performance optimization for the container's dependency resolution and scope handling:**

  • Fixed Invoker::invoke() to avoid unnecessary class instantiation when calling static functions
  • Added internal Container Actor service for improved service management
  • Refactored Tracer to create new instances for each separated Container operation
  • Improved resolving traces in container exceptions for better debugging
  • Optimized scope resolution to use iterative loop instead of recursive Factory::make() calls

The iterative scope resolution eliminates recursive overhead and reduces exception handling, resulting in significantly faster dependency resolution.

PR #1221 | Author: @roxblnfk

Queue: Optimize Telemetry Span Names

Optimizes telemetry trace naming for queue job processing by removing job IDs from span names. This reduces cardinality and allows proper grouping of traces by job type in observability tools, resulting in better trace aggregation, easier performance pattern identification, and reduced storage overhead.

PR #1215 | Author: @rauanmayemir


🐛 Bug Fixes

Router: Fix Group Prefix Application

Fixes a bug where route group prefixes were not being automatically applied to routes in the group. Previously, developers had to manually include the prefix in each route path or add it explicitly, which was counter-intuitive. Now group prefixes are automatically applied to all routes in the group as expected.

PR #1219 | Author: @butschster | Closes: #1217

Telemetry: Fix Trace Context Propagation

Critical bug fix for the telemetry component that was preventing trace context from being added to log records. The tracer was not using the scoped proxy container, resulting in empty trace context. Fixed by ensuring TelemetryProcessor uses the scoped container properly.

PR #1212 | Author: @rauanmayemir

Telemetry: Bind TracerInterface as Singleton

Fixes an issue where TracerInterface was overwriting trace context every time it was accessed, causing traces to be lost frequently. The solution binds current TracerInterface as singleton for consistent trace context within request scope and fixes scope handling in AbstractTracer::runScope method.

Benefits:

  • Reliable access to trace context during request scope
  • Improved integration with Monolog telemetry processor
  • Prevents trace context loss during request processing

PR #1214 | Author: @rauanmayemir

Core: Fix static Return Type in Proxy Generator

Fixes a critical bug in the proxy class generator that caused failures when proxying interfaces with static return types. The generator now properly handles static return type, preventing failures in dependency injection and scoped bindings. Also adds resolving trace to resolver exceptions for better debugging.

PR #1222 | Author: @roxblnfk

Console: Fix Symfony Console 7.4+ Deprecation

Fixes deprecation warnings when using Symfony Console 7.4+ and adds support for Symfony 8. Replaced deprecated add() method with addCommand() for Symfony 7.4+ while maintaining backward compatibility with Symfony 6.4. Updated version constraints to ^6.4.17 || ^7.2 || ^8.0.

PR #1240 | Author: @gam6itko

Queue: Fix Return Type Annotation

Corrects the return type annotation for the getDelay() method to match actual behavior and improve static analysis accuracy.

PR #1238 | Author: @roxblnfk


🔧 Improvements

PHP 8.4 and Psalm v6 Support

  • Upgraded to Psalm v6 for static analysis
  • Updated Prototype component to use nikic/php-parser v5
  • Added PHP 8.4 to CI pipeline
  • Fixed Psalm and Rector issues

PR #1205 | Author: @msmakouz

General Maintenance

General maintenance update including dependency updates, code cleanup, and minor improvements across the framework.

PR #1236 | Author: @roxblnfk


📦 Full Changelog

Full Changelog: 3.15.0...3.16.0


🙏 Thanks

A huge thank you to all contributors who made this release possible:

3.15.8

Choose a tag to compare

@roxblnfk roxblnfk released this 23 Apr 12:53
3.15.8

What's Changed

  • Hotfixes by @roxblnfk in #1226
    • Fixed SpanInterface singleton rebinding in the Telemetry component (see spiral/app#157)
    • Fixed working of Prototype in container scopes

Full Changelog: 3.15.7...3.15.8

3.15.7

Choose a tag to compare

@roxblnfk roxblnfk released this 31 Mar 15:32
3.15.7

What's Changed

  • Fixed proxy class generator failure when the proxied interface contains static return type by @roxblnfk in #1222
    Also added resolving trace to Resolver exceptions

Full Changelog: 3.15.6...3.15.7

3.15.6

Choose a tag to compare

@roxblnfk roxblnfk released this 29 Mar 18:33
3.15.6
04844aa

What's Changed

  • Optimize container and fix invoker by @roxblnfk in #1221
    • Invoker::invoke() does not try to instantiate class to call a static function
    • Added an internal Container Actor service
    • Remove Tracer from services. Now a new one might be created for a separated Container operation
    • Reworked resolving traces in container exceptions

Full Changelog: 3.15.5...3.15.6