|
| 1 | +# tracker.php |
| 2 | + |
| 3 | +This script will do: |
| 4 | + |
| 5 | +* Setup the required database for the application. |
| 6 | +* Initial import and further update of issues and issue comments from GitHub. |
| 7 | + |
| 8 | +It is meant to be used during the development process and must be run from the PHP command line interface. |
| 9 | + |
| 10 | +Usage: |
| 11 | + |
| 12 | +`tracker.php <command> [action]` |
| 13 | + |
| 14 | +Available commands: |
| 15 | + |
| 16 | +* `install` Install the application. |
| 17 | +* `retrieve` Retrieve new issues and comments |
| 18 | +* `help` Display some helpful text. |
| 19 | + |
| 20 | +For more information use `tracker.php help <command>`. |
| 21 | + |
| 22 | +## Install the application |
| 23 | + |
| 24 | +Copy `/etc/config.example.json` to `/etc/config.json` and fill in your database details. |
| 25 | + |
| 26 | +Then run: |
| 27 | +`tracker.php install` |
| 28 | + |
| 29 | +## Retrieve new Issues and Comments |
| 30 | + |
| 31 | +`tracker.php retrieve issues` |
| 32 | + |
| 33 | +`tracker.php retrieve comments` |
| 34 | + |
| 35 | +## Colors |
| 36 | +Recently a new feature has been added to the framework that allows CLI applications to display colorful output on ANSI enabled terminals. So I thought we might see how it looks and feels ;) |
| 37 | + |
| 38 | +ANSI color codes are supported in most (if not all) *nix style terminals. |
| 39 | +To test this feature I grabbed a VM with Windows XP, installed git for Windows and GitHub (both include terminals) but neither them nor the standard Windows thingy supported ANSI colors. |
| 40 | +Then I installed [Cygwin](http://www.cygwin.com/) (which is a good choice anyway), and got the following output: |
| 41 | + |
| 42 | + |
| 43 | +## Progress Bar |
| 44 | +Since we have some long runng operations (currently ~10 min pulling the CMS issues on my slow i-net), I thought we might use some "high class" progress bar. |
| 45 | + |
| 46 | +The progress bar is not part of the repo and has to be installed using composer from [elkuku/console-progressbar](https://packagist.org/packages/elkuku/console-progressbar) (which is a fork of [PEAR/Console_ProgressBar](http://pear.php.net/package/Console_ProgressBar) with a facelifting ;) |
| 47 | +I haven't tried that on windows, but it might work on cygwin... |
| 48 | + |
| 49 | + |
| 50 | +## Unsupported... |
| 51 | +If your terminal does not support ANSI control codes you may see something like this: |
| 52 | + |
| 53 | + |
| 54 | +## Turn it off ! |
| 55 | +To suppress color ouput for a single command use the `--nocolors` switch. |
| 56 | +To suppress the progress bar for a single command use the `--noprogress` switch. |
| 57 | +Example: |
| 58 | +`tracker.php retrieve issues --nocolors --noprogress` |
| 59 | + |
| 60 | +To turn the feature(s) off permanently edit `etc/config.json` and set the values for the undesired features from `1` to `0`. |
| 61 | + |
| 62 | +---- |
| 63 | +Since most of the code in this PR has been used to actually test this feature before submitting it to the framework, I thought I could give this here back too. |
| 64 | + |
| 65 | +If you have any strong feelings against this, please raise your voice here and now or I am going to merge it ;) |
0 commit comments