dudonsky / bycResults

Race results program for the Berkeley Yacht Club Friday Night and Sunday Chowder series
GNU Lesser General Public License v3.0
0 stars 1 forks source link

yii setup, PHP 8.1, and missing php files #8

Open cfthompson opened 6 days ago

cfthompson commented 6 days ago

Hi Bob! How's Europe?

I've been messing around trying to get this thing to work with PHP 8.1 in a docker container. Most of the PHP 8.1 errors seem to be resolved by updating to Yii 1.1.29 (though there are a couple of lines where strftime(), which is deprecated, needs to be replaced by date()). I've managed to mostly get it to work w/ PHP 8.1 and Yii 1.1.29, but the treeview expansion on the main site page isn't working, and after adding some debugging statements to the controller code, it looks like the $data array is only ever getting populated with the first series data in the list. I've found that's true even in PHP 7.4 when I try to set up Yii myself (using "yiic webapp /var/www/html" and then copying the source code files into place.) I suspect there was a major breaking change between Yii versions somewhere. However, in comparing what's different between what we have running on Bluehost and what's in my docker container filesystem, I've noticed that the following PHP files are present in protected/views/ on Bluehost, but absent in my docker container:

root@b96fb87a1dd9:/var/www/html/protected/views# find . -maxdepth 1 -type f ./series.php ./roster.php ./races.inc.php ./raceform.inc.php ./entrylist.inc.php ./entries.php ./entryform.inc.php ./cheatsheet.inc.php ./login.php ./cheatsheet.php ./race.php ./boat.php ./logout.php ./index.php ./byc_site_logo.jpg root@b96fb87a1dd9:/var/www/html/protected/views#

I realize this is ancient history, but do you happen to remember where those files came from? Were they just never checked into git, or are they supposed to be generated somehow by some setup script that I haven't run?

dudonsky commented 6 days ago

Hi Colin! It's nice to hear from you. Europe is ... interesting: it definitely has lots of plusses but also some minuses. We're using our time here to visit as much of the old continent as possible but we think we’ll return to the US at some point.

I was completely stumped by your question - as you say it’s been a long time - until I browsed the git commit history. I took a screenshot to show what’s going on:

So it looks to me like I intentionally deleted those files, I guess because they were replaced as part of the migration to yii 1.1. I couldn’t tell you why the version wasn’t updated on bluehost though, nor whether you should revert to an earlier revision. It’s hard to believe I made all those changes without testing them but, well, who knows…..

Anyway, I hope this helps you move towards a solution.

Cheers, Bob

On Oct 13, 2024, at 01:16, Colin Thompson @.***> wrote:

Hi Bob! How's Europe?

I've been messing around trying to get this thing to work with PHP 8.1 in a docker container. Most of the PHP 8.1 errors seem to be resolved by updating to Yii 1.1.29 (though there are a couple of lines where strftime(), which is deprecated, needs to be replaced by date()). I've managed to mostly get it to work w/ PHP 8.1 and Yii 1.1.29, but the treeview expansion on the main site page isn't working, and after adding some debugging statements to the controller code, it looks like the $data array is only ever getting populated with the first series data in the list. I've found that's true even in PHP 7.4 when I try to set up Yii myself (using "yiic webapp /var/www/html" and then copying the source code files into place.) I suspect there was a major breaking change between Yii versions somewhere. However, in comparing what's different between what we have running on Bluehost and what's in my docker container filesystem, I've noticed that the following PHP files are present in protected/views/ on Bluehost, but absent in my docker container:

@.:/var/www/html/protected/views# find . -maxdepth 1 -type f ./series.php ./roster.php ./races.inc.php ./raceform.inc.php ./entrylist.inc.php ./entries.php ./entryform.inc.php ./cheatsheet.inc.php ./login.php ./cheatsheet.php ./race.php ./boat.php ./logout.php ./index.php ./byc_site_logo.jpg @.:/var/www/html/protected/views#

I realize this is ancient history, but do you happen to remember where those files came from? Were they just never checked into git, or are they supposed to be generated somehow by some setup script that I haven't run?

— Reply to this email directly, view it on GitHub https://github.com/dudonsky/bycResults/issues/8, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKNSK454Q6ISXTFTX4DPITZ3GUV7AVCNFSM6AAAAABP22QQOGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGU4DGNBZGM4TSNQ. You are receiving this because you are subscribed to this thread.

dudonsky commented 6 days ago

Adding screenshot to github comment stream:

image
cfthompson commented 6 days ago

Makes sense. Those files are clearly still used on the verison running on bluehost because I can get the logo to actually work if I modify them, but it puzzled me that it still mostly worked in my docker container without them. I thought I looked at the git history, but I guess not.

I've done a little more experimentation and it looks like these treeview expansions work under Yii 1.1.20, but not 1.1.25. I'm gonna try to narrow it down even further to the specific version where it breaks and see what the differences are. Since I have it working as a container, we may just decide to stick with the old PHP 7 code for the next couple of years. Yii 1.1.29 is the final version and will be EOL in 2026 anyway, and Yii 2 apparently requires a complete code rewrite. Our incoming commodore wants to get off of Bluehost, and we're thinking we'll run this in Digital Ocean's App Platform. I've set up a database initialization script that pulls the latest mysqldump from github, and an hourly cron job that dumps it and pushes it to github, so the database will (usually) survive the container lifecycle without the need for an external database. Gives me something to do during the 2.8 hours of the 3-hour football games when no football is actually being played.

I actually experimented with doing our results in ChatGPT at one point, and discovered that 3.5 turbo could set up the formulas perfectly, but couldn't do the arithmetic.

cfthompson commented 5 days ago

Narrowed it down a little further. It seems to work under PHP 7.4 and Yii 1.1.23. It does not work under PHP 7.4 and Yii 1.1.24, nor does it work under PHP 8.1 and Yii 1.1.23. There was an update to JQuery in 1.1.24. I'm not a terribly skilled debugger, but I threw some echo statements into the PHP code at one point and it didn't look to me like the PHP was generating a $data array with all of the series in it, which would suggest that jQuery would not be the root cause.

It may interest you to know that BYC has a pretty competitive Olson 25 fleet now. We have 3 that compete in the beercans regularly (O'mar, Shadowfax, and Falkor), plus Falk occasionally comes out in Shark on Bluegrass. Foul Air was competing for a while, but we haven't seen him in a couple of seasons, and we had a boat called "FLABSLAB" (aka "Float Like A Butterfly, Sting Like A Bee") that got destroyed last year in a 3 boat collision with Mojo and Resolute (a J/105).

cfthompson commented 5 days ago

https://www.berkeleyyc.org/post/the-mess