Added transition page

Jeroen De Meerleer 2019-05-27 12:58:30 +02:00
parent 27941cdd1e
commit 6e3c972a2c

@ -0,0 +1,20 @@
Currently the project is in the phase of transforming from pairtwo-only to a generalized view for multiple programs.
This makes it relatively easy to add other filetypes. However, this process requires rewriting and renaming some functions. This document is dedicated to these adjustments.
## `Sws::readSws` renamed to `ReaderInterface::read`
When you want to read a file, all you need to do is to create an instance of the ReaderInterface and call its read function. This procedure will be the same for any filetype in the library.
I have created a easy class to get to the right class for your file. This IOFactory class currently only has 1 type which is for Pairtwo (starting from version 6). But there will be added other filetypes as well.
### Old code
```php
require_once 'vendor/autoload.php';
$sws = Sws::readSws('<filename>');
```
### New code
```php
require_once 'vendor/autoload.php';
$reader = IOFactory::createReader('Pairtwo-6');
$sws = $reader->read('<filename>');