ImportCumulusFile: Difference between revisions

1,437 bytes added ,  12:57, 13 March 2013
no edit summary
No edit summary
No edit summary
Line 1: Line 1:
{{AddOnBanner|name=ImportCumulusFile|type=PHP|author=David A Jamieson|contact='DAJ' via the forum|updated=3 December 2012|version=1.4a}}
{{AddOnBanner|name=ImportCumulusFile|type=PHP|author=David A Jamieson|contact='DAJ' via the forum|updated=13 March 2013|version=2.0}}


This is a PHP script designed to run on your webserver and import Cumulus log files into a MySQL database on your server.
This is a PHP script designed to run on your webserver and import Cumulus log files into a MySQL database on your server.
Line 10: Line 10:
*a Cumulus Log already uploaded
*a Cumulus Log already uploaded


=IMPORTANT NOTE FOR VERSION 2.0=
Version 2.0 changes the SQL table structures from version 1.x. If you are currently using version 1.x and wish to upgrade, then you will have to DROP the existing tables and let the version 2 script recreate them. If this is unacceptable DO NOT UPGRADE, stay with version 1.x
The new table formats use a combined date/time field instead of separate, this makes constructing queries much simpler, it is worth making the change.
Of course if you do change, then any existing queries you are using will also have to be rewritten - take this into account. It may be possible to create VIEWs of the new tables that mimic the old table format, and for you to use those views with your existing queries, that is an exercise for you!


=Installation=
=Installation=
*Download the PHP script ... [http://wiki.sandaysoft.com/files/ImportCumulusFile_v1-4a.txt (right click, Save as)]
*Download the PHP script ... [http://wiki.sandaysoft.com/files/ImportCumulusFile_v2-0.txt (right click, Save as)]
*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 64: Line 70:


= Version Control =
= Version Control =
 
*2.0 - 13 March 2013, Mark Crossley [[http://wiki.sandaysoft.com/files/ImportCumulusFile_v2-0.txt Download]]
**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 checking to allow running of the script from a command line as well as via http
**Added 'extra' columns to record wind directions as compass points where they are only provided as bearings:
Dayfile:  Added the following columns:- HWindGBearSym, DomWindDirSym
Monthly:  Added the following columns:- WindbearingSym, CurrWindBearingSym
*1.4a - 3 December 2012, Mark Crossley. Fixes syntax errors in 1.4, adds parameter presence checking. [[http://wiki.sandaysoft.com/files/ImportCumulusFile_v1-4a.txt Download]]
*1.4a - 3 December 2012, Mark Crossley. Fixes syntax errors in 1.4, adds parameter presence checking. [[http://wiki.sandaysoft.com/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.