PHPackages                             sindla/aurora - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. sindla/aurora

ActiveSymfony-bundle

sindla/aurora
=============

Aurora - Symfony 8.0 bundle

v8.0.5(1mo ago)06.6k1[1 issues](https://github.com/SindlaXYZ/Aurora/issues)MITPHPPHP &gt;=8.4CI passing

Since Nov 30Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/SindlaXYZ/Aurora)[ Packagist](https://packagist.org/packages/sindla/aurora)[ Docs](https://sindla.com)[ RSS](/packages/sindla-aurora/feed)WikiDiscussions 8.0 Synced 1mo ago

READMEChangelog (10)Dependencies (27)Versions (214)Used By (0)

Aurora
------

[](#aurora)

[![PHPUnit](https://github.com/SindlaXYZ/Aurora/actions/workflows/phpunit.yml/badge.svg?branch=8.0)](https://github.com/SindlaXYZ/Aurora/actions?query=branch%3A8.0) [![PHPUnitTests](https://github.com/SindlaXYZ/aurora/raw/8.0/.github/badges/phpunit.svg?raw=true)](https://github.com/SindlaXYZ/aurora/blob/8.0/.github/badges/phpunit.svg?raw=true) [![PHPUnitStatements](https://github.com/SindlaXYZ/aurora/raw/8.0/.github/badges/statements.svg?raw=true)](https://github.com/SindlaXYZ/aurora/blob/8.0/.github/badges/statements.svg?raw=true) [![PHPUnitCoverage](https://github.com/SindlaXYZ/aurora/raw/8.0/.github/badges/coverage.svg?raw=true)](https://github.com/SindlaXYZ/aurora/blob/8.0/.github/badges/coverage.svg?raw=true) [![Last Commit](https://camo.githubusercontent.com/529ae361cd53d7ff3f1e18ba8fdc51b24334adba66656b0ccf345296401b54bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f53696e646c6158595a2f4175726f72612f382e30)](https://github.com/SindlaXYZ/Aurora/tree/8.0) [![Latest Version](https://camo.githubusercontent.com/3203ef87bf91eb797f6d1c8e62e29869b85be20e835b50d26d2b3e719f391c5b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f53696e646c6158595a2f4175726f72613f6c6162656c3d74616726636f6c6f723d627269676874677265656e)](https://github.com/SindlaXYZ/Aurora/releases?q=v8.0&expanded=true)

Installation
------------

[](#installation)

The Aurora package is Packagist ready, and Composer can be used to install it (PHP 8.4+ required).

```
composer require sindla/aurora:8.0.*
```

The x-dev flag can be used to install the development version:

```
composer require sindla/aurora:8.0.x-dev
```

Configuration
-------------

[](#configuration)

Even if Aurora is Packagist-ready and is a Symfony bundle, no recipe will be installed automatically.

 #### 🗂️ config/packages/aurora.yaml

[](#️-configpackagesaurorayaml)

- Create the file `config/packages/aurora.yaml` and add the following content:

```
parameters:
    aurora.bundle: 'App'
    aurora.root: '%kernel.project_dir%'
    aurora.tmp: '%kernel.project_dir%/var/tmp'
    aurora.resources: '%kernel.project_dir%/var/resources'
    aurora.static: '%kernel.project_dir%/public/static'
    aurora.locales: [ 'en', 'ro' ]
    aurora.locale: 'ro'
    # maxmind.com license key
    aurora.maxmind.license_key: '%env(default::MAXMIND_LICENSE_KEY)%'
    # Minify output
    aurora.minify.output: false
    aurora.minify.output.ignore.extensions: [ '.pdf', '.csv', '.jpg', '.png', '.gif', '.doc', '.docx', '.xls', '.xlsm', '.xlsx', '.xml', '.zip' ]
    aurora.minify.output.ignore.content.type: [ 'text/plain', 'text/csv', 'application/octet-stream', 'image/jpeg', 'image/png', 'image/gif', 'application/pdf', 'application/xml', 'application/zip' ]
    # https://developers.google.com/web/fundamentals/web-app-manifest
    #aurora.pwa.version_append:        "!php/eval `date('Y-m-d H')`"
    aurora.pwa.enabled: '%env(bool:AURORA_PWA_ENABLED)%'
    aurora.pwa.debug: '%env(bool:AURORA_PWA_DEBUG)%'
    aurora.pwa.version_append: "!php/eval `App\Utils::pwaVersionAppend()`"
    aurora.pwa.automatically_prompt: false
    aurora.pwa.app_name: ''
    aurora.pwa.app_short_name: ''
    aurora.pwa.app_description: ''
    aurora.pwa.start_url: '/?pwa'
    aurora.pwa.display: 'fullscreen'   # fullscreen | standalone | minimal-ui
    aurora.pwa.icons: '%kernel.project_dir%/public/static/img/favicon'
    aurora.pwa.theme_color: '#2C3E50' # Sets the color of the tool bar, and may be reflected in the app's preview in task switchers
    aurora.pwa.background_color: '#2C3E50' # Should be the same color as the load page, to provide a smooth transition from the splash screen to your app
    aurora.pwa.offline: '/aurora/pwa-offline'
    aurora.pwa.precache:
        - '/'
    aurora.pwa.prevent_cache_header_request_accept:
        - 'text/html'
        - 'text/html; charset=UTF-8'
        - 'application/json'
    aurora.pwa.prevent_cache:
        - '/ajax-requests'
        - '/q'
        - '/xhr'
        - '/login'
        - '/logout'
        - '/admin'
        - '.*\.mp4' # mp4 files are large, some browsers will not be able to fully cache it, meaning the video will not be displayed
        - '.*\/match-this\/.*'
    aurora.pwa.external_cache:
        - 'fonts.gstatic.com'
        - 'fonts.googleapis.com'
    aurora.dns_prefetch:
        - 'www.google.com'
        - 'fonts.googleapis.com'
        - 'fonts.gstatic.com'
        - 'googletagmanager.com'
        - 'www.googletagmanager.com'
        - 'www.google-analytics.com'
        - 'google-analytics.com'
        - 'googleads.g.doubleclick.net'
        - 'www.googletagservices.com'
        - 'adservice.google.com'
        - 'adservice.google.ro'
        - 'www.facebook.com'
        - 'gstatic.com'
        - 'www.gstatic.com'
        - 'google.com'
        - 'google.ro'
        - 'connect.facebook.net'
        - 'youtube.com'
        - 'addthis.com'
        - 'gemius.pl'
        - 'pubmatic.com'
        - 'innovid.com'
        - 'everesttech.net'
        - 'quantserve.com'
        - 'rubiconproject.com'
        - 'facebook.com'
        - 'agkn.com'
        - 'casalemedia.com'
```

 #### 🗂️ config/packages/dev/aurora.yaml

[](#️-configpackagesdevaurorayaml)

- Create the file `config/packages/dev/aurora.yaml` and add the following content:

```
parameters:
    aurora.minify.output: false
```

 #### 🗂️ composer.json

[](#️-composerjson)

- Edit `composer.json` and add the following content:

```
    "post-install-cmd": [
"Sindla\\Bundle\\AuroraBundle\\Composer\\ScriptHandler::postInstall"
],
"post-update-cmd": [
"Sindla\\Bundle\\AuroraBundle\\Composer\\ScriptHandler::postUpdate"
]
```

 #### 🗂️ config/packages/twig.yaml

[](#️-configpackagestwigyaml)

- Edit `config/packages/twig.yaml` and add the following content:

```
twig:
    default_path: '%kernel.project_dir%/templates'
    debug: '%kernel.debug%'
    strict_variables: '%kernel.debug%'
    exception_controller: ~
    paths:
        '%kernel.project_dir%/vendor/sindla/aurora/src/templates': Aurora
    globals:
        aurora: '@aurora.twig.utility'
```

 #### 🗂️ config/routes.yaml

[](#️-configroutesyaml)

- Will enable Aurora Black Hole, Favicons, Manifest &amp; PWA (Progressive Web Application) controllers
- Edit `config/routes.yaml` and add the following content:

```
aurora:
    resource: "@AuroraBundle/Resources/config/routes/routes.yaml"
```

Then run `composer update` to update and install the rest of the dependencies.

 #### ⚙️ Progressive Web Apps

[](#️-progressive-web-apps)

- To use Progressive Web Apps (PWA), edit your Twig template and between `` and `` add the following content:

```
{{ aurora.pwa(app.request) }}
```

 #### ⚙️ HTML Minifier

[](#️-html-minifier)

- To enable HTML Minifier edit `config/packages/aurora.yaml` and change `aurora.minify.output` to `true`, then edit `config/services.yaml` add the following content:

```
    Sindla\Bundle\AuroraBundle\EventSubscriber\OutputSubscriber:
        arguments:
            $container: '@service_container'
            $utilityExtension: '@aurora.twig.utility'
                #$headers:
            #text/html:
            #Strict-Transport-Security: "max-age=1536000; includeSubDomains"
            #Content-Security-Policy: "default-src 'self'"
            # ?aurora.nonce? will be replace with uniq nonce. for twig, use {{ aurora.nonce() }}
            #Content-Security-Policy: "script-src 'nonce-?aurora.nonce?' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; object-src 'none'"
            #Content-Security-Policy: "script-src 'self' 'unsafe-inline' 'unsafe-eval' https: http:; object-src 'none'"
            #Referrer-Policy: "no-referrer-when-downgrade"
        tags:
            - { name: kernel.event_listener, event: kernel.response }
```

 #### ⚙️ MaxMind GeoLite2Country &amp; GeoLite2City

[](#️-maxmind-geolite2country--geolite2city)

- When `composer install` and/or `composer update` are used, Aurora will try to automatically download the MaxMind GeoLite2Country &amp; GeoLite2City
- To enable this, edit your `.env.local` and add the following content (you will need a MaxMind licence key):

```
MAXMIND_LICENSE_KEY=_CHANGE_THIS_WITH_YOUR_PRIVATE_LICENTE_KEY_

SINDLA_AURORA_GEO_LITE2_COUNTRY=true
SINDLA_AURORA_GEO_LITE2_CITY=true
SINDLA_AURORA_GEO_LITE2_ASN=true
```

- Edit `config/services.yaml` and add/append the following content:

```
services:
    _defaults:
        bind:
            $auroraClient: '@aurora.client'
```

- Or edit `config/services.yaml` and add the following code to inject the `@aurora.client` only where it is needed:

```
services:
    App\Controller\TestController:
        arguments:
            $auroraClient: '@aurora.client'
```

- Edit your controller and add/append the following code:

```
