Digests

loads of warnings, php version issue? - Digests

loads of warnings, php version issue?

by iitee » Mon Mar 18, 2019 6:45 pm

Hi,

I was glad to find out the good old digest is back, thanks! However, I get plenty of warnings due for loop continue has changed:

Code: Select all

[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbservices/digests/cron/task/digests.php on line 573: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbservices/digests/cron/task/digests.php on line 589: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbservices/digests/cron/task/digests.php on line 597: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbservices/digests/cron/task/digests.php on line 643: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
[phpBB Debug] PHP Warning: in file [ROOT]/ext/phpbbservices/digests/cron/task/digests.php on line 702: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
It also happens in cron.

Finding the spots:

Code: Select all

# find ext/phpbbservices/ -name '*.php' -exec grep -n continue {} + 
ext/phpbbservices/digests/includes/html_messenger.php:264:                              continue;
ext/phpbbservices/digests/acp/main_module.php:907:                              continue;
ext/phpbbservices/digests/acp/main_module.php:1546:                     $continue = true;
ext/phpbbservices/digests/acp/main_module.php:1552:                             $continue = false;
ext/phpbbservices/digests/acp/main_module.php:1559:                             $continue = false;
ext/phpbbservices/digests/acp/main_module.php:1562:                     if ($continue && $this->config['phpbbservices_digests_test_clear_spool'])
ext/phpbbservices/digests/acp/main_module.php:1599:                                     $continue = false;
ext/phpbbservices/digests/acp/main_module.php:1604:                     if ($continue && $this->config['phpbbservices_digests_test_time_use'])
ext/phpbbservices/digests/acp/main_module.php:1613:                                     $continue = false;
ext/phpbbservices/digests/acp/main_module.php:1619:                     if ($continue)
ext/phpbbservices/digests/acp/main_module.php:1681:                             continue;
ext/phpbbservices/digests/acp/main_module.php:1691:                             continue;
ext/phpbbservices/digests/acp/main_module.php:1710:                             continue;
ext/phpbbservices/digests/cron/task/digests.php:559:                                            continue;
ext/phpbbservices/digests/cron/task/digests.php:573:                                                    continue;
ext/phpbbservices/digests/cron/task/digests.php:589:                                                    continue;
ext/phpbbservices/digests/cron/task/digests.php:597:                                                    continue;
ext/phpbbservices/digests/cron/task/digests.php:640:                                            // Write an error to the log and continue to the next subscriber.
ext/phpbbservices/digests/cron/task/digests.php:643:                                            continue;
ext/phpbbservices/digests/cron/task/digests.php:697:                                            // Write an error to the log and continue to the next subscriber.
ext/phpbbservices/digests/cron/task/digests.php:702:                                            continue;
ext/phpbbservices/digests/cron/task/digests.php:741:                                    // Write an error to the log and continue to the next subscriber.
ext/phpbbservices/digests/cron/task/digests.php:743:                                    continue;
ext/phpbbservices/digests/cron/task/digests.php:1759:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1767:                                           continue;
ext/phpbbservices/digests/cron/task/digests.php:1774:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1778:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1784:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1790:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1798:                                           continue;
ext/phpbbservices/digests/cron/task/digests.php:1806:                                           continue;
ext/phpbbservices/digests/cron/task/digests.php:1813:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1819:                                   continue;
ext/phpbbservices/digests/cron/task/digests.php:1827:                                   continue;
I use this docker image for phpBB, in case you are interested of reproducing this: https://hub.docker.com/r/blueimp/phpbb. It uses php7:

Code: Select all

# php --version
PHP 7.3.2 (cli) (built: Feb 21 2019 22:46:48) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.2, Copyright (c) 1998-2018 Zend Technologies
iitee
Registered User
Posts: 11
Joined: Sun Apr 27, 2008 12:01 pm

Re: loads of warnings, php version issue?

by iitee » Mon Mar 18, 2019 6:48 pm

Before getting that fixed, I wonder why I get those debug messages, even though I've set this in my config.php file:

@define('DEBUG', false);
@define('DEBUG_EXTRA', false);
iitee
Registered User
Posts: 11
Joined: Sun Apr 27, 2008 12:01 pm

Re: loads of warnings, php version issue?

by MarkDHamill » Mon Mar 18, 2019 7:04 pm

The issue may be because you are using PHP 7.3. I believe phpBB is not certified past 7.2. Try reducing the PHP version.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: loads of warnings, php version issue?

by iitee » Mon Mar 18, 2019 7:50 pm

it is likely due that. Everyone will hit it once php updates. Too bad container image doesn't have tag for older php versions.
iitee
Registered User
Posts: 11
Joined: Sun Apr 27, 2008 12:01 pm

Re: loads of warnings, php version issue?

by iitee » Mon Mar 18, 2019 8:02 pm

If I take the risk running it with 7.3, which way should those continues be changed? Break or continue2?
iitee
Registered User
Posts: 11
Joined: Sun Apr 27, 2008 12:01 pm

Re: loads of warnings, php version issue?

by MarkDHamill » Mon Mar 18, 2019 8:52 pm

I haven't tested it with PHP 7.3 and phpBB is not certified for PHP 7.3. So in addition to issues with this extension, if you use PHP 7.3 you will probably encounter other issue with the phpBB base code.

Most likely PHP 7.3 is just pickier and generates warnings if you don't explicitly set the continue level, which is continue 1 in this case.
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: loads of warnings, php version issue?

by iitee » Tue Mar 19, 2019 9:08 pm

Thanks. Just wanted to report back, that I took your advise and downgraded to php 7.2. It doesn't give the issues. I did this by modifying the phpbb container here: https://hub.docker.com/r/blueimp/phpbb/dockerfile and rebuilding it after changing

Code: Select all

FROM php:7-apache
to

Code: Select all

FROM php:7.2-apache
.

No errors any more. Great, thanks.
iitee
Registered User
Posts: 11
Joined: Sun Apr 27, 2008 12:01 pm

Re: loads of warnings, php version issue?

by MarkDHamill » Tue Mar 19, 2019 9:17 pm

Good news!
Need phpBB services or a phpBB consultant? I offer most phpBB services. Getting lost managing phpBB? Buy my book, Mastering phpBB Administration. Covers through phpBB 3.3.7. eBook and paper versions available.
User avatar
MarkDHamill
Registered User
Posts: 4933
Joined: Fri Aug 02, 2002 12:36 am
Location: Florence, MA USA

Re: loads of warnings, php version issue?

by genshijin » Mon Apr 22, 2019 1:34 pm

I have the same problem with php 7.2.17
Latest version of extension and phpbb.

I dropped it to 7.1 and will see how that goes.
genshijin
Registered User
Posts: 128
Joined: Fri Nov 09, 2018 2:03 pm
Location: Uk and sometimes Japan
Name: andy duggan