Upgrade to PHP 8

Game development with Board Game Arena Studio
Post Reply
User avatar
joezg
Posts: 65
Joined: 16 June 2011, 17:17

Upgrade to PHP 8

Post by joezg »

Dear developers.
We are preparing the migration of BGA game servers to PHP 8. All games deployed to production must eventually be compatible with PHP 8 so we are currently analyzing them and patching them to solve common issues. We will individually contact you if your game cannot be simply patched and we will coordinate the upgrade with you.

The upgrade to PHP 8 will be done in two steps. We will first upgrade the Studio game server. At that point you will be able to check if your game works well with PHP 8 and fix any potential issue.
Following that, we will upgrade all the production game servers. Until this is done and we officially announce that boardgamearena is running on PHP 8, no specific PHP 8 feature is allowed.

We will post the exact date on this very channel. The upgrade of the Studio Game server will, most likely, be done during the January with upgrade of the production following shortly.
User avatar
Kayvon
Posts: 353
Joined: 17 October 2011, 01:39

Re: Upgrade to PHP 8

Post by Kayvon »

joezg wrote: 21 December 2023, 18:08We will individually contact you if your game cannot be simply patched and we will coordinate the upgrade with you.
Will you contact us even if our games can be simply patched? If you patch my code without telling me, I'm likely to overwrite your changes next time I upload a bug fix. I'd prefer for that not to happen, so please let me know if my code is modified.
User avatar
p1ngouiin
Posts: 9
Joined: 26 October 2022, 09:52

Re: Upgrade to PHP 8

Post by p1ngouiin »

Kayvon wrote: 22 December 2023, 04:18
joezg wrote: 21 December 2023, 18:08We will individually contact you if your game cannot be simply patched and we will coordinate the upgrade with you.
Will you contact us even if our games can be simply patched? If you patch my code without telling me, I'm likely to overwrite your changes next time I upload a bug fix. I'd prefer for that not to happen, so please let me know if my code is modified.
For now, the only change we applied on almost all games is the `implode` rule (https://www.php.net/manual/en/function.implode.php). If, in any case, you erased our changes, that's not a big deal. We could either re-patch the game before switching to PHP 8.x, or, you will be able to detect that your game doesn't work by yourselves directly on the studio (when the first step will be done). All games that could simply be patched have been patched already. So, if your games are not in active development, they have probably been patched.

We will keep communicating about this, to ensure everything is working well on PHP 8.x.
User avatar
Victoria_La
Posts: 621
Joined: 28 December 2015, 20:55

Re: Upgrade to PHP 8

Post by Victoria_La »

Is it possible to provide a list of games that has been patched?
User avatar
quietmint
Posts: 265
Joined: 31 July 2017, 00:28

Re: Upgrade to PHP 8

Post by quietmint »

As I mentioned in January 2021, a very common issue I foresee is related to static vs non-static method calls.

https://www.php.net/manual/en/language.oop5.static.php
Warning
Calling non-static methods statically throws an Error.

Prior to PHP 8.0.0, calling non-static methods statically were deprecated, and generated an E_DEPRECATED warning.
The Studio docs have never taken care on this point and are littered with incorrect usage. Since the documentation isn't consistent, you can bet that game code isn't consistent either. :lol: Same page https://en.doc.boardgamearena.com/Main_ ... e.game.php has both non-static (correct) and static (incorrect) examples for the same function:

Code: Select all

$players = $this->loadPlayersBasicInfos(); // okay
$players = self::loadPlayersBasicInfos(); // error
User avatar
GTSchemer
Posts: 415
Joined: 09 August 2013, 03:26

Re: Upgrade to PHP 8

Post by GTSchemer »

p1ngouiin wrote: 22 December 2023, 09:34
Kayvon wrote: 22 December 2023, 04:18
joezg wrote: 21 December 2023, 18:08We will individually contact you if your game cannot be simply patched and we will coordinate the upgrade with you.
Will you contact us even if our games can be simply patched? If you patch my code without telling me, I'm likely to overwrite your changes next time I upload a bug fix. I'd prefer for that not to happen, so please let me know if my code is modified.
For now, the only change we applied on almost all games is the `implode` rule (https://www.php.net/manual/en/function.implode.php). If, in any case, you erased our changes, that's not a big deal. We could either re-patch the game before switching to PHP 8.x, or, you will be able to detect that your game doesn't work by yourselves directly on the studio (when the first step will be done). All games that could simply be patched have been patched already. So, if your games are not in active development, they have probably been patched.

We will keep communicating about this, to ensure everything is working well on PHP 8.x.
Is it possible to still communicate with the developer when patching, e.g. via BGA message? Even with the paths you describe, I still foresee devs accidentally overwriting games when they later update them, if they missed checking 100% of their games and resyncing offline code during the Studio test period. Some devs have a LOT of games.
User avatar
LeSteffen
Posts: 38
Joined: 13 July 2020, 15:32

Re: Upgrade to PHP 8

Post by LeSteffen »

Happy about the change :D
User avatar
Kayvon
Posts: 353
Joined: 17 October 2011, 01:39

Re: Upgrade to PHP 8

Post by Kayvon »

GTSchemer wrote: 23 December 2023, 19:50Is it possible to still communicate with the developer when patching, e.g. via BGA message?
Apparently, the answer is no. I just noticed one of my games had been changed just as I was deploying. :(
User avatar
quietmint
Posts: 265
Joined: 31 July 2017, 00:28

Re: Upgrade to PHP 8

Post by quietmint »

There's now a dedicated wiki page about this:
https://en.doc.boardgamearena.com/PHP_8_upgrade
User avatar
thoun
Posts: 1190
Joined: 10 December 2020, 22:25

Re: Upgrade to PHP 8

Post by thoun »

quietmint wrote: 23 December 2023, 19:15 As I mentioned in January 2021, a very common issue I foresee is related to static vs non-static method calls.

https://www.php.net/manual/en/language.oop5.static.php
Warning
Calling non-static methods statically throws an Error.

Prior to PHP 8.0.0, calling non-static methods statically were deprecated, and generated an E_DEPRECATED warning.
The Studio docs have never taken care on this point and are littered with incorrect usage. Since the documentation isn't consistent, you can bet that game code isn't consistent either. :lol: Same page https://en.doc.boardgamearena.com/Main_ ... e.game.php has both non-static (correct) and static (incorrect) examples for the same function:

Code: Select all

$players = $this->loadPlayersBasicInfos(); // okay
$players = self::loadPlayersBasicInfos(); // error
I updated the docs to remove all bad calls I found. And same for the new project base code. It should be cleaner now :) Don't hesitate to fix the doc or report if you see I missed some.
Post Reply

Return to “Developers”