PHP 7.2, create_function() and old mods code

Started by Arris, October 06, 2018, 11:48:37 AM

Previous topic - Next topic

Arris

http://php.net/manual/en/function.create-function.php [nofollow]

create_function — Create an anonymous (lambda-style) function

Warning
This function has been DEPRECATED as of PHP 7.2.0. Relying on this function is highly discouraged.

So, some mods uses create_function() in their install.xml or source code.

Is there any recommendations for migration to valid code?

d3vcho

PHP 7.2.x is not supported by SMF 2.0.x at this time.
"Greeting Death as an old friend, they departed this life as equals"

Arantor

The only migration is to sit and rewrite every single bbcode mod (plus any others that used it).

All of the base ones in 2.1 are done but migrating this for 2.0 is borderline impossible to get right in a fixes-everything way.

Arris

Can I migrate from 2.0.15 to 2.1+ without problems?

Arantor

Well, 2.1 isn't ready yet. When it is, you will still need to get your theme updated (since 2.0 themes aren't compatible with 2.1), bbcode mods will definitely need updating, other mods may need updates too.

The fewer mods and changes you have, the better the upgrade possibility.

Ali_

This causes my smf_log_errors table to grow incredibly fast.  It was bigger than the actual forum board/topics and now I have to create a stored proceedure and an event to truncate that table once every day.  Otherwise, mysql ends up filling memory with this nonsense.  I am worried about the hit it takes on IO.   The error log grew to 1GB in a couple of days.

Can I re-write the Subs.php file where the error seems to orgininate so that it doesn't use create_function(), but rather an anonymous function?  Has anyone done this?

vbgamer45

Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Kiriakos GR

Any one using cPanel for web site management,  he may use MultiPHP manager module and select PHP 5.6  as default PHP engine.

By using SMF2.0.X-enablePHP7.2Compat_v1.3,  this masked the problem but when tried to uninstall old mod which was still delivering errors,  my forum crashed ( white index ). 

I was had to restore files backup and database backup, then switched to PHP 5.6, and now I am back in the world of livings.
Old backup this deactivated SMF2.0.X-enablePHP7.2Compat_v1.3 and forum functionality this is now restored.

Error log clear, no issues at all.     

GigaWatt

You can always choose PHP 7.1, it's still supported (till the end of this year, I think ???).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Ali_

@vbgamer45. Thank you, it worked like a charm.


Advertisement: