Skip to content

Commit

Permalink
Prepared for composer release
Browse files Browse the repository at this point in the history
  • Loading branch information
huwcbjones committed Oct 20, 2019
1 parent b21464f commit 0d15184
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 7 deletions.
54 changes: 51 additions & 3 deletions README.md
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
7 changes: 3 additions & 4 deletions composer.json
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": {
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Rankings DB Docs

TBW (To Be Written)

0 comments on commit 0d15184

Please sign in to comment.