maxf5 Posted November 28, 2024 Share Posted November 28, 2024 hey community! i am wondering if processwire is still ready for php 8.4? getting so much deprecated warnings with 8.4.1: Deprecated: ProcessWire\Database::getQueryLog(): Implicitly marking parameter $wire as nullable is deprecated, the explicit nullable type must be used instead in wire/core/Database.php on line 142 Deprecated: ProcessWire\MarkupFieldtype::__construct(): Implicitly marking parameter $page as nullable is deprecated, the explicit nullable type must be used instead in wire/core/MarkupFieldtype.php on line 82 Deprecated: ProcessWire\MarkupFieldtype::__construct(): Implicitly marking parameter $field as nullable is deprecated, the explicit nullable type must be used instead in wire/core/MarkupFieldtype.php on line 82 Deprecated: ProcessWire\Tfa::getModule(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in wire/core/Tfa.php on line 491 Deprecated: ProcessWire\Tfa::autoEnableSupported(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in wire/core/Tfa.php on line 922 Deprecated: ProcessWire\RememberTfa::serverValue(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in wire/core/Tfa.php on line 1904 Deprecated: ProcessWire\RememberTfa::getFingerprintString(): Implicitly marking parameter $types as nullable is deprecated, the explicit nullable type must be used instead in wire/core/Tfa.php on line 1961 Deprecated: ProcessWire\ModulesConfigs::getModuleConfigInputfields(): Implicitly marking parameter $form as nullable is deprecated, the explicit nullable type must be used instead in wire/core/ModulesConfigs.php on line 561 Deprecated: ProcessWire\ModulesLoader::hasPermission(): Implicitly marking parameter $user as nullable is deprecated, the explicit nullable type must be used instead in wire/core/ModulesLoader.php on line 750 Deprecated: ProcessWire\ModulesLoader::hasPermission(): Implicitly marking parameter $page as nullable is deprecated, the explicit nullable type must be used instead in wire/core/ModulesLoader.php on line 750 Deprecated: ProcessWire\Language::__construct(): Implicitly marking parameter $tpl as nullable is deprecated, the explicit nullable type must be used instead in wire/modules/LanguageSupport/Language.php on line 31 Deprecated: ProcessWire\Languages::setDefault(): Implicitly marking parameter $language as nullable is deprecated, the explicit nullable type must be used instead in wire/modules/LanguageSupport/Languages.php on line 309 Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in wire/core/WireSessionHandler.php on line 51 Link to comment Share on other sites More sharing options...
bernhard Posted November 28, 2024 Share Posted November 28, 2024 https://github.com/processwire/processwire-issues/issues/2000 3 Link to comment Share on other sites More sharing options...
horst Posted November 28, 2024 Share Posted November 28, 2024 5 hours ago, maxf5 said: hey community! i am wondering if processwire is still ready for php 8.4? getting so much deprecated warnings with 8.4.1: Deprecation warnings say, that it potentially may not be ready for 8.4.2 or 8.4.3 or any other further version. But in my understanding, it is ready for PHP 8.4.0 and 8.4.1. 🙂 If the deprecation warnings bother you, you can disable showing only those messages with a call of PHPs set_error_handler(): /** OWN ERROR HANDLER FOR DEPRECATION NOTES ************************************/ function myLocalDevDeprecationErrorHandler($errno, $errstr, $errfile, $errline) { return true; // true | false = suppress further processing } // preceed the callback function name with the PW namespace, // and define the error types that should passed to the function set_error_handler('ProcessWire\myLocalDevDeprecationErrorHandler', E_DEPRECATED); /** OWN ERROR HANDLER FOR DEPRECATION NOTES ************************************/ I often use this directly in site/config-dev.php, when I want to collect them, but only show them collected at the end of pages in dev local. /** OWN ERROR HANDLER FOR DEPRECATION NOTES ************************************/ function myLocalDevDeprecationErrorHandler($errno, $errstr, $errfile, $errline) { // CHECK / CREATE COLLECTION CONTAINER if (!isset($GLOBALS['DEPRECATION_WARNINGS_BAG'])) { $GLOBALS['DEPRECATION_WARNINGS_BAG'] = []; } if (!is_array($GLOBALS['DEPRECATION_WARNINGS_BAG'])) { $GLOBALS['DEPRECATION_WARNINGS_BAG'] = []; } // DO NOT SHOW THIS KNOWN THIRD PARTY ONES : $hideThisOnes = [ //'FileCompiler', 'Duplicator', 'ProcessCustomUploadNames', ]; foreach($hideThisOnes as $item) { if (preg_match("/{$item}/", $errfile)) return true; } // ADD IT TO THE COLLECTION $GLOBALS['DEPRECATION_WARNINGS_BAG'][] = [$errfile, $errline, $errstr]; return true; // true | false = suppress further processing } // preceed the callback function name with the PW namespace, // and define the error types that should passed to the function set_error_handler('ProcessWire\myLocalDevDeprecationErrorHandler', E_DEPRECATED); /** OWN ERROR HANDLER FOR DEPRECATION NOTES ************************************/ 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now