GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - shijialee/loaduser: load user and foobar

BranchesTags
Open more actions menu

Latest commit

 

History

19 Commits
19 Commits

Folders and files

NameName
Last commit message
Last commit date
DataImporter.php
DataImporter.php
 
 
Makefile
Makefile
 
 
README.md
README.md
 
 
composer.json
composer.json
 
 
composer.lock
composer.lock
 
 
foobar.php
foobar.php
 
 
user_upload.php
user_upload.php
 
 
users.csv
users.csv
 
 

Repository files navigation

This is a command line tool that takes a csv file and load content into database.

Chunk database insertion is supported to handle large file.

Few assumptions:

  • If an email is invalid, error prints out and the line is not inserted.
  • Name, surname and email are not empty and can't be 0. Otherwise, line won't be inserted.
  • If it's a csv file, the first line is always the header.

Usage

Setup

This setup uses docker and php so make sure they are installed on your local system.

Run the following commands to setup development environment.

  1. make install : Pulls docker images for database and php composer. Builds composer packages.
  2. make start-db : start database docker container on 127.0.0.1, port 3306.
  • this starts a mysql database with default user, password and database set to catalyst.

Run the program

  • create table
    • php user_upload.php --create_table -u catalyst -p catalyst -h 127.0.0.1
  • dry run
    • php user_upload.php --dry_run --file users.csv -u catalyst -p catalyst -h 127.0.0.1
  • load users.csv file to database table.
    • `php user_upload.php --file users.csv -u catalyst -p catalyst -h 127.0.0.1

Clean up

  • make clean: remove docker container and network

Further Improvements

  • Email can be checked against DNS lookup using egulias/email-validator package.

About

load user and foobar

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.