Php task for catalyst IT.
For this project you must have php installed and version 8.1.*
If you have php and mysql installed you can just run scripts like below just make sure you have database created users_csv_upload.
cd /php-catalyst
php user_upload.php --create-table --file="users.csv" -u="test" -p="password" -h="127.0.0.1"
php user_upload.php --dry-run
php user_upload.php --help
cd /php-catalyst
php foobar.phpThis will run script using Docker and you can pass enviroment variables through to script with docker
cd /php-catalyst
docker build -t php-catalyst . --no-cache
docker image ls
docker run 83264c49022efile_name=users.csv db_user=user db_password=password db_host=host.docker.internal
cd /php-catalyst
docker build --build-arg file_name="users.csv" --build-arg db_user="user" --build-arg db_host="host.docker.internal" --build-arg db_password="password" -t php-catalyst --no-cache .Docker compose file creates database and calls it users_csv_upload. Make sure you have docker compose command installed.
To run docker compose file make sure you have docker compose command installed and run:
cd /php-catalyst
docker compose upTo teardown docker containers
cd /php-catalyst
docker compose down