Skip to content

4.2. Update configuration

ezpublish configuration key

The main YAML configuration key is now ezplatform instead of ezpublish. You need to change your configuration files to make use of the new key. For example:

Use:

1
2
3
4
ezplatform:
    system:
        default:
            # ...

instead of:

1
2
3
4
ezpublish:
    system:
        default:
            # ...

Resolving settings

If you used dynamic settings (through $setting$), or got settings from the ConfigResolver in a class constructor, you now need to rewrite your code to inject the ConfigResolver and get the relevant setting:

Use:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
use eZ\Publish\Core\MVC\ConfigResolverInterface;

class MyService
{
    /** @var \eZ\Publish\Core\MVC\ConfigResolverInterface */
    private $configResolver;

    public function __construct(ConfigResolverInterface $configResolver)
    {
        $this->configResolver = $configResolver;
    }

    public function myMethodWhichUsesSetting(): void
    {
        $setting = $this->configResolver->getParameter('setting');
    }
}

instead of:

1
2
3
4
5
6
7
8
9
use eZ\Publish\Core\MVC\ConfigResolverInterface;

class MyService
{
    public function __construct(ConfigResolverInterface $configResolver)
    {
        $this->setting = $configResolver->getParameter('setting');
    }
}