A CLI for ffa-php-mock and ffa-php-core
The goal is to
- replace my dispersed scripts into this one package
- pack it into a .phar file (similar to composer)
- replace all my script calls in the crons with
php ffa.phar department:report --parameters
- drop my
ffa-mfe/databases-api
project
Below code snippets are for linux
- Install php 7
- Install composer
- Install package dependencies:
php composer.phar install
The current CLI is in another repository and needs to be rewritten. This is the rewrite, and it uses Symfony2/Console. Here are example usages before and after the rewrite:
Currently in ffa-php-mock:
php bin/treasury-debitInterest.php
php bin/treasury-debitInterest.php format=json
php bin/treasury-debitInterest.php format=json date_month=2015-01
php bin/treasury-debitInterest.php format=emailIfAny
php bin/treasury-debitInterest.php format=emailIfAny accountType=Tanya notifyTracker=true publishToBlog=true
To become in this package:
php bin/ffa.php treasury:debit-interest
php bin/ffa.php treasury:debit-interest --format=json
php bin/ffa.php treasury:debit-interest --format=json --date_month=2015-01
php bin/ffa.php treasury:debit-interest --format=emailIfAny
php bin/ffa.php treasury:debit-interest --format=emailIfAny --accountType=Tanya --notifyTracker --publishToBlog
The rewrite process will start with the treasury debit interests report and gradually include all other reports
Currently in ffa-php-mock:
php bin/treasury-soa.php format=email emailTo="[email protected];[email protected]" base=Dubai
php bin/treasury-soa.php format=email emailTo="[email protected];[email protected]" base=Dubai notifyTracker=true publishToBlog=true
To become
php bin/ffa.php treasury:soa --base=Dubai --format=email --emailTo="[email protected];[email protected]"
php bin/ffa.php treasury:soa --base=Dubai --format=email --emailTo="[email protected];[email protected]" --notifyTracker --publishToBlog
Currently in ffa-php-mock:
php bin/treasury-ffa017.php emailTo="[email protected];[email protected]"
To become
php bin/ffa.php treasury:ffa017 --emailTo="[email protected];[email protected]"
Currently in ffa-php-mock:
php bin/treasury-cmt.php format=email base=Dubai notifyTracker=true
To become
php bin/ffa.php treasury:cmt --format=email --base=Dubai --notifyTracker