funstaff / ref-lib-ris
RIS is a format for reference metadata
Installs: 4 749
Dependents: 1
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-11-22 01:54:35 UTC
README
- Author: Bertrand Zuchuat bertrand.zuchuat@gmail.com
- License: MIT
This library provide a writer to RIS data format.
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:
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.