PHP7 depreciated constructor (v2.14)

by nickrickard, Tuesday, December 15, 2015, 17:26 (2991 days ago)

Following an upgrade to PHP7.0 (7.0.0-4 on Debian sid), I now get the following message each time cliupdate.php is run from a cron job.

"Methods with the same name as their class will not be constructors in a future version of PHP; floIcon has a deprecated constructor
an error occured"

The update appears to still work so I think this is an information rather than critical warning, but might need a tweak for a future version of selfoss as more people move to PHP7.

PHP7 depreciated constructor (v2.14)

by R00KIE, Wednesday, January 06, 2016, 17:56 (2969 days ago) @ nickrickard

You probably want to take a closer look and check if all feeds are being updated.

I'm also seeing this message/error on Arch Linux ARM after the update to php7 and some of my feeds are not updating.

I'm using the current 2.14 release and I'm planning to try the git version to see if it works, unless you have already tried it and it doesn't work.

PHP7 depreciated constructor (v2.14)

by nickrickard, Wednesday, January 06, 2016, 18:14 (2969 days ago) @ R00KIE

Good spot, thanks: not all my feeds are being updated by the cron job. I'm not sure what determines which are and which aren't.

A manual update by loading "www.mysite..../selfoss/update" seems to work okay. I've taken to using this rather than the cron job I had previously in order to cut down on error messages/logs.

I haven't tried the git version yet - from a quick scan of the changelogs I couldn't explicitly see anything to suggest this issue had been addressed.

PHP7 depreciated constructor (v2.14)

by R00KIE, Wednesday, January 06, 2016, 19:38 (2969 days ago) @ nickrickard
edited by R00KIE, Wednesday, January 06, 2016, 19:55

I've just tried the current git version and it also fails to update some feeds.

I still get the "Error Methods with the same name as their class will not be constructors in a future version of PHP; floIcon has a deprecated constructor" message.

This is an error and once you it this all further processing stops. It seems selfoss will later try other feeds so I suppose it will skip the "offending" feeds and still manage to update the ones that don't cause problems.

Example log:

### I've triggered an update via the web interface by clicking the update button

01-06-16 18:31:00 Debug Establish database connection
01-06-16 18:31:44 Debug Establish database connection
01-06-16 18:31:54 Debug ---
01-06-16 18:31:54 Debug start fetching source "Hackaday (id: 32)
01-06-16 18:31:54 Debug spout successfully loaded: spouts\rss\feed
01-06-16 18:31:54 Debug fetch content
01-06-16 18:31:55 Debug minimum date: 2015-10-08 18:31:55
01-06-16 18:31:55 Debug start item fetching
01-06-16 18:31:55 Debug start insertion of new item "The Most Plausible Apollo Moon Landing Conspiracy Ever Devised"
01-06-16 18:31:56 Debug item content sanitized
01-06-16 18:31:57 Error Methods with the same name as their class will not be constructors in a future version of PHP; floIcon has a deprecated constructor

### It stopped here with a popup saying: "Can not refresh sources: Internal Server Error", then I've triggered another update and it seems to continue until it hits another problematic feed (not shown).

01-06-16 18:34:22 Debug Establish database connection
01-06-16 18:34:28 Debug ---
01-06-16 18:34:28 Debug start fetching source "LWN.net (id: 33)
01-06-16 18:34:28 Debug spout successfully loaded: spouts\rss\feed
01-06-16 18:34:28 Debug fetch content
01-06-16 18:34:29 Debug minimum date: 2015-10-08 18:34:29
01-06-16 18:34:29 Debug start item fetching
01-06-16 18:34:29 Debug start insertion of new item "Security updates for Wednesday"
01-06-16 18:34:29 Debug item content sanitized
01-06-16 18:34:30 Debug icon: using feed homepage favicon: http://lwn.net/images/favicon.png
01-06-16 18:34:31 Debug icon generated: http://lwn.net/images/favicon.png
01-06-16 18:34:34 Debug item inserted
01-06-16 18:34:34 Debug Memory usage: 4099600
01-06-16 18:34:34 Debug Memory peak usage: 5399000
01-06-16 18:34:34 Debug destroy spout object
01-06-16 18:34:39 Debug ---

I guess it's time to take to take a trip to the bug tracker.

PHP7 depreciated constructor (v2.14) [WORKAROUND]

by nickrickard, Sunday, January 10, 2016, 11:49 (2965 days ago) @ nickrickard

Workaround / potential solution of renaming the constructor is kindly provided here:

https://github.com/SSilence/selfoss/issues/731#issuecomment-170017665

RSS Feed of thread
powered by my little forum