phpBB2Refugees.com Logo
Not affiliated with or endorsed by the phpBB Group

Register •  Login 

Continue the legacy...

Welcome to all phpBB2 Refugees!Wave Smilie

This site is intended to continue support for the legacy 2.x line of the phpBB2 bulletin board package. If you are a fan of phpBB2, please, by all means register, post, and help us out by offering your suggestions. We are primarily a community and support network. Our secondary goal is to provide a phpBB2 MOD Author and Styles area.

Upgrade for PHP 7.x

Goto page Previous  1, 2, 3, 4, 5, 6, 7
 
Search this topic... | Search phpBB2 Discussion... | Search Box
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Author Message
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 194



PostPosted: Wed May 27, 2020 1:20 pm 
Post subject: Re: Upgrade for PHP 7.x

@Jim I mean who at the PHP team decided that change...
_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
Jim_UK
Board Member



Joined: 19 Nov 2008

Posts: 611
Location: North West UK


flag
PostPosted: Wed May 27, 2020 1:37 pm 
Post subject: Re: Upgrade for PHP 7.x

Vendethiel wrote:
@Jim I mean who at the PHP team decided that change...


Yes I know that was what you meant but clearly hibinyru didn't understand so my post was directed at him.

hibinyru wrote:
What do you mean?


It does seem a strange change to make. Presumably they did explain why they made the change.

Jim

_________________
The truth is out there.
Unfortunately they will not let you anywhere near it!
Back to top
hibinyru
Board Member



Joined: 04 May 2020

Posts: 11



PostPosted: Wed May 27, 2020 2:24 pm 
Post subject: Re: Upgrade for PHP 7.x

Thanks everybody icon_smile.gif

mmm...
how correct replace that construction in php 7.x?

Code:
while (list(, $file_name) = each($file_names)) {


Where list (,y) ?

i never used list() in my code, so don;t understand fully
Back to top
StarWolf3000
Board Member



Joined: 10 Jun 2010

Posts: 152
Location: Germany


flag
PostPosted: Wed May 27, 2020 2:25 pm 
Post subject: Re: Upgrade for PHP 7.x

hibinyru wrote:
Thanks everybody icon_smile.gif

mmm...
how correct replace that construction in php 7.x?

Code:
while (list(, $file_name) = each($file_names)) {


Where list (,y) ?

i never used list() in my code, so don;t understand fully

Assuming that one is not already modified, it would be this:
Code:
while (list($file_name) = each($file_names)) {
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 194



PostPosted: Fri May 29, 2020 10:14 am 
Post subject: Re: Upgrade for PHP 7.x

You probably want a simpler foreach:
Code:
foreach ($file_names as $file_name)
{

_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
b0blee
Board Member



Joined: 11 Jun 2012

Posts: 17
Location: Cloverdale, northern California



PostPosted: Sun Jul 05, 2020 12:31 am 
Post subject: Re: Upgrade for PHP 7.x

Vendethiel:

Just finally getting around to doing this (Covid-19 time icon_neutral.gif ) Working my way through the code with all warnings on. PHP 7.4.7

I got
Quote:
Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; sql_db has a deprecated constructor in ./db/mysqli.php on line 33

So I replaced declaration of function sql_db(...) with function __construct(...). Same parameter list. Seems to work. Database connects.

_________________
-𝕓𝕆𝕓- at The Steel Guitar Forum
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 194



PostPosted: Mon Jul 06, 2020 12:09 am 
Post subject: Re: Upgrade for PHP 7.x

Yes. This one is just a warning for now, thankfully.
_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
b0blee
Board Member



Joined: 11 Jun 2012

Posts: 17
Location: Cloverdale, northern California



PostPosted: Mon Jul 06, 2020 12:48 am 
Post subject: Re: Upgrade for PHP 7.x

Anyone have a solution for this line from function bbencode_first_pass() in bbcode.php?

Code:
   // [img]image_url_here[/img] code..
   $text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);

I'll be the first to admit that I can't follow regular expressions. I think that the 'e' in '#sie' is the culprit. In PHP 7.4 I get the warning:

Quote:
preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead

Documentation in https://www.php.net/manual/en/reference.pcre.pattern.modifiers.php explains how to fix it, but I don't feel competent enough to rewrite that line.

UPDATE: I just discovered that member clausl posted the fix on page 2 of this topic. Thank you!

Code:
   $teil1="#\[img\]((http|ftp|https|ftps):..)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[.img\]#si";
   $text = preg_replace_callback($teil1, function($matches) { return '[img:' . 'h176ju' . ']' . $matches[1] . str_replace(' ', '%20', $matches[3]) . '[/img:' . 'h176ju' . ']'; }, $text);
   $text = str_replace('h176ju',$uid,$text);

_________________
-𝕓𝕆𝕓- at The Steel Guitar Forum
Back to top
MWE_001
Board Member



Joined: 29 Jul 2011

Posts: 15



PostPosted: Fri Jul 10, 2020 9:48 pm 
Post subject: Re: Upgrade for PHP 7.x

Hey Ven, does the phpBB version you and Helter worked on at Integra have any changes needed to run on php this high or did we stop at 7.0.2 or something like that? If my mind serves me correct, I don't believe it went to 7.4 though.
Back to top
Vendethiel
Board Member



Joined: 26 Oct 2014

Posts: 194



PostPosted: Sat Jul 11, 2020 5:23 pm 
Post subject: Re: Upgrade for PHP 7.x

It's mostly Helter honestly. I think it was compatible with 7.0, and 7.1

I worked more on IntegraMOD and I think it's more forward-compatible, though it may still produce a lot of warnings.

_________________
Developer on EzArena, the ADR premod.
Developer on Icy Phoenix, the phpBB hybrid cms.
Developer on IntegraMOD, the full-featured premod.
Help me archive premods on github! (fixed for recent PHPs).
Back to top
Display posts from previous:   
Register or Login to Post    Index » phpBB2 Discussion  Previous TopicPrint TopicNext Topic
Page 7 of 7 All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7
 
Jump to:  

Index • About • FAQ • Rules • Privacy • Search •  Register •  Login 
Not affiliated with or endorsed by the phpBB Group
Powered by phpBB2 © phpBB Group
Generated in 0.0305 seconds using 15 queries. (SQL 0.0031 Parse 0.0010 Other 0.0265)
phpBB Customizations by the phpBBDoctor.com
Template Design by DeLFlo and MomentsOfLight.com Moments of Light Logo