Welcome to the Cumulus Support forum.

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Cumulus MX V4 beta test release 4.0.0 (build 4018) - 28 March 2024

Legacy Cumulus 1 release v1.9.4 (build 1099) - 28 November 2014 (a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

PHP 8.1 fixes for Saratoga templates...

Discussion of Ken True's web site templates

Moderator: saratogaWX

Post Reply
User avatar
saratogaWX
Posts: 1170
Joined: Wed 06 May 2009 5:02 am
Weather Station: Davis Vantage Pro Plus
Operating System: Windows 10 Professional
Location: Saratoga, CA, USA
Contact:

PHP 8.1 fixes for Saratoga templates...

Post by saratogaWX »

I'd just gotten to install PHP8.1 and found some new Deprecated errata in the Base template set.

Mainly, the default casting of a float to an integer now gives a Deprecated message so things like

Code: Select all

$dir = $windlabel[ fmod((($winddir + 11) / 22.5),16) ];
had to change to

Code: Select all

$dir = $windlabel[ (integer)fmod((($winddir + 11) / 22.5),16) ];
to quiet the messages.

Also, the

Code: Select all

$minutes = intval(($sec / 60) % 60);
was changed to

Code: Select all

$minutes = intval(fmod($sec / 60, 60));
In the GD library, the imagepolygon() and imagefilledpolygon() went from 4 arguments to 3 (losing the $num_args entry).

So.. I've been working on the Base-USA, CU-plugin site and will work on the Canada and World sites shortly.
I've updated the distributions with the following fixes:

Version 3.347 - 18-Jan-2022 (Base-*) PHP 8.1 updates to fix Deprecated errata: get-USNO-sunmoon.php V3.04, include-wxstatus.php V1.13, thermometer.php V1.18;
(Base-USA) advforecast2.php V5.18, NWS-regional-radar-animate.php V1.04, radar-status.php V1.18;
(CU-Plugin) PHP8.1 updates to fix Deprecated errata and add new CumulusMX data variables: CU-defs.php V1.12

Use the update tool with your Base and Plugin for 18-Jan-2022

I've attached a text file showing the main diffs of old/new files.

p.s. -- PHP 8.1 also announced the Deprecation of strftime()/strptime() built-in's ..the mesonet-map, global-map use that (and likely others too).
You do not have the required permissions to view the files attached to this post.
User avatar
ConligWX
Posts: 1571
Joined: Mon 19 May 2014 10:45 pm
Weather Station: Davis vPro2+ w/DFARS + AirLink
Operating System: Ubuntu 22.04 LTS
Location: Bangor, NI
Contact:

Re: PHP 8.1 fixes for Saratoga templates...

Post by ConligWX »

Thanks for this Ken,

Am thinking of moving to PHP 8.x very soon.
mcrossley wrote:
- are the default CumulusMX Templates php 8.x compatible?
Regards Simon

https://www.conligwx.org - @conligwx
Davis Vantage Pro2 Plus with Daytime FARS • WeatherLink Live • Davis AirLink • PurpleAir •

Image
Post Reply