A command-line program, based on Laravel Zero.
- The program processes a local XML file and pushes the data of that XML file to a DB of choice.
- Errors are logged to a file
- Application is tested using PHPUnit
git clone [email protected]:fahadbinashraf/datafeeder.git
The database and logging configurations are done using the environment file
Copy the .env.example:
cp .env.example .env
The application can be simply executed using docker-compose.
- docker
- docker-compose
The XML file by default should be placed in the /data/feed.xml which is used when running the docker container.
docker-comopse up --build
This will do the following:
- build the environment
- install composer dependencies
- run database migration (to create the table)
- run unit tests
- run the import:products command
Make sure you have following installed:
- PHP 8.1
- Composer 2
Install dependencies:
composer install
Run database migrations:
php datafeeder migrate
Run tests:
php datafeeder test
Run the import command:
php datafeeder import:products /path/to/file.xml