1.7.1 Patch Release: Adds Support for Multiple Filesystem Data Roots
Changelog
- Allow multiple root paths for FileSystemLoader #851 (robfrawley)
- Fix strange wording in readme #847 (svenluijten)
Upgrade
-
[Data Loader] The
FileSystemLoaderdata loader performs a more robust security check against image resource paths to ensure they reside within the defined data root path(s). If utilizing symbolic links, you should reference the troubleshooting guide at the end of this upgrade notice. -
[Data Loader] The
FileSystemLoaderdata loader now accepts an array of paths (as strings) for its third constructor argument, enabling the loader to check multiple paths for the requested image resource. Note that this change creates a BC break for those relying on the protected class propertyFileSystemLoader::$dataRoot, whose type has changed tostring[]and has been renamed to$dataRoots(plural). -
[Configuration] The
liip_imagine.loaders.default.filesystem.data_rootconfiguration option now accepts an array of paths (as strings), or a single string path (to preserve BC). This change allows thefilesystemdata loader to check multiple data root paths for the requested image resource. The following YML configuration provides examples using both a string and an array for the value.# provide an array of scalar paths liip_imagine: loaders: default: filesystem: data_root: - /multiple/root/paths/foo - /multiple/root/paths/bar # provide an single scalar path liip_imagine: loaders: default: filesystem: data_root: /single/root/path
-
[Troubleshooting] If you are using the
FileSystemLoaderdata loader in conjunction with symbolic links that point outside thedata_root(which defaults to%kernel.root_dir%/../web) then you are required to set all outside resource paths under thedata_rootoption.The following is a list of the most common exception error messages encountered when the
data_rootoption is not correctly configured- Source image not resolvable "%s" in root path(s) "%s"
- Source image invalid "%s" as it is outside of the defined root path(s) "%s"
The full option key for
data_rootisliip_imagine.loaders.default.filesystem.data_root