smarty-php / smarty

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic.
Other
2.23k stars 703 forks source link

How to disable deprecation warning? #958

Closed KarelWintersky closed 4 months ago

KarelWintersky commented 4 months ago

Using unregistered function "getenv" in a template is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier.

Using unregistered static method "Arris\AppRouter::getRouter('ajax.view.poi.info')" in a template is deprecated and will be removed in a future release. Use Smarty::registerClass to explicitly register a class for access.

how to suppress such message in latest Smarty Releases?

Yes, I know what I'm doing.

No, I am not able to declare these methods due to certain architectural limitations of the project.

wisskid commented 4 months ago

See https://www.php.net/manual/en/function.error-reporting.php

jszczypk commented 3 months ago

You can mute E_USER_DEPRECATED globally or just in Smarty using something like:

$smarty->error_reporting = error_reporting() & ~E_USER_DEPRECATED;