Skip to content

1.7.3 Patch Release: FileSystem Locator Non-Shared, Auto Bundle Registration, Data Root Indexes

Compare
Choose a tag to compare
@robfrawley robfrawley released this 02 Mar 05:05
· 823 commits to 2.x since this release
1.7.3

Changelog

Full Changelog

  • [Tests] Support PHPUnit 5.x (and remove depredations) #887 (robfrawley)
  • [Tests] Assert expected deprecation using symfony/phpunit-bridge #886 (robfrawley)
  • [Minor] [Docs] Fix typo in general filters documentation #888 (svenluijten)
  • [Loader] Add bundle resources to safe path when requested #883 (bobvandevijver, robfrawley)
  • [Tests] Enable mongo unit tests on PHP7 using "mongo" => "mongodb" extension adapter #882 (robfrawley)
  • [Loader] [Locator] FileSystemLocator service must not be shared #875 (robfrawley)

Upgrade

  • [Data Loader] The FileSystemLoader now allows you to assign keys to data roots, and directly reference them when requesting resources.

      # provide index for data roots
      liip_imagine:
        loaders:
          default:
            filesystem:
              data_root:
                foo: /path/to/foo
                bar: /path/to/bar
    

    Assume you have a file name file.ext in both data root paths. Given the above configuration, you can specifically request the file from the /path/to/foo root using the following file syntax: @foo:file.ext. Similarly, you can request the same file from /path/to/bar using @bar:file.ext. Note, that the auto-registered bundles (detailed below) are given indexes of their short bundle name (for example, given the bundle FooBundle, you can request a file from its public resources path via @FooBundle:path/to/file.ext).

  • [Data Loader] The FileSystemLoader now supports automatically registering the Resources/public folders within all loaded bundles. This can be enabled via the following configuration.

      # enable bundle auto-registration
      liip_imagine:
        loaders:
          default:
            filesystem:
              bundle_resources:
                enabled: true
    

    Additionally, you can whitelist or blacklist specific bundles from the auto-registration routine.

      # blacklist "FooBundle" from auto-registration
      liip_imagine:
        loaders:
          default:
            filesystem:
              bundle_resources:
                enabled: true
                access_control_type: blacklist
                access_control_list:
                  - FooBundle
    
      # whitelist "BarBundle" from auto-registration
      liip_imagine:
        loaders:
          default:
            filesystem:
              bundle_resources:
                enabled: true
                access_control_type: whitelist
                access_control_list:
                  - BarBundle
    
  • [Data Locator] The *Locator services passed to FileSystemLoader are now marked as "non-shared" or "prototype" within the DI container, resulting in new instances being passed every time the services are requested.