ImportCumulusFile: Difference between revisions

128 bytes removed ,  19:42, 21 April 2020
m
Text replacement - "cumuluswiki.wxforum.net" to "cumuluswiki.org"
m (Text replacement - "http://wiki.sandaysoft.com/" to "https://cumuluswiki.wxforum.net/")
m (Text replacement - "cumuluswiki.wxforum.net" to "cumuluswiki.org")
Line 20: Line 20:


=Installation=
=Installation=
*Download the PHP script ... [https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v3-2.txt (right click, Save as)] and then rename the .txt to .php
*Download the PHP script ... [https://cumuluswiki.org/files/ImportCumulusFile_v3-2.txt (right click, Save as)] and then rename the .txt to .php
*Save the file and edit it using a text editor --  there are five entries to be edited
*Save the file and edit it using a text editor --  there are five entries to be edited
:servername, username, password, database and security key
:servername, username, password, database and security key
Line 75: Line 75:


= Version Control =
= Version Control =
*3.2 - 11 September 2018 [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v3-2.txt Download]]
*3.2 - 11 September 2018 [[https://cumuluswiki.org/files/ImportCumulusFile_v3-2.txt Download]]
**Fixed inserting of WindbearingSym and CurrWindBearingSym
**Fixed inserting of WindbearingSym and CurrWindBearingSym
*3.1 - 1 March 2018 [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v3-1.txt Download]]
*3.1 - 1 March 2018 [[https://cumuluswiki.org/files/ImportCumulusFile_v3-1.txt Download]]
**Fix variable typos in realtime table creation status messages
**Fix variable typos in realtime table creation status messages
**Remove some HTTP headers that were causing problems on some servers
**Remove some HTTP headers that were causing problems on some servers
*3.0 - 6 November 2016 [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v3-0.txt Download]]
*3.0 - 6 November 2016 [[https://cumuluswiki.org/files/ImportCumulusFile_v3-0.txt Download]]
**Converted to use prepared statements - more efficient for bulk inserts (the main use for script with CumulusMX?)
**Converted to use prepared statements - more efficient for bulk inserts (the main use for script with CumulusMX?)
**SQL injection protection improved - requires the table names to be defined in this script
**SQL injection protection improved - requires the table names to be defined in this script
*2.8 - 27 April 2015 [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-8.txt Download]]
*2.8 - 27 April 2015 [[https://cumuluswiki.org/files/ImportCumulusFile_v2-8.txt Download]]
**Added addtional configuration parameter $rainUnit, default is 'mm'
**Added addtional configuration parameter $rainUnit, default is 'mm'
**Added 'rain since midnight' to the monthly log file table
**Added 'rain since midnight' to the monthly log file table
Line 90: Line 90:
**To updated existing monthly tables use the following SQL command [if you use 'mm' for rain change (4,2) to (4,1)]:
**To updated existing monthly tables use the following SQL command [if you use 'mm' for rain change (4,2) to (4,1)]:
***ALTER TABLE <<YOUR_MONTHLY_TABLENAME>> ADD COLUMN RainSinceMidnight DECIMAL(4,2) NULL AFTER RG11rain;
***ALTER TABLE <<YOUR_MONTHLY_TABLENAME>> ADD COLUMN RainSinceMidnight DECIMAL(4,2) NULL AFTER RG11rain;
*2.7 - 23 February 2015 [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-7.txt Download]]
*2.7 - 23 February 2015 [[https://cumuluswiki.org/files/ImportCumulusFile_v2-7.txt Download]]
**Fixed realtime/monthly/day tables creates, to make rainfall 2dp to allow for inches
**Fixed realtime/monthly/day tables creates, to make rainfall 2dp to allow for inches
**Fixed monthly table create, to make evapotrans 2 dp
**Fixed monthly table create, to make evapotrans 2 dp
**Converted from depreciated mysql to mysqli
**Converted from depreciated mysql to mysqli
*2.6 - 02 April 2014, Mark Crossley [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-6.txt Download]]
*2.6 - 02 April 2014, Mark Crossley [[https://cumuluswiki.org/files/ImportCumulusFile_v2-6.txt Download]]
**Fixed a PHP vulnerability that could reveal your passcode
**Fixed a PHP vulnerability that could reveal your passcode
*2.5 - 03 December 2013 (uploaded 02 Feb 2014), Mark Crossley [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-5.txt Download]]
*2.5 - 03 December 2013 (uploaded 02 Feb 2014), Mark Crossley [[https://cumuluswiki.org/files/ImportCumulusFile_v2-5.txt Download]]
**Changed day file HighSolarRad from varchar(5) to decimal(5,1)
**Changed day file HighSolarRad from varchar(5) to decimal(5,1)
***To alter an existing table...
***To alter an existing table...
***ALTER TABLE `dayfile` CHANGE `HighSolarRad` `HighSolarRad` DECIMAL(5,1) NULL DEFAULT NULL
***ALTER TABLE `dayfile` CHANGE `HighSolarRad` `HighSolarRad` DECIMAL(5,1) NULL DEFAULT NULL
*2.4 - 23 October 2013, Mark crossley [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-4.txt Download]]
*2.4 - 23 October 2013, Mark crossley [[https://cumuluswiki.org/files/ImportCumulusFile_v2-4.txt Download]]
**Changed day file humidity fields from varchar(3) to decimal(4,1)
**Changed day file humidity fields from varchar(3) to decimal(4,1)
*2.3 - 05 June 2013, Mark Crossley [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-3.txt Download]]
*2.3 - 05 June 2013, Mark Crossley [[https://cumuluswiki.org/files/ImportCumulusFile_v2-3.txt Download]]
**Fixed dayfile & monthfile table column HoursSun was decimal(2,1) to decimal(3,1)
**Fixed dayfile & monthfile table column HoursSun was decimal(2,1) to decimal(3,1)
*2.2 - 21 April 2013, Mark Crossley
*2.2 - 21 April 2013, Mark Crossley
**Made dayfile UV a decimal(3,1) field rather than varchar(4)
**Made dayfile UV a decimal(3,1) field rather than varchar(4)
*2.1 - 29 March 2013, Mark Crossley [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-1.txt Download]]
*2.1 - 29 March 2013, Mark Crossley [[https://cumuluswiki.org/files/ImportCumulusFile_v2-1.txt Download]]
**Fixed typo in day file table field name LowDewPint -> LowDewPoint
**Fixed typo in day file table field name LowDewPint -> LowDewPoint
*2.0 - 13 March 2013, Mark Crossley [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v2-0.txt Download]]
*2.0 - 13 March 2013, Mark Crossley [[https://cumuluswiki.org/files/ImportCumulusFile_v2-0.txt Download]]
**Change monthly and realtime tables to use combined date/time columns rather than separate
**Change monthly and realtime tables to use combined date/time columns rather than separate
**Added optional retention time for realtime table. Records older than the specified age will be deleted. retainVal=NNN retainUnit=XXXX
**Added optional retention time for realtime table. Records older than the specified age will be deleted. retainVal=NNN retainUnit=XXXX
Line 115: Line 115:
  Dayfile:  Added the following columns:- HWindGBearSym, DomWindDirSym
  Dayfile:  Added the following columns:- HWindGBearSym, DomWindDirSym
  Monthly:  Added the following columns:- WindbearingSym, CurrWindBearingSym
  Monthly:  Added the following columns:- WindbearingSym, CurrWindBearingSym
*1.4a - 3 December 2012, Mark Crossley. Fixes syntax errors in 1.4, adds parameter presence checking. [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v1-4a.txt Download]]
*1.4a - 3 December 2012, Mark Crossley. Fixes syntax errors in 1.4, adds parameter presence checking. [[https://cumuluswiki.org/files/ImportCumulusFile_v1-4a.txt Download]]
*1.4 - 3 December 2012, Mark Crossley. Added ability to create and log data to a 'realtime' table.
*1.4 - 3 December 2012, Mark Crossley. Added ability to create and log data to a 'realtime' table.
*1.3b - 30 Nov 2012, Mark Crossley, changed so ALL missing values from the dayfile are entered into the table as NULL. If you have used the Cumulus editor, then they will be present in the file as blank fields. [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v1-3b.txt Download]]
*1.3b - 30 Nov 2012, Mark Crossley, changed so ALL missing values from the dayfile are entered into the table as NULL. If you have used the Cumulus editor, then they will be present in the file as blank fields. [[https://cumuluswiki.org/files/ImportCumulusFile_v1-3b.txt Download]]
*1.3a - 30 Nov 2012, Mark Crossley, added line breaks to output text [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v1-3a.txt Download]]
*1.3a - 30 Nov 2012, Mark Crossley, added line breaks to output text [[https://cumuluswiki.org/files/ImportCumulusFile_v1-3a.txt Download]]
*1.3 - 27 Nov 2012, Mark Crossley, updated for Cumulus b1050 [[https://cumuluswiki.wxforum.net/files/ImportCumulusFile_v1-3.txt Download]]
*1.3 - 27 Nov 2012, Mark Crossley, updated for Cumulus b1050 [[https://cumuluswiki.org/files/ImportCumulusFile_v1-3.txt Download]]
*1.2 - 6 May 2011, Mark Crossley, updated for Cumulus 1.9.1  
*1.2 - 6 May 2011, Mark Crossley, updated for Cumulus 1.9.1  
*1.1c Small modification to code to handle date delimiter with a dot [[http://wiki.sandsoft.com/files/ImportCumulusFile_v1-1c.txt Download]]
*1.1c Small modification to code to handle date delimiter with a dot [[http://wiki.sandsoft.com/files/ImportCumulusFile_v1-1c.txt Download]]