Documentation fixups

This commit is contained in:
Jeroen De Meerleer 2019-09-30 20:43:07 +02:00
parent 6c2aed46e8
commit 2bf1b59861
Signed by: JeroenED
GPG Key ID: 28CCCB8F62BFADD6
3 changed files with 21 additions and 18 deletions

View File

@ -2,10 +2,10 @@
## vx.y.z (Release: aa-bbb-cccc) ## vx.y.z (Release: aa-bbb-cccc)
* NEW FEATURE: `Game::getBoard()` for getting the board number of the game * NEW FEATURE: `Game::getBoard()` for getting the board number of the game
* ENHANCEMENT: Some fields has been renamed to match coding guideline (Please see [1ab96fa](https://github.com/JeroenED/libpairtwo/commit/1ab96fa04782c1b0f2b6bb9d1bac8397a74ab38e) for more info) * CHANGE: Some fields has been renamed to match coding guideline (Please see [1ab96fa](https://github.com/JeroenED/libpairtwo/commit/1ab96fa04782c1b0f2b6bb9d1bac8397a74ab38e) for more info)
## v1.2 (Release: 28-sep-2019) ## v1.2 (Release: 28-sep-2019)
* NEW READER: `Reader::swar-4` for reading out files created with SWAR version 4. * NEW READER: `Readers\Swar-4` for reading out files created with SWAR version 4.
* NEW FEATURE: `Tournament::getArbiters()` for multiple arbiters in 1 tournament * NEW FEATURE: `Tournament::getArbiters()` for multiple arbiters in 1 tournament
* ENHANCEMENT: `Class::getBinaryData()` methods return null if field is non-existent * ENHANCEMENT: `Class::getBinaryData()` methods return null if field is non-existent
* ENHANCEMENT: The template in distributions provides a more usable starting implementation * ENHANCEMENT: The template in distributions provides a more usable starting implementation
@ -30,7 +30,7 @@
* CHANGE: Version tag directly put in distribution filename * CHANGE: Version tag directly put in distribution filename
* CHANGE: `Tournament::GameExists()` renamed to `Tournament::gameExists()` * CHANGE: `Tournament::GameExists()` renamed to `Tournament::gameExists()`
* CHANGE: Updated composer metadata * CHANGE: Updated composer metadata
* CHANGE: Some setters changed to fluent setters. (More info: 7aca35057c10d2b982f93a698499c0c01df2fdc5) * CHANGE: Some setters changed to fluent setters. (More info: [7aca350](https://github.com/JeroenED/libpairtwo/commit/7aca35057c10d2b982f93a698499c0c01df2fdc5))
* CHANGE: Kashdan and Soccer Kashdan are combined in 1 function * CHANGE: Kashdan and Soccer Kashdan are combined in 1 function
* BUGFIX: Tagging did not work * BUGFIX: Tagging did not work

19
dist/readme.md vendored
View File

@ -4,30 +4,29 @@ This distribution is a good start to use libpairtwo if you don't have knowledge
How to use this distribution? How to use this distribution?
----------------------------- -----------------------------
The file `template.php` is the one you'll probably want to work with. You'll want to point your browser to this file. It contains some initializations where the most important one is the variable `$pairingfile`. You'll want to set this to existing pairing file. The file `template.php` is the one you'll probably want to work with. The user will want to point your browser to this file.
The other variable (`$pairingfileformat`) is a variable that defines the format of the above pairing file. For now only `Pairtwo-6`, `Pairtwo-5` and `Swar-4` are available. In the future more formats will become available. The first 2 lines of this file contains 2 important variables. The most important one is the variable `$pairingfile`. You'll want to set this to your existing pairing file. The other variable (`$fileformat`) is a variable that defines the format of the above pairing file. For now only `Pairtwo-6`, `Pairtwo-5` and `Swar-4` are available. In the future more formats will become available.
Below the comments you'll find some example code. The example codes gives the pairings and rankings of the currently used pairing file. If you need any modifications like adding your own template or you want to just write it to a file: go ahead it's all yours. Starting from line 8 you'll find some example code. The example codes gives the pairings and rankings of the currently used pairing file. If you need any modifications like adding your own template or you want to just write it to a file: go ahead it's all yours.
How to update the library? How to update the library?
-------------------------- --------------------------
If you want to upgrade the library to a new version of it you just need to remove the vendor direcotry and upload the updated one. If you want to upgrade the library to a new version you just need to remove the `vendor/` directory and upload the updated one.
I definitely say to remove it because simply overwriting might cause problems because residual files. It's important to remove the folder first because overwriting might cause problems because of residual files.
You might want to re-upload the file composer.json as well as this file might have been changed as well. However, it probably won't change a lot and can be safely ignored if you don't need other dependencies.
What if I need other dependencies? What if I need other dependencies?
---------------------------------- ----------------------------------
If you started to ask yourself this question, you'll probably know what composer and dependency management is? Therefore this section will become a little more advanced than the ones above. If you started to ask yourself this question, you'll probably know what composer and dependency management is? Therefore this section will become a little more advanced than the ones above.
It's actually very simple, just add them like you normally would do.
To add another dependency you just run `composer require {{ your new dependency }}`
$ composer require phpoffice/phpspreadsheet $ composer require phpoffice/phpspreadsheet
If you already have a project with other dependencies you'll only want to copy the `boilerplate.php` file and run. If you already have a project with other dependencies you'll only want to copy or edit the `template.php` file and run.
$ composer require jeroened/libpairtwo $ composer require jeroened/libpairtwo
If you want to update the libary while having other dependencies, you'll definitely don't want to remove vendor directory or composer.json file. The vendor folder contains these other dependencies and the composer.json contains the definitions of these dependencies. To update the library you only need to launch the update command. If you want to update the libary while having other dependencies you don't want to remove `vendor/` directory or `composer.json` file. The `vendor/` folder contains these other dependencies and the `composer.json` contains the definitions of these dependencies. To update the library you only need to launch the update command.
$ composer update jeroened/libpairtwo $ composer update jeroened/libpairtwo

14
dist/template.php vendored
View File

@ -1,3 +1,10 @@
<?php
// EDIT ME!
$pairingfile = 'your pairing-file.swar';
$fileformat = 'Swar-4'; // Possible values: Pairtwo-5, Pairtwo-6, Swar-4
?>
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
@ -19,10 +26,6 @@ use JeroenED\Libpairtwo\IOFactory;
require_once 'vendor/autoload.php'; require_once 'vendor/autoload.php';
// EDIT ME!
$pairingfile = 'your pairing-file.swar';
$fileformat = 'Swar-4'; // Possible values: Pairtwo-5, Pairtwo-6, Swar-4
if (!file_exists($pairingfile)) { if (!file_exists($pairingfile)) {
trigger_error('Your file is not set or doesn\'t exist! Edit the file: ' . __FILE__ . ' and try again', E_USER_ERROR); trigger_error('Your file is not set or doesn\'t exist! Edit the file: ' . __FILE__ . ' and try again', E_USER_ERROR);
} }
@ -58,8 +61,9 @@ foreach ($reader->getTournament()->getRounds() as $round) {
foreach ($round->getBye() as $pairing) { foreach ($round->getBye() as $pairing) {
$bye[] = $pairing->getPlayer()->getName(); $bye[] = $pairing->getPlayer()->getName();
} }
echo implode(', ', $bye); echo implode('; ', $bye);
echo '</p>' . PHP_EOL; echo '</p>' . PHP_EOL;
echo '<p><strong>Absent:</strong> '; echo '<p><strong>Absent:</strong> ';
$bye = []; $bye = [];
foreach ($round->getAbsent() as $pairing) { foreach ($round->getAbsent() as $pairing) {