Skip to content

Commit 0bb5064

Browse files
committed
Add some documentation collected from GitHub comments
1 parent 7fad0bc commit 0bb5064

File tree

9 files changed

+153
-0
lines changed

9 files changed

+153
-0
lines changed

Documentation/CLI-skript.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
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+
![win-colors1](https://f.cloud.github.com/assets/33978/491726/2c5ff9b4-ba54-11e2-80eb-76a29914d58a.png)
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+
![progressbar3](https://f.cloud.github.com/assets/33978/491733/a36ce152-ba54-11e2-8c06-179b6a379876.png)
49+
50+
## Unsupported...
51+
If your terminal does not support ANSI control codes you may see something like this:
52+
![win-colors-fail](https://f.cloud.github.com/assets/33978/491728/57cc233e-ba54-11e2-9c6b-154ad99488fd.png)
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 ;)

Documentation/access-control.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Access control
2+
Acces control is limited and very specific:
3+
4+
* Only **Projects** are tracked.
5+
* There are only 4 "hard wired" **Actions**:<br />`view`, `create`, `edit` and `manage`.
6+
* It is based on **groups** a user automatically belongs to or can be assigned to.<br />
7+
For every project two **system groups** are created by default:<br />`Public` and `User`.
8+
9+
The special **admin user** role that is assigned using the `config.json` file is granted global access.
10+
11+
Following is an example setup for a security tracker with non public access and two additionally created custom groups:
12+
![Access groups](https://f.cloud.github.com/assets/33978/550822/fc7c42a0-c31a-11e2-82c8-85f4ea05b92e.png)
13+
14+
However, this is a very first step... lots of optimization and testing required here.

Documentation/avatars.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Avatar support
2+
3+
On the first log in, the application tries to fetch the users avatar and store it locally.
4+
5+
The command `cli/tracker.php retrieve avatars` will fetch the avatars for the users that appear in the `#__activities` table.
6+
7+
**This requires cURL.** - since a redirect is made which J\Http (or me) is unable to handle properly.

Documentation/config-editor.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Config editor
2+
There is a "system component" that currently displays a config editor using simple text fields where you can fill in the values.
3+
Saving is not provided yet. When hitting the save button the config is written to the screen where you might copy&paste it ;)
4+
If you are on PHP < 5.4 there will be only a "compressed" version of the JSON string (a "pretty print" function could be written).
5+
TBH - I only wrote this because it requires very little code and at some point we (or whoever uses a JSON based config file) might think about an UI for editing it.

Documentation/database.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Database updates
2+
Obsolete tables and table fields have been removed while others have been added ;)
3+
4+
**Full reinstall required !**

Documentation/debugging.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
## Debugging and Logging
2+
3+
Added a TrackerDebugger class that... handles debugging :P
4+
Added a CallbackLogger class to provide database query logging.
5+
A log file can be written to log queries even during redirects ;)
6+
Exception rendering has been improved to include clickable file links using the xdebug protocol.
7+
8+
### Log files
9+
To activate or deactivate logging use the `debug.logging` option in `etc/config.json`.
10+
11+
Supported log events:
12+
* 403
13+
* 404
14+
* 500
15+
* database queries
16+
17+
The supported "events" will be written to their proper log file. Unsupported events go to the `500.log`.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## GitHub Authentication
2+
3+
GitHub limits requests to its API to 60 per hour for unauthenticated requests, and to 5000 per hour for requests using either basic authentication or oAuth.
4+
5+
For the initial import of issues and issue comments to the database we need to authenticate with GitHub to avoid to exceed the rate limit.
6+
7+
To use your GitHub credentials from the CLI script, edit the `config.json` file and fill in your GitHub username and password, answer "yes" to the question if you whish to authenticate, or pass the `--auth` option.
8+
9+
This will add the possibility to authenticate a user with his/her GitHub account using oAuth authentication.
10+
11+
#### oAuth login
12+
In order to test the login feature in your local environment you will need to create an application `key` and `secret` for your (local) JTrackerApplication instance:
13+
14+
* Sail to your account on GitHub &rArr; "Edit your Profile".
15+
* Go to "Applications" - "Developer applications" and "Register new application"
16+
* Fill in some name and some main url. Those will be presented to the user when authorizing the application.
17+
* Fill in a domain for callback URL. This **must match** the domain the application is running. This may be `http://localhost` or a virtual host.
18+
* Hit "Save" and copy the client_id and client_secret.
19+
* Edit `config.json` and fill in the `client_id` and `client_secret`.
20+
* Install as usual.
21+
* Sail to your localhosts JTracker installation and click on "Login with GitHub"
22+
* On the first attempt you will be redirected to GitHub where you have to confirm the access by your application.

Documentation/pagination.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Pagination
2+
3+
I searched the web for "PHP pagination MySQL" or similar, and this came up on the first page:
4+
http://www.awcore.com/dev/1/3/Create-Awesome-PHPMYSQL-Pagination_en
5+
6+
I liked the way the author solved "the problem", the code looked acceptable,... so I "forked" and Joomla!"d it :)
7+
The CSS was somewhat conflicting (for me), so I took one of the beautiful styles from the author, and now it looks like this:
8+
9+
![Pagination](https://f.cloud.github.com/assets/33978/550842/960024f0-c31b-11e2-971c-c7d870320600.png)
10+
11+
For now it only generates "plain links" adding a `&page=n` parameter to the current URL.
12+
When we implement the search functionality, this must be revised.
13+
I can also imagine a JavaScript (AJAX) based solution using this.
14+
15+
**Note**: The license on this is very unclear. Seems that is provided as a "snippet". Maybe our legal department should have a look at this ;)

Documentation/session.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Session management
2+
Is provided by the [session subsystem from the Symfony2 HttpFoundation Component](http://symfony.com/doc/master/components/http_foundation/sessions.html)
3+
4+
The new possibilities are still to explore....

0 commit comments

Comments
 (0)