Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8.x Support? #11151

Closed
qcybb opened this issue Jan 22, 2022 · 22 comments
Closed

PHP 8.x Support? #11151

qcybb opened this issue Jan 22, 2022 · 22 comments

Comments

@qcybb
Copy link

qcybb commented Jan 22, 2022

The Vanilla forums does not work in PHP 8. Any plans or ETA when support will be added?

PHP 7.4 end of life was over a month ago.

@charrondev
Copy link
Contributor

charrondev commented Jan 24, 2022

The dev team really wants to get to PHP 8 as soon as possible. We've been gradually fixing things.

The main problems are:

  • a ton of PHP based views that are performing potentially undefined property accesses (which is now an error but was previously a warning).
  • We're currently updating our dependency injection library to support the changes in the reflection API to support union types. https://github.com/vanilla/garden-hydrate

Our minimum version will be jumping to PHP 7.4 in the next month or 2, with a jump to 8 in November.

FWIW PHP 7.4 is not EoL until November https://www.php.net/supported-versions.php. Security patches continue until then.

@qcybb
Copy link
Author

qcybb commented Jan 24, 2022

Ok, thank you. I look forward to the update when it comes out.

@charrondev charrondev pinned this issue Feb 8, 2022
@juliecampbell
Copy link

Are there any updates to when PHP 8 support will be available? The minimum is still at 7.2, though we have patched ours to work with 7.4.

@charrondev
Copy link
Contributor

The latest releases definitely work with PHP 7.4 (Our production runs 7.4). We're working on 8 at the moment.

@JohanRonstrom
Copy link

Since 7.4 no longer has active support and has official end-of-life in 2 months, our host will force upgrade all our servers within a few weeks! 😱😱😱

Unless there is an update this week, we will have to abandon Vanilla forums as our company support forums, and go to Discord or something 😭😭😭

@Github-Newbie5432
Copy link

@charrondev , Has there been an update in regards to PHP 8 support following on from your post on September 8th? We're now 4 weeks away from PHP 7.4's end-of-life , I am the Administrator of a very large forum and was hoping to migrate over to Vanilla (I have been testing it locally and really like it!) however the lack of PHP 8 support is preventing me from proceeding with a migration.

@XCame
Copy link

XCame commented Nov 14, 2022

Bump.
Only 13 days left. @charrondev
As staying on 7.4 would be irresponsible for HL itself as well as the community users: Is there any update you can give us?

@Github-Newbie5432
Copy link

Bump. Only 13 days left. @charrondev As staying on 7.4 would be irresponsible for HL itself as well as the community users: Is there any update you can give us?

It (PHP 8) is definitely being worked on , there's been commits / comments / posts floating around Github - I'd expect a new release with the PHP 8 support incoming within the next fortnight!

@JohanRonstrom
Copy link

Because of this we have since yesterday sadly given up on Vanilla Forums and moved all activity to Discord. I would suggest anyone with a managed server host to consider alternatives, since most if not all major hosts will automatically upgrade, and naturally will not allow customers to keep using deprecated PHP versions.

Unless you have your own server machine, your forums will stop working in less than two weeks.

@XCame
Copy link

XCame commented Nov 15, 2022

@Github-Newbie5432 can you post any links to your findings?
I skipped through various branches and even forks to find a hint for an updates composer.json or anything alike.
The only other reference outside of GitHub, I found, is a release note from 2020 where PHP 8.0 string functions are mentioned.

@juliecampbell
Copy link

I don't doubt that PHP 8.0 is being worked on. However, I do not think PHP 8.0 for open source is the highest priority.

This is just my suspicion, as I do not have any insights into Higher Logic's inner workings, and all of the recent commit messages consist of "syncing cloud/master into master".

@XCame
Copy link

XCame commented Nov 15, 2022

FYI: It's fairly easy to get it working with PHP8.2

Well... at least as tested in an turnkey linux machine running Vanilla 2021.009
Basically ist just a matter of enclosing the second argument of all call_user_func_array calls in array_values (mainly in vendor/vanilla/garden-container/src/Container.php (also the 2nd parameter of invokeArgs) and library/Vanilla/Cache/CacheCacheAdapter.php)

Reason being PHP8 introduced named arguments. Before the $args parameter of call_user_func_array ignored keys in $args, now they are "read" as named arguments. Doing something like call_user_func_array($callback, array_values($args)) removes the keys and keeps the order

Haven't tested it thoroughly, yet but couldn't find any issues so far.

@juliecampbell
Copy link

Running 2022.010 and updating to PHP 8.0 we ran into Composer package dependency issues before ever looking at a single line of code. We've also patched our Vanilla to work with Composer 2 versus 1, since Composer 1 support is slowly being phased out.

@Github-Newbie5432
Copy link

@Github-Newbie5432 can you post any links to your findings? I skipped through various branches and even forks to find a hint for an updates composer.json or anything alike. The only other reference outside of GitHub, I found, is a release note from 2020 where PHP 8.0 string functions are mentioned.

Yeah you just need to look at the Garden-Container repository , there's branches that refer to current issue numbers and you can see new commits where the deprecated stuff (named parameters) is replaced :-

https://github.com/vanilla/garden-container/tree/add/php-8

https://github.com/vanilla/garden-container/tree/feature/VNLA-2727-make-home-page-render-with-php8

https://github.com/vanilla/garden-container/tree/feature/VNLA-2728-garden-container-support-for-php8-and-unionTypes

@Github-Newbie5432
Copy link

FYI: It's fairly easy to get it working with PHP8.2

Well... at least as tested in an turnkey linux machine running Vanilla 2021.009 Basically ist just a matter of enclosing the second argument of all call_user_func_array calls in array_values (mainly in vendor/vanilla/garden-container/src/Container.php (also the 2nd parameter of invokeArgs) and library/Vanilla/Cache/CacheCacheAdapter.php)

Reason being PHP8 introduced named arguments. Before the $args parameter of call_user_func_array ignored keys in $args, now they are "read" as named arguments. Doing something like call_user_func_array($callback, array_values($args)) removes the keys and keeps the order

Haven't tested it thoroughly, yet but couldn't find any issues so far.

@XCame you pointed in me in the correct direction - I have got 2021.009 running under PHP 8.1.12! :D

@codernix
Copy link

If there is a list of issues that need to be fixed, I can help easily.
I finished porting a bunch of Sage 9 stuff, WordPress, Premium Plugins, and custom PHP code from 7.4 to 8.1, so I'm well aware of the differences and the fixes.

I had a 5 year old Vanilla Forum, and just remembered it and wanted to see what's happening, then I landed here and I see a lot has happened, and I've checked the alt aka Flarum and didn't like it, so I will get on Vanilla again, and see if I get any issues that need to be fixed, but if we have a list of all related issues to 8.0/.1, it could help a lot.

@Github-Newbie5432
Copy link

Hi Everyone,

I built 2023.001 this morning from source and this seems to be fixed in this release. Have uploaded the release here if you'd like to download (it works out-of-the-box on PHP 8.1.12 + PHP 8.2.1 without any workarounds!)

https://open.vanillaforums.com/discussion/39237/vanilla-2023-001-open-source-release-php-8-works-built-from-source

@charrondev
Copy link
Contributor

Yes, PHP 8.0 is now supported as of the first 2023.001 release. We've got some warnings to fix with PHP 8.1 and 8.2 but it should run. At the moment our test suites are only passing without warnings on 7.4 and 8.0 though.

@juliecampbell
Copy link

Is this still using Composer 1, or has it been updated to Composer 2?

@charrondev
Copy link
Contributor

Everything has been composer 2 compatible for a while now (since maybe 2022.018 or somewhere around there).

@juliecampbell
Copy link

@charrondev Thanks for the information! Glad to see that these updates have been made!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@codernix @charrondev @JohanRonstrom @XCame @juliecampbell @qcybb @Github-Newbie5432 and others