I need a PHP4 script to import various text-format files into several different tables of a MySQL Database. The script will be similar in function to the Easy Populate offered as a contribution to the popular “osCommerce?? Open Source project and its derivatives. These are the requirements for this project:
* The script must be able to import several different text formats, specifically including Fixed-Width, Comma-Sperated and Tab-Seperated. The script should be able to detect and handle either UNIX or Windows line endings in the text files.
* The script should be able to automatically split large files so that they can be processed within the environmental execution time limits. The number of records per file should be a configurable value.
* The script will need to be able to create and/or update records on multiple “cross-linked?? tables within the database.
* The script should be as configurable as possible, specifically including configuration options that will allow us to specify the structure of the files we are processing, map the data to tables and fields within the database, and perform minor formatting, transformation, or conversions on the data at the time of import.
* The script should be able to update records that are present in the MySQL database and insert records that are not present in the MySQL database.
* The script should have two execution modes. One would run the script interactively within a web browser; the other would allow the script to be run from the command prompt or as part of a system cron routine.
## Deliverables
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) Deliverables must be in ready-to-run condition, as follows (depending on the nature of the deliverables):
a) For web sites or other server-side deliverables intended to only ever exist in one place in the Buyer's environment--Deliverables must be installed by the Seller in ready-to-run condition in the Buyer's environment.
b) For all others including desktop software or software the buyer intends to distribute: A software installation package that will install the software in ready-to-run condition on the platform(s) specified in this bid request.
3) All deliverables will be considered "work made for hire" under U.S. Copyright law. Buyer will receive exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement).
## Platform
The script will be used as part of a larger LAMP application. The specific system we are running inlcudes: Linux (RHEL), Apache2, and PHP 4.3.11, though we would appreciate code that is written to run in either PHP4 or PHP5.