csvImporter
simple importer from csv file to mysql database, (*1)
Getting Started
add with composer
make folder with cvs files (one file by database), (*2)
look down at usage example, (*3)
Usage
here is one example for usage in laravel seeder, (*4)
$connection = new PDO('mysql:host=127.0.0.1;dbname=my_db;charset=utf8', 'my_user', 'my_pass', array(
PDO::ATTR_PERSISTENT => true
));
$csvPath = __DIR__."/csv/";
$importer = new csvImporter($connection, $csvPath);
$configs = [
[
'table' => 'table_name',
'fields' => [
'CSV_ID' => 'table_id',
'CreatedDate' => 'created_at',
'ModifiedDate' => 'updated_at',
'Website' => 'website',
'FaceBook' => 'facebook',
'Twitter' => 'twitter',
'Instagram' => 'instagram',
'ModifiedBy' => 'modified_by',
'Enabled' => 'enabled'
],
'file' => 'file_name.csv',
]
];
echo $importer->run($configs);
Running the tests
Explain how to run the automated tests for this system, (*5)
Break down into end to end tests
Explain what these tests test and why, (*6)
Give an example
And coding style tests
Explain what these tests test and why, (*7)
Give an example
Deployment
Add additional notes about how to deploy this on a live system, (*8)
Built With
- Dropwizard - Bla bla bla
- Maven - Maybe
- Atom - ergaerga
Contributing
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us., (*9)
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository., (*10)
Authors
See also the list of contributors who participated in this project., (*11)
License
This project is licensed under the MIT License - see the LICENSE.md file for details, (*12)
Acknowledgments
- Hat tip to anyone who's code was used
- Inspiration
- etc