Page 1 of 2

PHP

Posted: Thu Feb 02, 2023 7:08 pm
by JonT
As I have pointed out previously, the vast majority of the website including the forums and meterboard are all written in a programming language called PHP. We are running version 7 of PHP. The latest version is 8.2. The jump from 7.x to 8.x involved some major changes which means that the majority of our site does not work on the new version.

Support for PHP 7 has now been withdrawn and so it is only a matter of time before we have to make the move - I am sure at some point the web hosting service we use will withdraw 7.x from the versions of PHP that support. They are already emailing customers asking them to upgrade.

I am willing to give the upgrade a go, but it will be quite involved and no doubt take me into parts of our site that have not been touched for many years. It may well be that is beyond me at which point we need to think through where we go from here.

I will keep you all posted.

Jon


Sent from my iPhone using Tapatalk

Re: PHP

Posted: Fri Feb 03, 2023 9:49 am
by plummy
Yikes - sounds complicated but I have faith that you'll manage to steer us through yet another technological maze. Good luck and thank you for your continued efforts.

Re: PHP

Posted: Sat Feb 04, 2023 5:49 pm
by fkoene
Same from me, Jon: good luck.

Verstuurd vanaf mijn FP3 met Tapatalk


Re: PHP

Posted: Mon Feb 06, 2023 5:26 pm
by commodoreann
Jon,

I agree with Plummy and thank you for all you do to keep us afloat.

Ann :fsbgrin:

PHP

Posted: Tue Feb 21, 2023 6:39 pm
by JonT
For those that are interested, I am making some progress and learning a lot as I go. The good news is that I have upgraded the development server to PHP 8.2 which is the most recent version. I have managed to get all of the tools that I have written since taking over the website from Thomas running properly (I think). So the Nonathlon, Metanonathlon, C2CTC tool and the Challenge Tracker are all working in PHP 8.2 now, albeit only on the development server.

The forums are also all working correctly.

This now means I can't put off turning my attention to the Meterboard and some of the other tools such as the signature generator. Until these are all working we can't switch to PHP 8.2 because some things will work and others will just fall flat on their face. But at least there is some progress.

I may be some time!

Jon

Re: PHP

Posted: Tue Feb 21, 2023 8:25 pm
by fkoene
Thanks again, Jon. Sounds complicated, super how you manage all that.

Verstuurd vanaf mijn FP3 met Tapatalk


Re: PHP

Posted: Wed Feb 22, 2023 8:18 pm
by JonT
As predicted, the Meterboard is proving to be very difficult. I had my first real go at this today and didn't manage to get any of the Meterboard to run at all. What is apparent is that the error checking in PHP 8.2 is far more thorough than in earlier versions and so bugs that the Meterboard was just ignoring (e.g. search one of the databases for a rower with no name whatsoever) is now being picked up and crashes the system completely. The challenge is that the code for the Meterboard is a few thousand lines and finding the part that is generating nonsense database queries is really very tricky, especially for someone who didn't actually write any of this code in the first place. I will press on again when I have some more free time, but I wouldn't bet my mortgage on getting this working.

The added complication, which is actually the part that is worrying me the most, is that some of the Meterboard code runs automatically on the server in the background (e.g. the code that periodically goes to C2 and updates the meters rowed by everyone). Because this is running of its own accord it is impossible to observe what it is doing and if there are any errors occurring. Things will just stop updating, but there is no logging on the system to tell you what went wrong. Quite how I will sort that out if it doesn't work is a hard question to answer. #-o

I'm just posting these updates to keep myself sane and to reassure people that I am on the case. :fsbgrin:

Jon

Re: PHP

Posted: Wed Feb 22, 2023 8:51 pm
by Draggon
Jon - I just wanted to add my voice to those expressing thanks for your efforts. This really is a cool place to hang out given our shared interest. Maybe you could just rewrite the Meterboard to be your own baby? I've seen your handiwork in other places; surely you could do it! :D :D

If you can't figure it out (the current meterboard's issues with the PHP upgrade, not rewriting it; that was tongue-in-cheek), I wonder how much it would cost to hire a programmer to write us a new meterboard that would run on the new version of PHP? (NOT implying that YOU should bear that cost, mind you - just brainstorming)

Re: PHP

Posted: Thu Feb 23, 2023 8:23 am
by Ian Bee
Having read this, I have Ultravox playing in my head 😉
Huge thank you Jon for your hard work in keeping the site running.

Re: PHP

Posted: Sat Feb 25, 2023 8:00 pm
by Draggon
Another brainstorm idea - would this be a good senior project for a college student to take on? (at this point, would probably have to wait for next fall semesters to start)

Re: PHP

Posted: Mon Feb 27, 2023 10:35 pm
by JonT
Don’t get your hopes up, this was below pages of error messages, but it is at least progress.

The first time I had any sign of the Meterboard appearing in the development environment running PHP 8.2.

Image


Sent from my iPhone using Tapatalk

Re: PHP

Posted: Mon Mar 06, 2023 9:05 pm
by JonT
Slow progress, but progress anyway.

I am gradually working my way through the Meterboard warnings and error messages. Most of them seem to be linked to out of the ordinary conditions which are not detected properly and were just ignored by earlier versions of PHP. For example, if anyone has rowed less than 7 times so far this season, the Meterboard now falls over whereas the old version just merrily ignored the fact that a whole section of the code only really worked if a full set of at least 7 rows had been completed. Once you work this out it is just a case of writing some code that deals with this situation and doesn't just ignore it. Tedious, but sort of satisfying to see the error count slowly come downwards.

Jon

Re: PHP

Posted: Tue Mar 07, 2023 9:20 am
by plummy
You sir, are a steely-eyed missile man (quote from one of my favourite films re problem solving)

Re: PHP

Posted: Tue Mar 07, 2023 9:39 am
by Ian Bee
Next time I'm in Bath (which is an occupational hazard for me), I shall buy you a pint or other similar compensation for your efforts.

Sent from my CPH2173 using Tapatalk


Re: PHP

Posted: Tue Mar 07, 2023 9:40 am
by Ian Bee
plummy wrote:You sir, are a steely-eyed missile man (quote from one of my favourite films re problem solving)
Does that make Jon the stapler or the pen?

Sent from my CPH2173 using Tapatalk


Re: PHP

Posted: Tue Mar 07, 2023 9:53 am
by JonT
I have no idea what you two are going on about. I’ll just sit here in my geek cave and press on :)


Sent from my iPhone using Tapatalk

Re: PHP

Posted: Tue Mar 07, 2023 12:04 pm
by plummy
Ian Bee wrote: ↑Tue Mar 07, 2023 9:40 am
plummy wrote:You sir, are a steely-eyed missile man (quote from one of my favourite films re problem solving)
Does that make Jon the stapler or the pen?

Sent from my CPH2173 using Tapatalk
Neither - it appears that this quote has been used more than once in films. I was quoting Apollo 13.

Re: PHP

Posted: Tue Mar 07, 2023 12:42 pm
by Ian Bee
Ah - it's also in The Martian.

Re: PHP

Posted: Wed Mar 08, 2023 5:24 pm
by Draggon
Great work, JonT!

Re: PHP

Posted: Wed Mar 08, 2023 9:04 pm
by JonT
A few more hours graft today and a big leap forward, well two actually.

I now have the Meterboard displaying without the 100s of warning messages. This was all fine unless you selected a date different to today's at the top of the board (does anyone actually use this facility I wonder?). This gave a whole new set of errors.

But I am in a bit of a groove with this at the moment and the board now displays for any selected date.

The snag is selecting a rower to view the profile gives me a fatal error. But some progress to report anyway.

Jon

Re: PHP

Posted: Thu Mar 09, 2023 8:31 pm
by JonT
Latest progress - viewing an individual rower and being able to flag that this is your profile using the "this is me" button are both now working.

Next stop is the update code which runs automatically to keep the meterboard up to date. Guess what, the first attempt to run it was a car crash #-o

It must be wine o'clock.

Jon

Re: PHP

Posted: Fri Mar 10, 2023 3:32 pm
by JonT
Progress Update
  • I have fixed the code that updates the meterboard in the background. The main errors were around duplicate names of members (yes we have some). Looking at the code, this had obviously been an issue in the past, and to be honest is more bypassed than fixed.
  • The code to add a new challenge is fixed and working, albeit with a couple of warning messages that I can't get to the bottom of. But this is good enough given only I use this part of the system.
  • I added the International Women's Day challenge to the development site and the challenge was processed with no error messages, which makes a nice change.
I think that brings us pretty close to having the site switched over to PHP 8.2!

I am going to leave the development site ticking over for a few days now to see if anything goes awry.

One thing I am unable to test is new members joining the meterboard. I am confident that joining the forum will work, but will that also link over to the board? I can't test this easily because you need a unique C2 id for everything to work properly.

The PB signature generator is completely broken. I will have a look at that soon(ish).

Once I am convinced that the development site is running OK we face the decision on when to switch the live site over to PHP 8.2. Most of the issues that I have been grappling with have been to do with what are known as "edge cases" i.e. situations which are at the edges of the 'world' processed by the system. A good example is where someone has only rowed a single distance in the year. The code didn't handle this well, but the issue only showed up with PHP 8.2. A lot of these edge conditions will occur at the start of the season, and I always reach May 1st with an element of fear and more than a little hope. So, the dilemma is do we switch now and let things settle in a bit, or do we wait until next season. I think doing it this season is probably better, given by May 2024 I am sure I will have forgotten everything that I have learned and fixed over the last few weeks.

Re: PHP

Posted: Sun Mar 12, 2023 11:27 am
by fkoene
Many many thanks again, Jon.
I agree, I think it is better to switch before May 1st, since you've been working with the code so much now.


Verstuurd vanaf mijn FP3 met Tapatalk


Re: PHP

Posted: Thu Mar 16, 2023 4:15 pm
by JonT
Thanks for the reply Fred. I think you and IU are thinking along the same lines.

Since my last update I have launched the World Erg Challenge on the development site (PHP 8.2) which gave a few issues but was sorted over an evening.

The "turbo" mode on the Meterboard is not working. This is annoying but not critical. I will take a look.

There seems to be a slight gremlin in the Nonathlon analyser which only turns up from time to time and so is tricky to track down. I think we could go live with it as it is.

The signature generator is now working, but I have had to apply a fairly brutal hack to get around some warning messages. Again, nothing that would stop us going live.

So, I just need to find the time and courage to switch over the live site to PHP 8.4. In theory if things fall apart I should just be able to roll-back the changes and we will be OK. But that's a theory I would really like to avoid testing if at all possible.

Jon

Re: PHP

Posted: Fri Mar 17, 2023 3:45 pm
by JonT
I've fixed turbo mode.

I have now moved all of the new code onto the live site but without upgrading PHP to 8.2. So we now have the new version of the code running but on the old version of PHP. This should work fine and gives me the opportunity to make sure I haven't introduced any errors as I have fixed the gremlins. At first site the Meterboard is running and tools like Nonathlon Analyser, Challenge Analyser and C2CTC report are all working OK.

Next step is to upgrade PHP which is the riskiest part.

Jon