Page 1 of 1
PHP 8 Array constructs
Posted: Fri Jan 01, 2021 4:37 pm
by apmuthu
In
@kev1n's recent
commit, was it necessary to now migrate all
Array() constructs to
[] constructs?
Such sudden syntax changes should be done in a single commit when a version changes but only after all current stable deployment users have had sufficient time to evaluate their PHP versions and their readiness to change thereafter. Even though such new syntax has been with us for quite a while.
If such commits are there, then merging with the current stable branch will become a nightmare.
Re: PHP 8 Array constructs
Posted: Fri Jan 01, 2021 5:50 pm
by kev1n
apmuthu wrote:In
@kev1n's recent
commit, was it necessary to now migrate all
Array() constructs to
[] constructs?
Short array syntax was already used almost 2 years ago. E.g. see in
https://github.com/steven-copley/nubuil ... logins.php, this is not a sudden change.
One of the most important reasons to update PHP is to ensure you are running on a version that is fully supported and patched regularly for security vulnerabilities. PHP 5.4 has not been patched since 2015.
Re: PHP 8 Array constructs
Posted: Sat Jan 02, 2021 10:41 am
by apmuthu
2 years is a very short period indeed in the over 20 years of PHP's existence and in quite some years since nuBuilder gained users. Please go slow on this score as it is likely to break many installs and lose users. My 2c.
At the very least list the files and their lines in a separate file with possibility of alternate constructs to avoid too many "help" posts.
Re: PHP 8 Array constructs
Posted: Sat Jan 02, 2021 11:35 am
by kev1n
apmuthu wrote:2 years is a very short period indeed in the over 20 years of PHP's existence and in quite some years since nuBuilder gained users. Please go slow on this score as it is likely to break many installs and lose users. My 2c.
My point is that the short array syntax is
already used in the current stable version. And only users who are on version 4 can migrate to the new (currently dev) version. For older versions, there is no migration path to nuBuilder Forte.
That also means, that the current version is only compatible with PHP 5.4 onwards.
That's why it's not going no be an issue. If you want compatiblity with PHP < 5.4, you will have to use nuBuilder v.3 or make v.4 compatible with it.
Re: PHP 8 Array constructs
Posted: Sat Jan 02, 2021 11:54 am
by Janusz
What I can see the "=[]" is already introduced to nuBuilder Forte more then one year ago and no one was reported any issue for that.
So every one having application build in V4 will have no issue.
I was testing my old DB created on the V4 version in Dec 2018 and is working fine on latest development version.
Of course styling is different and it's the only issue I can see and would need to work on if I would like to use latest release - but it's normal.
Re: PHP 8 Array constructs
Posted: Sat Jan 02, 2021 1:41 pm
by apmuthu
@Janusz: Thanks for the info. I had assumed that early v4 users may be stuck and as it was just a year ago, that should be fine then.
Will try to make a list of files and lines that may need changing for backward compatibility although it may be a tad difficult to maintain even if only for v4 before v4.5 dev becomes master.
Re: PHP 8 Array constructs
Posted: Sat Jan 02, 2021 3:27 pm
by Janusz
To test more I used the original nuBuilder Forte version dated Jan 19 2019.
After unpack tried to run that installation under php 8.0 - and it was not possible even to log in (and it's normal as it was not developed at that time for php 8.0)
Next I used the original sql file
434900 Jan 19 2019 nubuilder4.sql
with latest development version from kev1n and was able to start without any issue and with no errors on system level or in console.
So if someone would like to convert older nuBuilder Forte DB's to latest version - it should not be difficult.
The biggest work would be with css - as initial Forte version was much different comparing the the current official release.