I’m using a “top level” package “Framework” (Neos Flow 6.3.0), which contains functions usable for all other packages.
Currently I’m building a FileUploadService in the Framework package. However, which file type, which file size etc is allowed is stored in the package related configuration yaml files of the other packages.
In Framework I have to inject the settings from the other packages. Using the following code, I’m just getting the setttings of the Framework package:
if i understand correctly you dont just want the all the settings of package a or b but ALL the settings… ?
you can just simply ask the ConfigurationManager and call the getConfiguration(‘settings’) (or similar, look up the code ^^)
maybe even objects.yaml could help, by specifing that settings should be used for a certain property, but not accessing a specific path like: propertyA: settings: ""
Thank you very much for your prompt reply. "you dont just want the all the settings of package a or b but ALL the settings… " Yes, you’re right. In the worst case Framework package doesn’t know, which other packages are installed.
Following your suggestions, I tried the following:
thank you very much for your help. How to inject settings of a specific package I know. However, in the worst case the Framework package does not know, wich other packages are installed. Therefore, I’m looking for a more generic way…
you can have the same for all settings - it might be a bit over engineered but here we go:
<?php
namespace Foo\Bar;
class Lol
{
public function injectAllSettings(array $settings)
{
// global settings
}
public function injectSettings(array $settings)
{
// local package settings
}
}