Author Topic: Cloud-base.php, version 2.5, has warnings and deprecated stuff  (Read 159 times)

0 Members and 1 Guest are viewing this topic.

Offline Bunty

  • Forecaster
  • *****
  • Posts: 2441
  • Stillwater, home of Oklahoma State University
    • Welcome to Stillwater Weather
cloud-base.php, version 2.5, has several warnings and deprecated stuff. Used with PHP 8.3:

Warning:  Undefined array key 0 on line 614
[07-May-2024 12:29:24 America/Chicago] PHP Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated on line 614
[07-May-2024 12:29:24 America/Chicago] PHP Warning:  Undefined array key 556 on line 615
[07-May-2024 12:29:24 America/Chicago] PHP Warning:  Undefined array key 557 on line 616
[07-May-2024 12:29:24 America/Chicago] PHP Warning:  Undefined array key 558 on line 617
[07-May-2024 12:29:24 America/Chicago] PHP Warning:  Undefined array key 559 on line 618
[07-May-2024 12:29:24 America/Chicago] PHP Deprecated:  strtotime(): Passing null to parameter #1 ($datetime) of type string on line 706
[07-May-2024 12:29:24 America/Chicago] PHP Deprecated:  strtotime(): Passing null to parameter #1 ($datetime) of type string is deprecated on line 707

Also the 2nd home page using modified AltDashboard 6.95 at http://stillwaterweather.com/2ndhome.php

Offline saratogaWX

  • Administrator
  • Forecaster
  • *****
  • Posts: 9332
  • Saratoga, CA, USA Weather - free PHP scripts
    • Saratoga-Weather.org
Re: Cloud-base.php, version 2.5, has warnings and deprecated stuff
« Reply #1 on: May 08, 2024, 09:04:03 AM »
I don't think it's a PHP 8.3 issue, but instead, a clientrawextra.txt file that is empty at the time the script is run.  Probably because WD is not set to have 'upload temporary file and rename' in the FTP settings.

The lines in question
Quote
   $data      = explode(" ",$file[0]);
   $sunrise   = $data[556];
   $sunset    = $data[557];
   $moonrise  = $data[558];
   $moonset   = $data[559];
all depend on having data (clientrawextra.txt) to explode() with spaces.
Using the clientraw parser on my site shows you do have data there
Quote
556   Sunrise   Time   6:27am
557   Sunset   Time   8:21pm
558   Moonrise   Time   6:31am
559   Moonset   Time   8:10pm
so I suspect it was a transient issue.  Fix it by changing the way WD uploads the realtime files to use "upload as temporary and rename' option.
Ken True/Saratoga, CA, USA main site: saratoga-weather.org
Davis VP1+ FARS, Blitzortung RED, GRLevel3, WD, WL, VWS, Cumulus, Meteobridge
Free weather PHP scripts/website templates - update notifications on Twitter saratogaWXPHP

 

anything