PHP 6 and phpBB

Discussion of general topics related to the new version and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Forum rules
Discussion of general topics related to the new release and its place in the world. Don't discuss new features, report bugs, ask for support, et cetera. Don't use this to spam for other boards or attack those boards!
Post Reply
User avatar
Dog Cow
Registered User
Posts: 271
Joined: Wed May 25, 2005 2:14 pm

PHP 6 and phpBB

Post by Dog Cow »

Last evening I downloaded the sources for PHP 5.2.6 and PHP 6.0-dev. I compiled PHP 5.2.6 on my Mac OS X, but was missing ICU and re2c for 6, so now I have those, I will start compiling later today.

Anyway, here is my discussion point: It seems to me that because PHP 6 will offer full Unicode implementation, meaning that your strings and vars will always be multibyte, that some parts of the phpBB 3 code will be unecessary, is that correct?

On the whole, PHP 6 looks pretty fascinating. Some of the main changes are:

- no more register_globals support. That means that security will be better for apps not well thought-of.

- no more long arrays for super globals, ie: $HTTP_POST_VARS because simply $_POST. It's a lazy-man's wonder world.

- full Unicode support. This means multibyte char sets and string-handling functions can handle languages such as Russian or Kanji where it takes more than 1 byte of memory to store the character. Currently, functions such as strlen(), which returns the length of a string, assumes each char takes 1 byte, and as such would return wrong values on multibyte strings.

- no more safe mode and no more magic_quotes_gpc

I really recommend download the latest source here and compiling it: http://snaps.php.net/php6.0-200806191830.tar.bz2

Looking at some of the docs, for converting from PHP 4 to 5, and then from 5 to 6, it doesn't look there are too many major changes that will cause our current PHP 5 scripts to fail. I'm sure even the venerable 2.0.x line could be made to run on 6.

Anyway, has anyone here run phpBB on PHP 6? I'm going to do so later this week/weekend and will gladly report back. Should be interesting, eh?

User avatar
DavidMJ
Registered User
Posts: 932
Joined: Thu Jun 16, 2005 1:14 am
Location: Great Neck, NY

Re: PHP 6 and phpBB

Post by DavidMJ »

Quite some time ago, I tried running phpBB on PHP 6 and it seems to work. On the whole, I am disappointed with the backwards compatability breaking approach that they have chose, they seem to make the wrong decision in this area far too often. If you want to mess with phpBB on PHP 6, try running it with unicode.semantics disabled, it will give you the best experience.

As for removing stuff, the PHP group expose a tiny amount of ICU, not enough for us to throw away things like sanitizing usernames. However, normalization is taken care of for us.

Enjoy
- Dave
Freedom from fear

User avatar
Dog Cow
Registered User
Posts: 271
Joined: Wed May 25, 2005 2:14 pm

Re: PHP 6 and phpBB

Post by Dog Cow »

Yes, well of course you must maintain PHP 5 support for at least a year or two :lol: . So you couldn't take out all your Unicode sanitizing functions.

What I'm interested in is how PHP 6 will be handling memory, because I spent about 30-45 minutes reading over all the docs which came with the source (even came across unicode.semantics directive you mentioned) and it stated that because of some changes in 5.2 it ended up using more memory in some cases, and so the default was changed from 8M to 16M.

As for being disappointed with the backwards compatibility breaking approach, is there anything specifically you don't like?

One of my "at-home" projects for the summer is going to look at what changes are needed to get phpBB 2.0.x to run on 6. :geek:

Oh yeah, and I read something about timezones too, so I will have to go back and look at that. Could be more useful than current GMT selector thingy.

User avatar
DavidMJ
Registered User
Posts: 932
Joined: Thu Jun 16, 2005 1:14 am
Location: Great Neck, NY

Re: PHP 6 and phpBB

Post by DavidMJ »

unicode.semantics has to be the worst "feature" ever, check out the debates on the php internals mailing list
Freedom from fear

LEW21
Registered User
Posts: 128
Joined: Fri Nov 04, 2005 9:27 pm

Re: PHP 6 and phpBB

Post by LEW21 »

DavidMJ wrote:unicode.semantics has to be the worst "feature" ever, check out the debates on the php internals mailing list
It was removed a month ago.
phpBB3.pl - user-friendly Polish phpBB3 support

User avatar
DavidMJ
Registered User
Posts: 932
Joined: Thu Jun 16, 2005 1:14 am
Location: Great Neck, NY

Re: PHP 6 and phpBB

Post by DavidMJ »

Is it always on or always off?
Freedom from fear

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: PHP 6 and phpBB

Post by naderman »

Obviously always on, otherwise there would be no unicode support at all ;-) I'm pretty happy they didn't make unicode an option. Though the downside of how they did it, is that we have quite a compatability problem now.

User avatar
Dog Cow
Registered User
Posts: 271
Joined: Wed May 25, 2005 2:14 pm

Re: PHP 6 and phpBB

Post by Dog Cow »

I compiled and installed PHP 6.0.0-dev from source last evening and spent the rest of the night testing every script I could with it. You'd be surprised how many popular scripts today are not immediately compatible with PHP 6, and thus require more in-depth adjustments. Wordpress, for example, is one.

Both phpBB 1 and 2 will run on PHP 6. phpBB 1 needs just one change, and phpBB 2 needs just three changes. Funnily enough, phpBB 3.0.4 needed more changes to get running on 6 than phpBB 2 needed. But I also ran the 3.1.x copy I've got, and I can tell that was written with 6 in mind, and so had less changes needed.

I want to give a big compliment to everyone who has written phpBB -- every version -- because you all seem to have done a great job writing compatible code. :D

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: PHP 6 and phpBB

Post by EXreaction »

How did you get phpBB 1.x to run on PHP6 with 1 edit?

Back when I wanted to try it out I couldn't even get it running on PHP4/MySQL 4 IIRC.

User avatar
Dog Cow
Registered User
Posts: 271
Joined: Wed May 25, 2005 2:14 pm

Re: PHP 6 and phpBB

Post by Dog Cow »

EXreaction wrote:How did you get phpBB 1.x to run on PHP6 with 1 edit?

Back when I wanted to try it out I couldn't even get it running on PHP4/MySQL 4 IIRC.
Ah, should I tell you the secret? :lol: I've also got MySQL 5.1.30, so that phpBB 1.4.4 forum is running on some shiny stuff.

Screenshot for proof!

Ok, here is the change: in the english language file, there is a strange character that is out of the usual ASCII character-set. It's some text ornament, similar to a bullet point. You just delete that, and it works. Now, you have to make one other change due to the fact that register_globals is no longer around, but that's "optional". ie, you can get pages to load without doing that change. :P

Why did I say one change? Well, I did the globals change before I installed PHP 6. And then I made the language file change after I installed PHP 6. So depending on how you look at it, technically that was just one change needed.

As always, YMMV. :?

Post Reply