-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b21464f
commit 0d15184
Showing
3 changed files
with
57 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
Rankings DB | ||
============ | ||
PHP library to interact with British Swimming rankings database. | ||
# Rankings DB | ||
|
||
Rankings DB is a PHP library to provide a clean interface to interact with the British Swimming rankings database. | ||
|
||
|
||
## Install | ||
Via Composer: | ||
|
||
```bash | ||
$ composer require huwcbjones/rankings-db * | ||
``` | ||
|
||
## Basic Usage | ||
```php | ||
<?php | ||
|
||
// This file is generated by Composer | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
$client = new \RankingsDB\RankingsClient($personal_key, $personal_key_id_number); | ||
``` | ||
|
||
From a `$client` object, you can fetch member details and times. | ||
|
||
```php | ||
<?php | ||
// This file is generated by Composer | ||
require_once __DIR__ . '/vendor/autoload.php'; | ||
|
||
$client = new \RankingsDB\RankingsClient($personal_key, $personal_key_id_number); | ||
|
||
// Get a member's details | ||
$member = $client->getMemberDetails($member_id); | ||
|
||
// Get their all time PBs | ||
$options = new GetTimesBuilder($member->MemberID()); | ||
$times = $client->getTimes($options); | ||
|
||
// Get their times from the past year | ||
$options->setFromDate((new DateTime())->sub(new DateInterval("P1Y"))); | ||
|
||
$times = $client->getTimes($options); | ||
``` | ||
|
||
## Documentation | ||
See the [`doc` directory](doc/) for more detailed documentation. | ||
|
||
|
||
## License | ||
|
||
`rankings-db-php` is licensed under the MIT License - see the [LICENSE](LICENSE) file for details |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
{ | ||
"name": "huwcbjones/rankings-db", | ||
"description": "Library to interact with British Swimming rankings database", | ||
"version": "0.1.0-dev", | ||
"type": "library", | ||
"homepage": "https://github.com/huwcbjones/rankings-db", | ||
"homepage": "https://github.com/huwcbjones/rankings-db-php", | ||
"keywords": ["british", "swimming", "rankings", "database", "members", "times"], | ||
"readme": "README.md", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Huw Jones", | ||
"email": "[email protected]", | ||
"homepage": "https://www.huwcbjones.co.uk", | ||
"role": "Developer" | ||
"homepage": "https://www.huwcbjones.co.uk" | ||
} | ||
], | ||
"autoload": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Rankings DB Docs | ||
|
||
TBW (To Be Written) |