Twig config improvements (#5923)
* deprecate direct kimai_config access, which was only used internally * prevent access to system configs * prevent access to most configs in sandbox environments
This commit is contained in:
@@ -9,12 +9,11 @@
|
||||
|
||||
namespace App\Twig;
|
||||
|
||||
use App\Configuration\SystemConfiguration;
|
||||
use Symfony\Component\HttpFoundation\RequestStack;
|
||||
|
||||
final class Context
|
||||
{
|
||||
public function __construct(private SystemConfiguration $systemConfiguration, private RequestStack $requestStack)
|
||||
public function __construct(private readonly RequestStack $requestStack)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -58,8 +57,8 @@ final class Context
|
||||
|
||||
public function getBranding(string $config): mixed
|
||||
{
|
||||
@trigger_error('Use "kimai_config" instead of "kimai_context" to access system configurations', E_USER_DEPRECATED);
|
||||
@trigger_error('Use config() instead of "kimai_context" to access system configurations', E_USER_DEPRECATED);
|
||||
|
||||
return $this->systemConfiguration->find('theme.branding.' . $config);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user