Search by

austral / http-bundle

Matthieu Beurelaustral

Http Austral Bundle

Package info

github.com/austral-project/http-bundle

Type:symfony-bundle

pkg:composer/austral/http-bundle

Statistics

Installs: 3 202

Dependents: 6

Suggesters: 0

Stars: 0

Open Issues: 0

v3.1.4 2024-07-15 14:19 UTC

This package is auto-updated.

Last update: 2026-11-27 15:38:24 UTC


README

Version CI PHP Symfony License

Base of the HTTP layer of Austral: kernel listener, HttpEvent dispatched on each step of a request (initialise, request, controller, response, exception, finish), base classes for controllers, handlers and subscribers, current language and environment, gzip / deflate compression of the responses.

This bundle is part of Austral, a modular back office and CMS for Symfony.

Requirements

  • PHP 8.4 or higher
  • Symfony 7.4

Installation

composer require austral/http-bundle

If you do not use Symfony Flex, register the bundle in config/bundles.php:

return [
    // ...
    Austral\HttpBundle\AustralHttpBundle::class => ['all' => true],
];

Configuration

# config/packages/austral_http.yaml
austral_http:
    protocol: https            # default: https
    default_language: en       # default: en
    languages: [fr, en]
    env:
        current: prod          # default: prod
        list: [prod]
    compression_gzip:
        default: true      # gzip / deflate compression of the responses
        # admin: true      # read by admin-bundle for the administration requests
        # website: true    # read by website-bundle for the website requests

compression_gzip.default applies to every request. admin-bundle and website-bundle override it for their own requests with the admin and website keys, and fall back to default when the key is not set.

The domains (multi-site) are managed by austral/domain-bundle, which http-bundle does not depend on.

Usage

A route opts in to the Austral HTTP events with the _austral_http_event attribute, set to the class of the event to dispatch (an HttpEventInterface). The upper bundles (admin, website) subscribe to these events through HttpEventSubscriber.

The events are dispatched for the main request only. The handler of a bundle (HttpHandler) is a shared service: it reads the request from the RequestStack and is tagged kernel.reset, so that nothing of a request is kept for the next one in a long-running process.

Documentation

The full documentation is available at https://austral.dev.

Versions

Bundle Symfony PHP Branch
4.x 7.4 ≥ 8.4 4.x
3.1 5.4 / 6.4 ≥ 8.0 3.1 (maintenance)

See the CHANGELOG and, to upgrade from 3.1, UPGRADE-4.0.

Contributing

Contributions are welcome: see the contributing guide. To report a security issue, follow the security policy.

License

MIT, see LICENSE.

Credits

Created by Matthieu Beurel. Sponsored by Yipikai Studio.