- PHP - 7.1.16
- MySQL - 5.6.41
- MySQL user
root
with passroot
. - A database named
test
in mysql.
- Using database
test
(or change the DB name property in code in fileutils/DBWrapper.php
), create required table by runningsql/currency_rates_ddl.sql
. - Run
$ php cron-job.php
to get data from the API and populate the DB table. - Run
$ php main.php
to activate the CLI. - Input individual requests like
JPY 500
or array requests likearray( 'JPY 5000', 'CZK 62.5' )
- Input
exit
to quit the CLI.
- I've pointed out future improvements as inline comments in the code. Look for
Future me [TODO]: ...
comments.
Took a bit more than 3 hours to complete the task (including writing documentation and uploading).