RefLibRis
, (*1)
This library provide a writer to RIS data format., (*2)
Installation
- Follow the instructions at http://packagist.org
- In your new project, create a
composer.json
file which requires
RefLibRis:
{
"require": {
"funstaff/ref-lib-ris": ">=2.0"
}
}
Use
<?php
namespace ...;
use Funstaff\RefLibRis\RecordProcessing;
use Funstaff\RefLibRis\RisDefinition;
use Funstaff\RefLibRis\RisMappings;
use Funstaff\RefLibRis\RisWriter;
$mapping = [
'DEFAULT' => [
'TY' => ['type'],
'AU' => ['author'],
'TI' => ['title', 'title_secondary'],
],
'BOOK' => [
'TY' => ['type'],
'AU' => ['author'],
'TI' => ['title', 'title_secondary'],
'ID' => ['recordid']
]
];
$recordDb = [
'title' => ['History of the CDC PY - 1999'],
'author' => ['Behrens, J.', 'Behrens, A.'],
'type' => ['BOOK']
];
$risMappings = new RisMappings($mapping, 'DEFAULT');
$recordProcessing = new RecordProcessing($risMappings);
$record = $recordProcessing->process($recordDb);
$writer = new RisWriter(new RisDefinition());
$output = $writer->addRecord($record)->process();
Output:, (*3)
TY - BOOK
AU - Behrens, J.
AU - Behrens, A.
TI - History of the CDC PY - 1999
ER -
Found a bug
If you found a bug, please let me know. The best way is to file a report at
http://github.com/funstaff/RefLibRis/issues., (*4)