ImportCumulusFile: Difference between revisions

405 bytes added ,  11:35, 4 February 2010
m
version 1.1 -- added delimter option
m (version 1.1 -- added delimter option)
Line 1: Line 1:
{{AddOnBanner|name=ImportCumulusFile|type=PHP|author=David A Jamieson|contact='DAJ' via the forum|updated=3 Feb 2010|version=1.0}}
{{AddOnBanner|name=ImportCumulusFile|type=PHP|author=David A Jamieson|contact='DAJ' via the forum|updated=4 Feb 2010|version=1.1}}


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 15: Line 15:
:servername, username, password, database and security key
:servername, username, password, database and security key
:these are documented in the file at the top.
:these are documented in the file at the top.
:There is a sixth entry which may require editing.  Look at the text file you are importing.  How is each field separated/delimited?  In the UK this is a comma so there is nothing else needs changed.  If for example your delimiter is a semi-colon then change the line $delimiter accordingly
*save the file as ImportCumulusFile.<b>php</b> or whatever name you prefer and upload it to your webserver.
*save the file as ImportCumulusFile.<b>php</b> or whatever name you prefer and upload it to your webserver.


Line 57: Line 58:


Using the above script, in combination with the [[Toolbox]] you could set an automated FTP rule to upload the dayfile.txt from Cumulus each day at 00:15 and then run an HTTP remote command (this script) to import it into the SQL database
Using the above script, in combination with the [[Toolbox]] you could set an automated FTP rule to upload the dayfile.txt from Cumulus each day at 00:15 and then run an HTTP remote command (this script) to import it into the SQL database
=Version Control=
*1.1 Added the facility to identify the delimiter used on the import file
*1.0 First Release




[[Category:WebTools]]
[[Category:WebTools]]
1,120

edits